简体   繁体   English

为什么 EKS pod 引用旧的人工图像地址?

[英]Why EKS pods referring to old artifactory image address?

We migrated our docker image artifactory from the self-hosted Nexus on EC2 to the ECR repository and updated the new image reference in all the deployments.我们将 docker 图像工件从 EC2 上的自托管 Nexus 迁移到 ECR 存储库,并更新了所有部署中的新图像引用。 But many times we observed that when the pod is recreated or deployment is restarted the pod fails with the imagepullbackoff error because it is referring to the old image reference which does not exist whereas its deployment contains the new image reference.但很多时候我们观察到,当重新创建 pod 或重新启动部署时,pod 会失败并出现imagepullbackoff错误,因为它指的是不存在的旧图像引用,而其部署包含新图像引用。 Then we have to manually update the new image reference in the pod which is not the correct way.然后我们必须手动更新 pod 中的新图像引用,这是不正确的方法。 Does anybody know why this behavior is happening?有谁知道为什么会发生这种行为?

when changing the container image name or tag you would just scale your application to 0 and back to the original size means all pods will be deleted and recreated so image tags will be updated in every pod you can do it by:当更改容器图像名称或标签时,您只需将应用程序缩放为 0 并恢复到原始大小,这意味着所有 pod 都将被删除并重新创建,因此图像标签将在每个 pod 中更新,您可以通过以下方式完成:

kubectl scale --replicas=0 deployment my-deployment 

Ensure you set ImagePullPolicy: Always and kill each pod and have the deployment recreate it.确保设置ImagePullPolicy: Always并终止每个 pod 并让部署重新创建它。 this step is not required for local images.本地图像不需要此步骤。

Now update the image simple way is by using following command:现在更新图像的简单方法是使用以下命令:

kubectl set image deployment/my-deployment mycontainer=myimage

Now scale up the deployment using the below command ensure you have matched the replica count before and after updating image现在使用以下命令扩展部署,确保您在更新映像之前和之后匹配副本计数

kubectl scale --replicas=1 deployment application

Now check if imagepullbackoff error repeats now.现在检查imagepullbackoff错误是否再次出现。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 AWS EKS 中自动扩展 POD - Autoscaling of PODs in AWS EKS 您最终为 Container Insights for EKS 为短期 Pod 创建的每个指标支付了多少费用? - How much do you end up paying for each metric created by Container Insights for EKS for short lived pods? 为什么 python 代码无法在 EKS pod 容器内运行? - Why python code is unable to run inside a EKS pod container? 如果日志存储在主机中,为什么我应该在 eks 上使用 Filebeat 作为 daemonset? - Why should I use Filebeat as daemonset on eks if logs are stored in host? 为什么应用卡在 module.eks.aws_autoscaling_group.workers[0]: Refreshing state? - Why does apply get stuck at module.eks.aws_autoscaling_group.workers[0]: Refreshing state? 无法修改(补丁)docker eks(aws)上现有 kube.netes 部署定义的图像 ID - Can't modify(patch) docker image id of existing kubernetes deployment definition on eks(aws) 无法在使用“带有 Docker 的 Ubuntu”映像创建的 GKE 集群上部署 pod - Unable to deploy pods on GKE cluster created using 'Ubuntu with Docker' image 为什么我的 ALB 端点出现 502 错误,针对 EKS 托管服务 - Why am I getting 502 errors on my ALB end points, targeted at EKS hosted services 节点上的 Pod 限制 - AWS EKS - Pod limit on Node - AWS EKS 我尝试获取我上传到存储的图像的 url,我发现的代码非常旧 - I try to get the url of the image I uploaded to storage, the codes I find are very old
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM