This is a BUG REPORT
Minikube version v0.20.0
Environment:
VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName):
"DriverName": "virtualbox"
ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION):
"Boot2DockerURL": "file:///Users/REDACTED/.minikube/cache/iso/minikube-v0.20.0.iso"
Install tools:
What happened:
when I create a new deployment with UI,
minikube is not able to pull image from a private repo and says:
Failed to pull image "registry.REDACTED.io/REDACTED:17.07": rpc error: code = 2 desc = unauthorized: authentication required
Error syncing pod, skipping: failed to "StartContainer" for "REDACTED" with ErrImagePull: "rpc error: code = 2 desc = unauthorized: authentication required"
things were done but did not help:
kubectl create secret docker-registry regsecret ...docker login -u REDACTED -p REDACTED registry.REDACTED.io (as root and docker user inside minikube VM)What you expected to happen:
image should be successfully pulled
How to reproduce it (as minimally and precisely as possible):
create a new deployment with UI which will use an private docker registry.
Anything else do we need to know:
when I am logged in to minikube VM by minikube ssh command,
I am able to pull images manually by docker pull command.
we can close this issue.
thing I forgot to do was:
spec:
imagePullSecrets:
- name: regsecret
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
My issue was that I had a wrong format of the secret:
It has to be:
{"auths":{"https://test.com/v2/":{"username": … … …
But I only had {"auths":{"test.com":{"username": … … …
So make sure to have the https:// and /v2/ part.
Most helpful comment
we can close this issue.
thing I forgot to do was:
spec: imagePullSecrets: - name: regsecrethttps://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/