informatique:kebernetes:kube_service
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| informatique:kebernetes:kube_service [2023/12/15 13:49] – [ClusterIP] benoit | informatique:kebernetes:kube_service [2023/12/18 07:23] (Version actuelle) – [LoadBalancer] benoit | ||
|---|---|---|---|
| Ligne 129: | Ligne 129: | ||
| ===== NodePort ===== | ===== NodePort ===== | ||
| - | La création d'un service de type **NodePort** | + | La création d'un service de type **NodePort** |
| Comme pour la création d'un service ClusterIP plus haut, nous allons créer un service et lancer un Pod : | Comme pour la création d'un service ClusterIP plus haut, nous allons créer un service et lancer un Pod : | ||
| Ligne 192: | Ligne 192: | ||
| k8s-node | k8s-node | ||
| - | | + | ===== LoadBalancer ===== |
| + | |||
| + | :!: A approfondir :!: | ||
| + | |||
| + | La création d'un service de type **LoadBalancer** créé aussi les services **NodePort** et **ClusterIP**. En revanche, il permet d' | ||
| + | |||
| + | Fichier YAML correspond (identique à NodePort mais le type change) : | ||
| + | apiVersion: v1 | ||
| + | kind: Pod | ||
| + | metadata: | ||
| + | name: nginx | ||
| + | labels: | ||
| + | app: mywebapp | ||
| + | spec: | ||
| + | containers: | ||
| + | - name: nginx | ||
| + | image: nginx: | ||
| + | ports: | ||
| + | - containerPort: | ||
| + | --- | ||
| + | apiVersion: v1 | ||
| + | kind: Service | ||
| + | metadata: | ||
| + | name: nginx-service | ||
| + | spec: | ||
| + | type: LoadBalancer | ||
| + | selector: | ||
| + | app: mywebapp | ||
| + | ports: | ||
| + | - name: mywebport | ||
| + | protocol: TCP | ||
| + | port: 8080 | ||
| + | targetPort: 80 | ||
| + | nodePort: 31000 | ||
| + | |||
| + | ===== ExternalName ===== | ||
| ===== Ingress ===== | ===== Ingress ===== | ||
informatique/kebernetes/kube_service.1702648147.txt.gz · Dernière modification : de benoit
