kubernetes runtime_error ai_generated true

错误:部署回滚状态卡住:等待部署规范更新被观察...

Error: Deployment rollout status is stuck: waiting for deployment spec update to be observed...

ID: kubernetes/deployment-rollout-stuck-image-pull-back-off

其他格式: JSON · Markdown 中文 · English
75%修复率
82%置信度
1证据数
2024-01-10首次发现

版本兼容性

版本状态引入弃用备注
kubectl v1.28 active
kubectl v1.29 active
kubectl v1.30 active

根因分析

部署的镜像拉取回退阻止新 Pod 启动,因此回滚无法完成。

English

Deployment's image pull back-off prevents new pods from starting, so rollout never completes.

generic

官方文档

https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-back-a-deployment

解决方案

  1. Check image pull error: `kubectl describe pod <pod-name> | grep -A5 'Back-off'` to see exact reason (e.g., 'ImagePullBackOff'). Then fix image tag or registry credentials.
  2. Update deployment with correct image: `kubectl set image deployment/<name> <container>=<correct-image>:<tag>` and watch rollout.
  3. If private registry, create image pull secret: `kubectl create secret docker-registry regcred --docker-server=<registry> --docker-username=<user> --docker-password=<pass> --docker-email=<email>` then patch service account.

无效尝试

常见但无效的做法:

  1. Force rollout restart with `kubectl rollout restart deployment` 90% 失败

    Restart does not fix the underlying image pull issue; new pods will still fail.

  2. Delete and recreate the deployment 85% 失败

    Recreating deployment uses same image spec; problem persists unless image is fixed.

  3. Wait longer (timeout >10 minutes) 80% 失败

    Back-off is exponential; waiting alone won't resolve if image doesn't exist or auth fails.