迁移 Kubernetes 集群时出现 CreateContainerConfigError

CreateContainerConfigError while migrating Kubernetes cluster

我们正在将 K8S 集群迁移到新的 AWS 区域。

在需要迁移的开发服务器上使用以下命令:

$ kubectl get secrets -n cog-stage -o yaml --export > secrets-mumbairegion.yaml

在 AWS 孟买区域的 POC 服务器上:

$kubectl create -f ./secrets-mumbairegion.yaml -n cog-stage

$ kubectl get pods  -n cog-stage  

    NAME                                  READY   STATUS                       RESTARTS   AGE
      keeper-68ff7            0/1     CreateContainerConfigError   0          44m
      bus-f954                0/1     CreateContainerConfigError   0          44m
      configservice-7gvg5        0/1     CreateContainerConfigError   0          44m
      fengsh-6fbc6bn8             0/1     CreateContainerConfigError   0          44m

检查此输出的最后一行是否成功仍然为什么会出现 CreateContainerConfigError: Successfully pulled image "gold/keeper:feature

$ kubectl describe  pod keeper-68ff7 -n cog-stage

Events:
  Type     Reason   Age                    From                                                  Message
  ----     ------   ----                   ----                                                  -------
  Warning  Failed   57m (x20 over 62m)     kubelet, ip-172-Xx0-xx.ap-south-1.compute.internal  Error: ImagePullBackOff
  Normal   BackOff  52m (x41 over 62m)     kubelet, ip-172-X-x-XX.ap-south-1.compute.internal  Back-off pulling image "gold/keeper:feature_rouXXX_fXnd_online_status.6662.092"
  Normal   Pulling  7m14s (x175 over 62m)  kubelet, ip-172-xx-xx-xx.ap-south-1.compute.internal  pulling image "gold/keeper:feature_roul_fXnd_online_status.XXX2960"
  Normal   Pulled   2m15s (x188 over 50m)  kubelet, ip-172-XX-xx-Xx.ap-south-1.compute.internal  Successfully pulled image "gold/keeper:feature_roul_frXnd_online_status.XXX0"

已通过迁移 ConfigMap 解决此问题

#kubectl create -f ./ConfigMap.yaml -n cog-stage