Tous les labs

Perform and recover a rollout

Intermediate ~22 mink8s

Update web from nginx:1.26 to nginx:1.27, scale to four replicas, then practice rolling back one revision.

Simulateur déterministe — tape une commande (kubectl get pods -A) pour commencer.
student@kubelab:~$
Objectifs
  • Set the image to nginx:1.27
  • Scale to four replicas
  • Observe rollout status and history
  • Undo the most recent rollout
Étapes suggérées
  1. Use kubectl set image.
  2. Wait for rollout status before rollback.
  3. Check image after undo.
Indices
Voir la solution
kubectl set image deployment/web web=nginx:1.27 -n app
kubectl scale deployment/web --replicas=4 -n app
kubectl rollout status deployment/web -n app
kubectl rollout undo deployment/web -n app