OpenShift Container Platform unable to pull private Docker Hub images

7/14/2018

I have an instance of OpenShift Container Platform 3.9 running.

  1. I created a docker hub secrets with credentials to access private images.
  2. I linked the newly created secret to the default service account for pull access.
  3. I created an ImageStream, to access the private image, which seems to have access as it is correctly accessing the image sha.
  4. I created a DeploymentConfig to deploy the image. When deploying, I get the following error message when attempting to pull the image Failed to pull image "myorg/myimage": rpc error: code = Unknown desc = repository docker.io/myorg/myimage not found: does not exist or no pull access

The image stream looks as follows:

apiVersion: v1
kind: ImageStream
metadata:
  name: myimage
spec:
  dockerImageRepository: docker.io/myorg/myimage
  tags:
    - name: mytag
      generation: 2
      from:
        kind: DockerImage
        name: 'docker.io/myorg/myimage:mytag'
      importPolicy:
        scheduled: true

The deployment config looks as follows:

apiVersion: v1
kind: DeploymentConfig
metadata:
  name: myservice
  generation: 1
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
      - name: myservice
        image: myorg/myimage:mytag
        imagePullPolicy: Always
        ports:
        - containerPort: 8888

What could I be doing wrong?

-- Patrick Kayongo
docker
docker-registry
kubernetes
openshift

0 Answers