Not able to create Azure Container Instance with CLI using private image

8/26/2017

I can't deploy pod using private image (ACR) using CLI and yaml file.

Deploying from registry directly using either az container or kubectl run does work however.

Pod status:

  "containers": [
    {

            "count": 3,
            "firstTimestamp": "2017-08-26T07:31:36+00:00",
            "lastTimestamp": "2017-08-26T07:32:20+00:00",
            "message": "Failed: Failed to pull image \"ucont01.azurecr.io/unreal-deb\": rpc error: code 2 desc Error: im age unreal-deb:latest not found",
            "type": "Warning"
          },
        ],
      },

Yaml file:

apiVersion: v1
kind: Pod
metadata:
  generateName: "game-"
  namespace: default
spec:
  nodeName: aci-connector
  dnsPolicy: ClusterFirst
  restartPolicy: Never
  containers:
    - name: unreal-dev-server
      image: ucont01.azurecr.io/unreal-deb
      imagePullPolicy: Always
      ports:
      - containerPort: 7777
        protocol: UDP
  imagePullSecrets:
    - name: registrykey
-- Ɓukasz Baran
azure
azure-container-instances
azure-container-registry
kubernetes

3 Answers

8/26/2017

If the credentials (corresponding to registrykey) are incorrect, you may get 'image not found' error, though the image exists. you may want to verify the registrykey credentials again..

-- Siva G
Source: StackOverflow

8/28/2017

Unfortunately the aci-connector-k8s doesn't currently support images from private repositories. There is an issue open to add support but it's not currently implemented.

https://github.com/Azure/aci-connector-k8s/issues/35

-- Lachlan Evenson
Source: StackOverflow

8/28/2017

According to your description, could you please check your repositories via Azure portal, like this:

enter image description here

Use your YAML, it work for me:

apiVersion: v1
kind: Pod
metadata:
  generateName: "game-"
  namespace: default
spec:
  nodeName: k8s-agent-379980cb-0
  dnsPolicy: ClusterFirst
  restartPolicy: Never
  containers:
    - name: unreal-dev-server
      image: jasontest.azurecr.io/samples/nginx
      imagePullPolicy: Always
      ports:
      - containerPort: 7777
        protocol: TCP
  imagePullSecrets:
    - name: secret1

Here is the screenshot:

enter image description here

Here is my secret:

jason@k8s-master-379980CB-0:~$ kubectl get secret
NAME                  TYPE                                  DATA      AGE
default-token-865dj   kubernetes.io/service-account-token   3         1h
secret1               kubernetes.io/dockercfg               1         47m
-- Jason Ye
Source: StackOverflow