Configuring MicroK8s to use private/public registries
MicroK8s can pull the images from private or public registries as well, but before being able to pull container images, MicroK8s Kubernetes must be made aware of the registry endpoints.
Let's assume that a private registry is set up at some IP address, such as 10.131.231.155
. The images we build need to be tagged with the IP address:Port/image:tag
registry endpoint syntax, as follows:
docker build . -t 10.131.231.155:32000/nginx1.21:registry
Important Note
Pushing to this insecure registry may fail in some Docker versions unless the daemon is specifically set to trust it. Add the registry endpoint (as shown in the following snippet) to /etc/docker/daemon.json
and restart the Docker daemon:
{
"insecure-registries" : ["10.131.231.155:32000"]
}
To push it to one of the public registries such as hub.docker.com
, use the docker login
command to log in and push the image tagged with docker...