k3s doesn't have a builtin plugin for a local registry, so this is how to install the docker registry. The registry will be exposed via the default traefik ingress (on port 80 and 443).
resolvectl query registry.localhost
returns127.0.0.1
- on most Linux distros it does. If not, enable and configuresystemd-resolved
- K3s comes with traefik by default, so this ingress is pre-configured for that.
kubectl create namespace docker-registry
kubectl apply -f docker-registry.yaml -n docker-registry
docker build -t registry.localhost/test:latest .
docker push registry.localhost/test:latest
Note: configure
http://registry.localhost
as insecure registry: https://docs.docker.com/registry/insecure/
podman build -t registry.localhost/test:latest .
podman push --tls-verify=false registry.localhost/test:latest
Note: configure
http://registry.localhost
as insecure registry: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
For setting up as insecure registry in k3s see: https://docs.k3s.io/installation/private-registry