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 Atul
• 5,530 points
54 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,280 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
• 49,340 points
201 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
256 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,250 points
174 views
+3 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,920 points
8,774 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, 2019 in Kubernetes by ajs3033
• 7,280 points
570 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
7,237 views