Reputation: 1430
I have a local insecure docker registry which I created using the command:
docker run -d -p 5000:5000 --restart=always --name registry registry:2`
I have added this to the /etc/docker/daemon.json
as well. I tagged several images in the format localhost:5000/<orgname>/<imagename>:<tag>
and pushed them to the insecure registry.
When I run curl -X GET localhost:5000/v2/_catalog
I can see that they are available inside the local registry.
I started minikube with the command minikube start --insecure-registry="localhost:5000"
. Here, my default driver is docker (I also tried with kvm2). I enabled the registry addon as well using the command minikube addons enable registry
I have a configmap which states the image in the format I mentioned earlier. When I apply this using kubectl
, I get an ImagePullBackoff
error with the error message
Failed to pull image "localhost:5000/org/product:tag": rpc error: code = Unknown desc = Error response from daemon: manifest for localhost:5000/org/product:tag not found: manifest unknown: manifest unknown
Any ideas as to why this is happening?
Docker version: 19.03.8, build afacb8b7f0
Minikube version: 1.9.2
Ubuntu 20.04 LTS
Upvotes: 5
Views: 3603
Reputation: 51
One thing noticed here, before you start the minikube with the insecure arguments, Make sure to delete the cluster, Otherwise the changes won't effect
minikube delete
minikube start --insecure-registry="<IP-of-your-computer>:5000"
After that you could see the insecure registries been added on the minikube docker daemon
minikube ssh
docker info
Scroll to the end of the details.
Upvotes: 1
Reputation: 700
I used following on Ubuntu 20.04
minikube start --insecure-registry="<your-computer-ip>:5000"
minikube addons enable registry
kubectl get service --namespace kube-system
> NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE > kube-dns ClusterIP 10.96.0.10 none 53/UDP,53/TCP,9153/TCP 54m > registry ClusterIP 10.98.34.133 none 80/TCP,443/TCP 37m
kubectl port-forward --namespace kube-system service/registry 5000:80
docker tag my/image localhost:5000/myimage
docker push localhost:5000/myimage
containers: - name: app-name image: localhost:5000/image-name:latest
Upvotes: 1
Reputation: 1430
I was able to solve this issue by replacing localhost with my IP.
minikube start --insecure-registry="<IP-of-your-computer>:5000"
Have to use the IP instead of localhost when tagging and pushing images to te local registry as well.
Upvotes: 1
Reputation: 61689
Well, the minikube K8s subnet is different from the one that your registry is running so localhost
is not going to work without some tweaks. I recommend following the minikube official guide and not run:
docker run -d -p 5000:5000 --restart=always --name registry registry:2`
In essence, it says that after running:
minikube addons enable registry
Then when you create your minikube instance
minikube start --drive=docker --insecure-registry "10.0.0.0/24"
Upvotes: 2