Skip to main content

🔁 Rollout

A rollout is the gradual update of an application: old pods are replaced by new ones little by little, without taking the service down. If the new version does not become ready, Kubernetes keeps the old pods serving.

info

Rollouts are done with kubectl. The Nuvion Panel does not have this feature.


🚀 Before you start​

  • Have cluster access configured (see Cluster Access).
  • Have the web-deploy Deployment from the Deploy page (image nginx:1.26).

🚀 1. Update the image version​

kubectl set image deployment/web-deploy nginx=nginx:1.27

The format is CONTAINER-NAME=NEW-IMAGE. In the Deploy page template, the container is named nginx.

🚀 2. Follow the update​

kubectl rollout status deployment/web-deploy
kubectl get pods -l app=web-deploy

You will see new pods coming up while the old ones leave. The end result is successfully rolled out.

🚀 3. Record the reason for the change​

kubectl annotate deployment/web-deploy kubernetes.io/change-cause="Atualiza nginx para 1.27" --overwrite

The text appears in the history from step 4.

🚀 4. See the history​

kubectl rollout history deployment/web-deploy

Each version of the Deployment is a numbered revision.

🚀 5. Control the pace of the update​

By default, Kubernetes updates in stages. You can adjust this in the Deployment:

spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
FieldMeaning
maxUnavailable: 0Never have fewer pods than desired
maxSurge: 1Can create 1 extra pod during the swap

🚀 6. Pause and resume (optional)​

kubectl rollout pause deployment/web-deploy
kubectl rollout resume deployment/web-deploy

✅ How to know it worked​

kubectl get deployment web-deploy -o jsonpath='{.spec.template.spec.containers[0].image}'

The command shows nginx:1.27.

❗ Common problems​

SymptomCauseSolution
rollout status keeps waitingThe new pods do not become readySee kubectl get pods: if ImagePullBackOff appears, the image does not exist. Undo with Rollback
unable to find container namedWrong container nameSee the name with kubectl describe deployment web-deploy
timed out waiting for the conditionThe update exceeded the deadlineCheck the Events and do the Rollback

➡️ Next step: Rollback

🧠 Questions?​

Talk to our SaveinCloud technical support team!