tech:notes_kubernetes_k8s_-_utilisation
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_kubernetes_k8s_-_utilisation [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech: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 | ||
| </ | </ | ||
| + | |||
| + | 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 | ||
| + | </ | ||
| + | |||
| Ligne 187: | Ligne 201: | ||
| </ | </ | ||
| - | Get a shell to the running container: | + | Get a shell to the running container |
| <code bash> | <code bash> | ||
| - | #kubectl exec --stdin --tty nginx -- /bin/bash | + | kubectl exec -ti nginx -- /bin/bash |
| - | kubectl exec -t -i nginx -- /bin/bash | + | </ |
| + | |||
| + | Get a shell to a specific running container | ||
| + | <code bash> | ||
| + | # Get containers list | ||
| + | kubectl get pod awx-task-777db545b8-7npjl -o jsonpath=' | ||
| + | |||
| + | kubectl exec -ti awx-task-777db545b8-7npjl --container awx-ee | ||
| </ | </ | ||
| Ligne 215: | Ligne 236: | ||
| Création d'un pod | Création d'un pod | ||
| - | <code yaml nginx.yaml> | + | '' |
| + | < | ||
| apiVersion: v1 | apiVersion: v1 | ||
| kind: Pod | kind: Pod | ||
| Ligne 231: | Ligne 253: | ||
| + | == Autres | ||
| + | <code bash> | ||
| + | export POD_NAME=$(kubectl get pods --namespace kube-system -l " | ||
| + | |||
| + | export CONTAINER_PORT=$(kubectl get pod --namespace kube-system $POD_NAME -o jsonpath=" | ||
| + | |||
| + | kubectl --namespace kube-system port-forward $POD_NAME 8080: | ||
| + | </ | ||
tech/notes_kubernetes_k8s_-_utilisation.1742825205.txt.gz · Dernière modification : de 127.0.0.1
