CentOS Stream 9
Sponsored Link

MicroK8s : Enable Registry2022/07/28

 
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
Addon core/hostpath-storage is already enabled
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 -A

NAMESPACE            NAME                                         READY   STATUS    RESTARTS      AGE
kube-system          dashboard-metrics-scraper-6b6f796c8d-6424f   1/1     Running   2 (11m ago)   42m
kube-system          metrics-server-5f8f64cb86-fc7t9              0/1     Running   2 (11m ago)   44m
kube-system          kubernetes-dashboard-765646474b-nbql2        1/1     Running   2 (11m ago)   42m
kube-system          calico-kube-controllers-7697884475-sxlvf     1/1     Running   3 (11m ago)   3h6m
kube-system          calico-node-hkwhp                            1/1     Running   3 (11m ago)   3h6m
kube-system          coredns-66bcf65bb8-t2nw6                     1/1     Running   2 (11m ago)   42m
kube-system          hostpath-provisioner-f57964d5f-zx2j7         1/1     Running   0             10m
container-registry   registry-f69889b8c-m6chl                     1/1     Running   0             6m31s
[2] After enabling Registry, it's possible to use it with common operation.
[root@dlp ~]#
podman images

REPOSITORY             TAG         IMAGE ID      CREATED      SIZE
quay.io/centos/centos  stream9     61674c24ebbf  7 hours ago  156 MB

# tag and push

[root@dlp ~]#
podman tag 61674c24ebbf localhost:32000/my-centos:stream9

[root@dlp ~]#
podman push localhost:32000/my-centos:stream9 --tls-verify=false

Getting image source signatures
...
...
Writing manifest to image destination
Storing signatures

[root@dlp ~]#
podman images

REPOSITORY                 TAG         IMAGE ID      CREATED      SIZE
quay.io/centos/centos      stream9     61674c24ebbf  7 hours ago  156 MB
localhost:32000/my-centos  stream9     61674c24ebbf  7 hours ago  156 MB
[3] To use Registry from other Nodes, it's the same usage.
[root@node01 ~]#
podman pull dlp.srv.world:32000/my-centos:stream9 --tls-verify=false

Trying to pull dlp.srv.world:32000/my-centos:stream9...
Getting image source signatures
...
...
Writing manifest to image destination
Storing signatures
61674c24ebbf392deb2cb463bfc2906373ec6dae05406d500a9a5da69d26a1f4

[root@node01 ~]#
podman images

REPOSITORY                     TAG         IMAGE ID      CREATED      SIZE
dlp.srv.world:32000/my-centos  stream9     61674c24ebbf  8 hours ago  156 MB
Matched Content