azure - 除非我指定特定的标签版本,否则为什么我会得到 ImagePullBackOff?

标签 azure kubernetes azure-container-registry

如果我尝试使用 Azure 容器注册表中最新版本的镜像创建 Pod,则会收到“ImagePullBackOff”错误。如果我明确指定镜像版本,则 Pod 创建成功。

我创建了一个新的 Image Pull Secret,并且可以确认 Kubernetes 正在从 ACR 中拉取镜像,因为在设置版本时 Pod 成功启动。当我将镜像名称设置为 ACR_ImageName:latest 时(或者省略 :latest 时,或者将 imagePullPolicy 设置为“Always”时,pod 无法创建并报告以下错误:请注意,我已替换了 acr 名称和镜像姓名

Warning Failed 27m (x3 over 28m) kubelet, aks-agentpool-15809833-vmss000007
Failed to pull image "acrPath/imageName": [rpc error: code = Unknown desc = Error response from daemon: manifest for acrPath/imageName:latest not found: manifest unknown: manifest unknown, rpc error: code = Unknown desc = Error response from daemon: manifest for acrPath/imageName:latest not found: manifest unknown: manifest unknown, rpc error: code = Unknown desc = Error response from daemon: Get https://acrPath/imageName/manifests/latest: unauthorized: authentication required]

这不起作用

apiVersion: v1
kind: Pod
metadata:
  name: k8spocfrontend
  labels:
    app: k8spocfrontend
    type: frontend
spec:
  containers:
  - name: k8spocfrontend
    image: dteuwhorizonacrhorizonmain.azurecr.io/k8spocfront:latest
    imagePullPolicy: "Always"
  imagePullSecrets:
  - name: acr-auth-poc

这有效

apiVersion: v1
kind: Pod
metadata:
  name: k8spocfrontend
  labels:
    app: k8spocfrontend
    type: frontend
spec:
  containers:
  - name: k8spocfrontend
    image: dteuwhorizonacrhorizonmain.azurecr.io/k8spocfront:2617
    imagePullPolicy: "Always"
  imagePullSecrets:
  - name: acr-auth-poc

正如您从下面的 pod 中看到的,pod 是在设置版本标记时创建的。

k8spocfront-5dbf7544f8-ccnxj | 2/2 | Running | 0 | 33m

最佳答案

您似乎没有带有最新标签的图片。基本上我们将最新标签覆盖到最新版本的图像。

关于azure - 除非我指定特定的标签版本,否则为什么我会得到 ImagePullBackOff?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57658852/

相关文章:

Azure 服务总线未经授权错误 : InvalidSignature: The token has an invalid signature inside Kubernetes cluster

kubernetes - 有没有办法使 RunTimeClass 默认为命名空间?

.net - 从 Azure devops 管道部署时无法访问 Azure Function Runtime

apache-kafka - 如何在 Kubernetes 上部署 Kafka Stream 应用程序?

Azure DevOps 管道 - 如何通过自托管代理在 Docker 容器中执行整个模板阶段

azure-devops - 通过 Terraform Helm 提供程序和 Azure DevOps 部署 Helm chart ,同时从 ACR 获取 Helm chart

azure - 需要通过 Azure 策略将日期格式正确强制执行为 MM/DD/YYYY 输入,以便在订阅中创建 VM

azure - 如何将消息添加到azure webjobs队列

c# - 通过 Azure 函数显示 Azure Blob 存储中的文件

python - 如何在 Azure ML Studio Designer 中训练自定义 Tensorflow 模型