I created a new kubernetes cluster (GKE) and installed an application using helm.
I was able to locate the gke-node on which my pod was deployed using the command,
kubectl get pod -n namespace -o wide
Post that i logged on to the kubernetes-node, however on this node i am unable to view the docker images. This is the case on v1.21.4-gke.2300
In the older-version v1.19.13-gke.1200, i was able to observe the docker-images on nodes when they were pulled from repository
I can view the list of docker-images on v1.21.4-gke.2300 with the command
kubectl get pods -n geo-test -o jsonpath="{.items[*].spec.containers[*].image}" | tr -s '[[:space:]]' '\n' | sort | uniq -c
But i would like to know where in the cluster are these images getting stored and why i am not able to observe them in the node like i did in the older version
My reason for asking is, because in version v1.19.13-gke.1200, i was able to perform minor changes in the docker-image, build a custom-image and use that for installation instead of storing the images in the gcr and pulling it from there Any suggestion on how to go about it in the new
CodePudding user response:
Starting with GKE node version 1.19, the default node image for Linux nodes is the Container-Optimized OS with containerd (cos_containerd) variant instead of the Container-Optimized OS with Docker (cos) variant.
Now instead of docker
commands you can use crictl
. Refer to the crictl user guide for the complete set of supported features and usage information.
Specifically, you can run crictl images
to list the images, available on the node.
CodePudding user response:
In addition to the information already given to you, here is a set of commands using crictl. Here you can see the images command, which is to list the images in your container.
crictl [global options] command [command options] [arguments...]
COMMANDS:
attach
: Attach to a running container
create
: Create a new container
exec
: Run a command in a running container
version
: Display runtime version information
images, image, img
: List images
inspect
: Display the status of one or more containers
inspecti
: Return the status of one or more images
imagefsinfo
: Return image filesystem info
inspectp
: Display the status of one or more pods
logs
: Fetch the logs of a container
port-forward
: Forward local port to a pod
ps
: List containers
pull
: Pull an image from a registry
run
: Run a new container inside a sandbox
runp
: Run a new pod
rm
: Remove one or more containers
rmi
: Remove one or more images
rmp
: Remove one or more pods
pods
: List pods
start
: Start one or more created containers
info
: Display information of the container runtime
stop
: Stop one or more running containers
stopp
: Stop one or more running pods
update
: Update one or more running containers
config
: Get and set crictl client configuration options
stats
: List container(s) resource usage statistics
completion
: Output bash shell completion code
help, h
: Shows a list of commands or help for one command
Here is a link to the complete command list