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
77 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
• 51,890 points
323 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,850 points
411 views
0 votes
2 answers
+4 votes
4 answers

local docker image on minikube

I know this is an old question ...READ MORE

answered Feb 1 in Kubernetes by anonymous
13,575 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
1,594 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
13,724 views