Why do I get ImagePullBackOff unless I specify specific tag version?

8/26/2019

If I attempt to create a Pod using the latest version of an image from Azure Container Registry, i get a "ImagePullBackOff" error. If I explicitly specify the image version, the Pod is created successfully.

I have created a new Image Pull Secret and can confirm that Kubernetes is pulling the image from ACR as the Pod starts up successfully when setting the version. When I set the image name to ACR_ImageName:latest (or when ommitting :latest, or when setting the imagePullPolicy to "Always", the pod fails to create reporting the following error: note that i have replace the acr name and image name

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]

This DOES NOT works

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

This works

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

As you can see from the pods below, the pods gets created when setting the version tag.

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

-- Tinus
azure
azure-container-registry
kubernetes

1 Answer

8/26/2019

Looks like you don't have the image with latest tag. Basically we overwrite the latest tag to latest version of image.

-- Bimal
Source: StackOverflow