Unable to pull images from private registry
See original GitHub issueI have installed microk8s on Ubuntu 18.04.3 server that is behind the firewall and access to internet is limited. Thus I downloaded snap from another computer
snap download microk8s
and then installed it on that server (with root privileges) and imported sandbox_image (k8s.gcr.io/pause:3.1) that was needed and couldn’t be downloaded because of firewall
snap ack microk8s_989.assert
snap install microk8s_989.snap --classic
microk8s.ctr -n k8s.io image import pause3.1
Then, I have updated file /var/snap/microk8s/current/args/containerd-template.toml according to the tutorial at https://microk8s.io/docs/working#working-with-a-private-registry
[plugins.cri.registry.configs."registry01*".auth]
username = "name"
password = "pwd"
[plugins.cri.registry]
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."docker.io"]
endpoint = ["http://registry01:80"]
[plugins.cri.registry.mirrors."local.insecure-registry.io"]
endpoint = ["http://registry01:80"]
[plugins.cri.registry.mirrors."registry01:80"]
endpoint = ["http://registry01:80"]
Howewer, It seems like it is ignored. When I run command
microk8s.kubectl run name --image=registry01:80/image:tag
microk8s.kubectl describe pod [podname]
the output from describe is as follows
Failed to pull image "registry01:80/image:tag": rpc error: code = Unknown desc = failed to resolve image "registry01:80/image:tag": no available registry endpoint: failed to do request: Head https://registry01:80/v2/image/manifests/tag: http: server gave HTTP response to HTTPS client
Regardless the endpoint property of [plugins.cri.registry.mirrors.“registry01:80”]. When I change it to something else, the result is the same.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Unable to pull images on private container registry. #15993
When I try to pull an image on a private container registry with a worker node, I get the following error message and...
Read more >Docker: Unable to pull image from remote private registry
I have a private registry running on 172.20.20.1 . From another machine, I can use the HTTP API to retrieve registry info, for...
Read more >Pull an Image from a Private Registry - Kubernetes
This page shows how to create a Pod that uses a Secret to pull an image from a private container image registry or...
Read more >Kubernetes Error Codes: Failed to Pull Image | Datree.io
Successfully pulling an image and starting a new pod of containers ... Failed to pull image "registry.example.com/private-image:latest": rpc ...
Read more >Kubernetes ImagePullBackOff: Troubleshooting With Examples
The ImagePull part of the ImagePullBackOff error primarily relates to your Kubernetes container runtime being unable to pull the image from a private...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My scenario:
What worked for me was adding both the IP and DNS values to the containerd template.
Here’s the relevant section in my /var/snap/microk8s/current/args/containerd-template.toml:
Once I did that, I rebooted the VM for good measure, but I bet this would work as well:
systemctl restart snap.microk8s.daemon-containerd.service && microk8s.stop && microk8s.start
Here’s my /etc/docker/daemon.json for posterity:
Once I did this, the image pull errors went away.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.