An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
Hello Varma,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you would like to know how you can record during upgrading to new image.
The behavior you observed is expected because the --record flag has been removed from modern Kubernetes releases, and kubectl rollout history only displays the kubernetes.io/change-cause annotation rather than the deployed container image version. Since no change-cause annotation was added, the rollout history correctly shows <none>, even though the image was successfully updated to nginx:1.17.0.
The recommended and supported approach is to:
- Update the Deployment image using
kubectl set image. - Add a
kubernetes.io/change-causeannotation if you want meaningful rollout history. - Verify the deployed image using
kubectl describe deploymentorkubectl get deployment -o=jsonpath=.... - Use
kubectl rollout historyonly to review deployment change descriptions, not image versions.
Based on the deployment output you shared, the rollout completed successfully, the Deployment revision incremented correctly, and the new ReplicaSet replaced the previous one. No Azure Support or Product Group escalation is required because this is expected Kubernetes behavior. Kindly use the following resources for additional information:
- Kubernetes Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- kubectl set image: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_set/kubectl_set_image/
- kubectl rollout: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/
- Kubernetes Annotations: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
Observe the below commands for your review:
- Use the supported command to update the container image:
kubectl set image deployment/nginx-deployment nginx=nginx:1.17.0 - If you want rollout history to show a meaningful description, add a change-cause annotation:
kubectl annotate deployment nginx-deployment \ kubernetes.io/change-cause="Upgrade nginx image to 1.17.0" \ --overwrite - Confirm that the Deployment is running the expected image:
kubectl get deployment nginx-deployment \ -o=jsonpath="{.spec.template.spec.containers[*].image}"orkubectl describe deployment nginx-deploymentThe output should show:nginx:1.17.0 - Display the deployment revision history:
kubectl rollout history deployment/nginx-deploymentThe history will display the configured CHANGE-CAUSE annotation rather than the image version. - Confirm that the rolling update completed successfully:
kubectl rollout status deployment/nginx-deployment
I hope this is helpful. Please! Do not hesitate to let me know if you have any other questions, steps or clarifications.
Please do not close the thread by upvoting and accepting the answer if any part of it is helpful.