MicroK8s : Enable Registry2021/04/07 |
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 Addon 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 metrics-server-8bbfb4bdb-h6hsr 1/1 Running 0 31m kube-system calico-kube-controllers-847c8c99d-cglw5 1/1 Running 1 154m kube-system calico-node-nlzz4 1/1 Running 0 51m kube-system coredns-86f78bb79c-nvfqr 1/1 Running 0 31m kube-system kubernetes-dashboard-7ffd448895-hp574 1/1 Running 0 31m kube-system dashboard-metrics-scraper-6c4568dc68-fzngj 1/1 Running 0 31m kube-system hostpath-provisioner-5c65fbdb4f-7kxjw 1/1 Running 0 10m container-registry registry-9b57d9df8-kfv9x 1/1 Running 0 19s |
[2] | After enabling Registry, it's possible to use it with common operation. |
[root@dlp ~]#
vi /etc/containers/registries.conf # line 48 : add your [insecure registry] [registries.insecure] registries = [ 'localhost', '127.0.0.1', 'dlp.srv.world' ]
podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.centos.org/centos latest 2f3766df23b6 3 months ago 217 MB # tag and push [root@dlp ~]# podman tag 2f3766df23b6 localhost:32000/my-centos:registry [root@dlp ~]# podman push localhost:32000/my-centos:registry Getting image source signatures ... ... Writing manifest to image destination Storing signatures[root@dlp ~]# podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.centos.org/centos latest 2f3766df23b6 3 months ago 217 MB localhost:32000/my-centos registry 2f3766df23b6 3 months ago 217 MB |
[3] | To use Registry from other Nodes, it's the same usage. |
[root@node01 ~]#
vi /etc/containers/registries.conf # line 48 : add your [insecure registry] [registries.insecure] registries = [ 'dlp.srv.world' ]
podman pull dlp.srv.world:32000/my-centos:registry Trying to pull dlp.srv.world:32000/my-centos:registry... Getting image source signatures ... ... Writing manifest to image destination Storing signatures 2f3766df23b6b238987b29a0cec50a9974f97948ea2e6569035d374289ca2da2[root@node01 ~]# podman images REPOSITORY TAG IMAGE ID CREATED SIZE dlp.srv.world:32000/my-centos registry 2f3766df23b6 3 months ago 217 MB |
Sponsored Link |
|