Cybersecurity
Kubernetes
Subjective
Oct 07, 2025
How do you perform rolling updates and rollbacks in Kubernetes deployments?
Detailed Explanation
Kubernetes deployments support rolling updates to update applications with zero downtime and rollback capabilities for quick recovery.\n\nRolling Update Strategy:\n• Gradually replaces old pods with new ones\n• Maintains application availability\n• Configurable update parameters\n• Automatic rollback on failure\n\nUpdate Configuration:\n• maxUnavailable: Maximum pods unavailable during update\n• maxSurge: Maximum additional pods during update\n• progressDeadlineSeconds: Timeout for update\n• revisionHistoryLimit: Number of old ReplicaSets to keep\n\nUpdate Commands:\nkubectl set image deployment/app container=image:v2\nkubectl rollout status deployment/app\nkubectl rollout history deployment/app\nkubectl rollout undo deployment/app --to-revision=1\n\nExample Strategy:\nspec:\n strategy:\n type: RollingUpdate\n rollingUpdate:\n maxUnavailable: 25%\n maxSurge: 25%\n progressDeadlineSeconds: 600\n revisionHistoryLimit: 10\n\nBest Practices:\n• Use health checks for update validation\n• Monitor application metrics during updates\n• Test rollback procedures\n• Implement automated rollback triggers\n• Use feature flags for safer deployments
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts