0

I have created 3 node k8s cluster as show below with containerd as runtime using kubespray Note: No docker binary is running on nodes.

get no -o wide
NAME     STATUS   ROLES                  AGE     VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                               KERNEL-VERSION                 CONTAINER-RUNTIME
node11   Ready    control-plane,worker   2d17h   v1.26.3   a.b.c.x   <none>        Red Hat Enterprise Linux 8.6 (Ootpa)   4.18.0-372.26.1.el8_6.x86_64   containerd://1.7.0
node12   Ready    control-plane,worker   2d17h   v1.26.3   a.b.c.y    <none>        Red Hat Enterprise Linux 8.6 (Ootpa)   4.18.0-372.26.1.el8_6.x86_64   containerd://1.7.0
node13   Ready    control-plane,worker   2d17h   v1.26.3   a.b.c.z    <none>        Red Hat Enterprise Linux 8.6 (Ootpa)   4.18.0-372.26.1.el8_6.x86_64   containerd://1.7.0

As per documentation, provide flag registry_enabled: true and I can see registry pod as below'

kubectl get po -n kube-system -o wide | grep registry
registry-l5ndk                             1/1     Running   0               3h18m   10.233.88.135   node12   <none>           <none>

Can anyone guide how i can push images to this registry?

I am expecting that i should be able to push my application images using nerdctl push command

Jonas
  • 121,568
  • 97
  • 310
  • 388
KHEMRAJD
  • 41
  • 4

1 Answers1

1
  1. Check the port for registry service

    export NODEPORT=$(kubectl get svc -n kube-system registry -o jsonpath='{.spec.ports[0].nodePort}');

    echo ${NODEPORT}

    export REGNODE=node1 # prefer controller

then

  1. tag image:

    nerdctl tag nginx:1.23.2-alpine ${REGNODE}:${NODEPORT}//nginx:1.23.2-alpine

  2. push image to registry:

    nerdctl push ${REGNODE}:${NODEPORT}/nginx:1.23.2-alpine

  3. pull image from registry:

    nerdctl pull ${REGNODE}:${NODEPORT}/nginx:1.23.2-alpine

KHEMRAJD
  • 41
  • 4