Kuberentes: pulling image from private repo

0 votes

I have set up my clsuter using kubeadm(alpha). I am trying to pull a docker image I've hosted in nexus repo. But it gives ImagePullBackOff error whenever I try and launch a pod with this repo. Am I doing something wrong?

Here's the Pod definition :

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  labels:
    name: test
spec:
  containers:
    - image: 123.456.789.0:9595/test
      name: test
      ports:
        - containerPort: 8443
  imagePullSecrets:
    - name: my-secret
Jan 11 in Kubernetes by Atul
• 5,530 points
29 views

1 answer to this question.

0 votes

You'll have to refer to the secret that you mentioned inside the pod definition.

If your're creating a secret with kubectl create secret docker-registry my-secret --docker-server=123.456.789.0... it should match exactly to what you're putting in your pod definition including the port number and in case it is secured then it be the same as the one in docker command line in systemd.

One more thing you need to make sure is that the secret and your pod should be in the same namespace otherwise they won't be able to communicate.

answered Jan 11 by ajs3033
• 7,240 points

Related Questions In Kubernetes

0 votes
1 answer

Not able to pull image from gcr.io

There was a recent outage to gce ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 37,320 points
105 views
0 votes
1 answer

Accessing private Docker Hub repository from Kubernetes on Vagrant

In order to pull private dockerhub hosted ...READ MORE

answered Sep 18, 2018 in Kubernetes by DareDev
• 6,810 points
151 views
0 votes
1 answer

How can I access a service installed on Kubernetes from anywhere?

I have followed the link which you have ...READ MORE

answered Jul 23, 2018 in Kubernetes by Atul
• 10,240 points
99 views
+2 votes
3 answers

local docker image on minikube

Try something like this: # Start minikube minikube start # ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 6,900 points
4,226 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Re-pulling image in kubernetes

There are only two scenarios when kubernetes ...READ MORE

answered Jan 9 in Kubernetes by ajs3033
• 7,240 points
55 views
0 votes
2 answers