Ubuntu 22.04
Sponsored Link

MicroK8s : Enable Registry2022/09/02

 
To enable MicroK8s built-in Registry, Configure like follows.
[1] Enable built-in Registry on primary Node.
After enabling, [kube-proxy] listens on [0.0.0.0:32000].
# enable registry with backend storage size 30G
# default size is 20G if it's not specified
# possible to specify the size on MicroK8s 1.18.3 or later

root@dlp:~#
microk8s enable registry:size=30Gi

Infer repository core for addon registry
Infer repository core for addon hostpath-storage
Enabling default storage class.
WARNING: Hostpath storage is not suitable for production environments.

deployment.apps/hostpath-provisioner created
storageclass.storage.k8s.io/microk8s-hostpath created
serviceaccount/microk8s-hostpath created
clusterrole.rbac.authorization.k8s.io/microk8s-hostpath created
clusterrolebinding.rbac.authorization.k8s.io/microk8s-hostpath created
Storage will be available soon.
Enabling the private registry
Applying registry manifest
namespace/container-registry created
persistentvolumeclaim/registry-claim created
deployment.apps/registry created
service/registry created
configmap/local-registry-hosting configured
The registry is enabled
The size of the persistent volume is 30Gi

# [registry] pod starts

root@dlp:~#
microk8s kubectl get pods -n container-registry

NAME                       READY   STATUS    RESTARTS   AGE
registry-f69889b8c-896lp   1/1     Running   0          3m49s
[2] After enabling Registry, it's possible to use it with common operation.
root@dlp:~#
podman images

REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
docker.io/library/ubuntu  latest      2dc39ba059dc  7 hours ago  80.4 MB

# tag and push

root@dlp:~#
podman tag 2dc39ba059dc localhost:32000/ubuntu:registry

root@dlp:~#
podman push localhost:32000/ubuntu:registry --tls-verify=false

Getting image source signatures
Copying blob 7f5cbd8cc787 done
Copying config 2dc39ba059 done
Writing manifest to image destination
Storing signatures

root@dlp:~#
podman images

REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
docker.io/library/ubuntu  latest      2dc39ba059dc  7 hours ago  80.4 MB
localhost:32000/ubuntu    registry    2dc39ba059dc  7 hours ago  80.4 MB
Matched Content