0
votes

We have tried to setup hivemq manifest file. We have hivemq docker image in our private repository

Step1: I have logged into the private repository like

 docker login "private repo name"

It was success

After that I have tried to create manifest file for that like below

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: hivemq spec: replicas: 1 template: metadata: labels: name: hivemq1 spec: containers: - env: xxxxx some envronment values I have passed name: hivemq image: privatereponame:portnumber/directoryname/hivemq: ports: - containerPort: 1883

Its successfully creating, but I am getting the below issues. Could you please help any one to solve this issue.

hivemq-4236597916-mkxr4 0/1 ImagePullBackOff 0 1h

Logs:

Error from server (BadRequest): container "hivemq16" in pod "hivemq16-1341290525-qtkhb" is waiting to start: InvalidImageName

Some times I am getting that kind of issues

Error from server (BadRequest): container "hivemq" in pod "hivemq-4236597916-mkxr4" is waiting to start: trying and failing to pull image

2

2 Answers

0
votes

In order to use a private docker registry with Kubernetes it's not enough to docker login.
You need to add a Kubernetes docker-registry Secret with your credentials as described here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/. Also in that article is imagePullSecrets setting you have to add to your yaml deployment file, referencing that secret.

0
votes

I just fixed this on my machine, kubectl v1.9.0 failed to create the secret properly. Upgrading to v1.9.1, deleting the secret, recreating it resolved the issue for me. https://github.com/kubernetes/kubernetes/issues/57427