0

I am trying to deploy an application via kubectl using an image stored on Codefresh. I have it running perfectly when i place the image on a public registry.

The problem is when I apply the deployment.yaml I get a "ImagePullBackOff" error on the pods. I'm assuming, i think correctly, that this is because I need a secret to be able to access my Codefresh image.

This is the container part of my current deployment.yaml:

spec:
      containers:
        - name: dockapp
        #States the image that will be put inside the pod. Secret to get access is declared below
        #registry.hub.docker.com/jamiedovu/dockapp:latest
          image:  r.cfcr.io/jamiew87/my-app-image:master
          ports:
          - containerPort: 8080
            name: http
      imagePullSecrets:
      - name: regcred

My question is, what is it i need to put into the secret "regcred" to be able to connect to this private registry. The Kubernetes documentation only demonstrates how to do one for docker.

kazanaki
  • 7,988
  • 8
  • 52
  • 79
JamWill
  • 134
  • 3
  • 21

2 Answers2

1

I think it's explained in the docs.

export DOCKER_REGISTRY_SERVER=r.cfcr.io
export DOCKER_USER=YOUR_USERNAME
export DOCKER_PASSWORD=YOUR_REGISTRY_PASSWORD
export DOCKER_EMAIL=YOUR_EMAIL

kubectl create secret docker-registry cfcr\
 --docker-server=$DOCKER_REGISTRY_SERVER\
 --docker-username=$DOCKER_USER\
 --docker-password=$DOCKER_PASSWORD\
 --docker-email=$DOCKER_EMAIL
Jose Armesto
  • 12,794
  • 8
  • 51
  • 56
  • OK this part-helps. I Dont directly log in to codefresh, i Oauth in using google, which means I dont have a codefresh password, so what would i put into this space? – JamWill May 29 '19 at 14:28
0

For people in the future with problems, The codefresh repository is an actual docker repository. Not knowing this was giving me the problems. So in the docker-username etc places you put your codefresh credentials, and instead of the password you put a secret that you generate within codefresh. This gives you access to the r.cfcr.io repository.

JamWill
  • 134
  • 3
  • 21