Outils pour utilisateurs

Outils du site


tech:notes_kubernetes_k8s_-_utilisation

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_kubernetes_k8s_-_utilisation [2025/11/07 11:45] Jean-Baptistetech:notes_kubernetes_k8s_-_utilisation [2026/02/05 21:54] (Version actuelle) Jean-Baptiste
Ligne 77: Ligne 77:
 kubectl get deploy -A | grep plop kubectl get deploy -A | grep plop
 </code> </code>
 +
 +Attendre un état - ex que les pods soient prêts
 +<code bash>
 +
 +
 +An alternative approach is to use kubectl wait
 +
 +You could:
 +<code bash>
 +kubectl wait pod --all --for=condition=Ready --namespace=${ns}
 +
 +kubectl wait pod --all --for=condition=Ready -A
 +</code>
 +
  
  
Ligne 222: Ligne 236:
 Création d'un pod Création d'un pod
  
-<code yaml nginx.yaml>+''nginx.yaml'' 
 +<code yaml>
 apiVersion: v1 apiVersion: v1
 kind: Pod kind: Pod
Ligne 238: Ligne 253:
  
  
 +== Autres
  
 +<code bash>
 +export POD_NAME=$(kubectl get pods --namespace kube-system -l "app.kubernetes.io/name=headlamp,app.kubernetes.io/instance=my-headlamp" -o jsonpath="{.items[0].metadata.name}")
 +
 +export CONTAINER_PORT=$(kubectl get pod --namespace kube-system $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
 +
 +kubectl --namespace kube-system port-forward $POD_NAME 8080:$CONTAINER_PORT
 +</code>
  
tech/notes_kubernetes_k8s_-_utilisation.1762512303.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki