Error while trying to do a kubernetes deployment from a private registry

5/15/2019

I am trying to deploy a docker image from a Private repository using Kubernetes and seeing the below error

Waiting: CrashLoopBackoff
-- ravi
kubernetes

2 Answers

5/15/2019

You need to pass image pull secret to kubernetes.

  1. Get docker login json
  2. Create a k8s secret with this json
  3. Refer a secret from a pod
apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
  containers:
  - name: private-reg-container
    image: <your-private-image>
  imagePullSecrets:
  - name: k8s-secret-name

Docs: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

Usually, the bad state caused by an image pull called ImagePullBackOff, so I suggest kubectl get events to check the root cause.

-- Max Lobur
Source: StackOverflow

6/3/2019

The issue got resolved. I have deleted the Registry , re-created the Registry and tried deploying a different docker image. I could successfully deploy and also could test the deployed application.

Regards, Ravikiran.M

-- ravi
Source: StackOverflow