Kubectl Rollout Strategy
Zero-downtime deploys: history, pause, resume, and rollback.
- kubectl rollout
- canary
- pause rollout
- rollout restart
- zero downtime
Kubectl Rollout Strategy
Zero-downtime deploys: history, pause, resume, and rollback.
Commands
| Command | What it does |
|---|---|
kubectl rollout history deploy/api | Revision list |
kubectl rollout status deploy/api | Block until rollout finishes |
kubectl rollout pause deploy/api | Canary: stop after first new pods |
kubectl rollout resume deploy/api | Continue a paused rollout |
kubectl rollout restart deploy/api | Fresh pods, same image (e.g. reload secrets) |
Example
kubectl set image deploy/api api=registry/api:v2
kubectl rollout status deploy/api
kubectl rollout undo deploy/api --to-revision=3
FAQ
How do canary releases work here?
Pause mid-rollout, verify metrics on new pods, then resume — or use Argo Rollouts for real weighted canaries.
rollout restart — when?
After Secret/ConfigMap changes or to clear leaked state without changing the image tag.
คำถามที่พบบ่อย
How do canary releases work here?
Pause mid-rollout, verify metrics on new pods, then resume — or use Argo Rollouts for real weighted canaries.
rollout restart — when?
After Secret/ConfigMap changes or to clear leaked state without changing the image tag.
Kubernetes
Kubectl Config and Context
Point kubectl at the right cluster and switch contexts safely.
Kubectl Pods
Inspect pods, describe failures, and get a shell inside.
Kubectl Deployments
Create, update, and inspect Deployments that own your pods.
Kubectl Services
Expose pods stably with ClusterIP, NodePort, and LoadBalancer.