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, 2019 in Kubernetes by ffdfd
• 5,550 points
501 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, 2019 by ajs3033
• 7,300 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
• 52,360 points
1,021 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,890 points
1,223 views
0 votes
2 answers

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

if u want to directly want to ...READ MORE

answered Jul 26, 2020 in Kubernetes by Akash Gupta
1,081 views
+1 vote
1 answer
+2 votes
1 answer
0 votes
1 answer

Re-pulling image in kubernetes

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

answered Jan 9, 2019 in Kubernetes by ajs3033
• 7,300 points
5,599 views
0 votes
2 answers

Using a local image to create a pod in K8s

I'm not sure but you can try ...READ MORE

answered Apr 29, 2019 in Kubernetes by Vishaka
19,291 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP