containerd -- how export & import images

209 views Asked by At

Appreciated in advance ...

i'm running k8s 3 nodes cluster 1m 2w v= v1.28.2

since i used kubeadm to bootstrap my cluster and based on k8s.io documents i did use containerd "containerd://1.6.27"

Now - from workernode1 if i do "sudo ctr -n=k8s.io images ls" i'll get all pulled images, Moreover i can find their "sha256" at "/var/lib/containerd/io.containerd.content.v1.content/blobs/sha256"

-- i did list images in workernode1 sudo ctr -n=k8s.io images ls | grep nginx

-- i did export NGINX from workernood1 sudo ctr -n k8s.io images export workernode1:#/home/username/nginx02.tar docker.io/library/nginx:latest

-- SCP the nginx02.tar from workernode1 to workernode2

-- But when import this nginx.tar in workernode2 i've got sudo ctr -n k8s.io images import workernode2:#/home/username/nginx02.tar

Firstly it says ctr: content digest sha256:b468323496c197d35eba41fcfdb23993b661d808d78b84260b3960f09f5b9c3b: not found Why ?????????????

Finlay it did import the image -- but can't get it listed when running sudo ctr -n=k8s.io images ls | grep nginx

My questions are:

  1. what is the best CLI to deal with those images (CTR, CRICTL, Nerdctl, skopeo, ..etc) for General purposes such as "export, import, copy, remove, delete, pull, ... etc"
  2. lets say i found following sha256 "4c0fdaa8b6341bfdeca5f18f7837462c80cff90527ee35ef185571e1c327beac "for newly pulled NGINX image at my workernode1 in the following path "/var/lib/containerd/io.containerd.content.v1.content/blobs/sha256/" --- Can i simply SCP this sha256 for NGINX to the same directory in my second worker "workernode2" -- so when k8s for some reason runs nginx on workernode2 it will find the image presented, and no need to pull it from the internet.

ChatGPT, Google searches, Some similar cases in Stackoverflow, .. and more

-- as for my expectations:

  1. an advise from an expert on how to deal with pulled images
  2. is it good to build my own private registry
0

There are 0 answers