Kubernetes fails to pull Docker image from artifactoryonline.com

8/8/2016

I am using Kubernetes on AWS to run a Play+AKKA Streams server.

Here is the version details:

Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4+3eed1e3", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"not a git tree"} Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}

Here is my deployment script:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: service-validation2
  labels:
    name: service-validation2
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        name: service-validation2
    spec:
      containers:
      - name: service-validation2
        image: company-docker-docker-local.artifactoryonline.com/service:1.0.192
        ports:
        - containerPort: 9000
      imagePullSecrets:
        - name: company-artifactory

when executing

kubectl create -f deployment.yaml --record

My pod goes into "ImagePullBackOff" status.

Here is the events list:

  • Successfully assigned service-validation2-3890064411-98444 to ip-172-20-0-134.us-west-2.compute.internal

  • pulling image "company-docker-docker-local.artifactoryonline.com/service:1.0.192"

  • Failed to pull image "company-docker-docker-local.artifactoryonline.com/service:1.0.192": Error: image service:1.0.192 not found

  • Error syncing pod, skipping: failed to "StartContainer" for "service-validation2" with ErrImagePull: "Error: image service:1.0.192 not found"

However, the image exists on the repository -- executing:

docker pull company-docker-docker-local.artifactoryonline.com/service:1.0.192

works on my machine.

Now, there are other pods running on this node.

I'm not sure this is relevant, but immediately prior to this problem, I had a bug (relating to Play's application.conf) which caused the pods to crash. But this was fixed.

-- Barak BN
artifactory
docker
kubernetes

2 Answers

4/17/2017

Possible reasons: 1> Authentication is not happening with artifactory 2> docker engine conflict (I had this issue) try restarting docker.

-- Milind Dhoke
Source: StackOverflow

8/9/2016

Have you authenticated to the Artifactory Registry? It might be that you are logged in on your machine, but you need the Kubernetes cluster authenticate to it, too.

You can do this by either directly configuring nodes to authenticate to a private repository or go the recommended way and using ImagePullSecrets.

-- puja
Source: StackOverflow