# Calcule (compute)

# Compute Engine

<span style="color: #bbbbbb; font-size: 2.8275em; font-weight: 400;">IP Pricin</span><span style="color: #bbbbbb; font-size: 2.8275em; font-weight: 400;">g :</span>

[![image-1636578882146.png](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/scaled-1680-/image-1636578882146.png)](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/image-1636578882146.png)

## Network Pricing :

[![image-1636578924024.png](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/scaled-1680-/image-1636578924024.png)](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/image-1636578924024.png)

### Réductions liées à l'utilisation de vos VM :

[![image-1636642121306.png](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/scaled-1680-/image-1636642121306.png)](https://docs.nehemiebarkia.fr/uploads/images/gallery/2021-11/image-1636642121306.png)

### Conseils :

[![image-1664752679952.png](https://docs.nehemiebarkia.fr/uploads/images/gallery/2022-10/scaled-1680-/image-1664752679952.png)](https://docs.nehemiebarkia.fr/uploads/images/gallery/2022-10/image-1664752679952.png)

### Tips :

Quand on crée une machine virtuelle, ont peut spécifier trois options de politique de disponibilitées :

- **Préemptibles VM**
    - If the server will be subject to termination by Google in  
        exchange for a lower cost.
- **Automatique Restart**
    - Automatic restart indicates if the server stops due to a hardware failure, maintenance event, or some other non-user-controlled event.
- **On host Maintance**
    - Host maintenance indicates if the virtual server should be migrated to another physical server when a maintenance event occurs.

<span style="text-decoration: underline;">**Sole tenancy :**</span>

Pour ne pas partager un hyperviseur dans google cloud avec d'autre clients : [https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes?hl=fr](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes?hl=fr&authuser=0)

### Commandes :

```
gcloud compute instances list -format json 
```

<div id="bkmrk--1"><div>  
</div></div>

# Google Kubernetes Engine

<span style="text-decoration: underline;">**Créer un cluster :** </span>

```
gcloud container clusters create ch07-cluster-1 --num-nodes=4
```

<span style="text-decoration: underline;">**Ajouter un service :** </span>

```
kubectl run
```

### Détails techniques : 

Kubernetes Réserve le **CPU :**

**6 % du premier Coeur**

**1 % du second coeur**

**0.5 % du troisième et du quatrième coeur**

**0.25 % tous les coeurs supplémentaires**