Infrastruture pod

Author: Fabrice JAMMES (LinkedIn)

Task

Follow the steps below to investigate the relationship between Kubernetes pods and containers:

Connect to a Kind node

Answer
  • Run docker ps to find the Kind node name.
  • Use docker exec -it <kind-node-name> bash to enter the container.
docker exec -it <kind-node-name> bash

Use crictl to list pods and containers:

Answer
  • crictl ps -a lists all containers.
  • crictl pods shows running pods.
crictl ps -a
crictl pods

### Investigate the relationship between a pod and its container:

Answer
  • crictl inspect <container-id> provides container details.
  • ps auxf shows process hierarchy.
crictl inspect <container-id>
crictl inspectp <pod-id>
ps auxf

What is the role of the “pause” process?

Answer
  • The “pause” container acts as the parent container for all other containers in a pod.
  • It holds the network namespace and ensures pod lifecycle consistency.

Explore the directories /var/log and /var/lib/kubelet.

Answer
  • /var/log: Contains logs from Kubernetes components and container runtime.
  • /var/lib/kubelet/pods: Stores pod data, volume mounts, and container runtime state

Conclusion

This lab guides you through a better understanding of pod technical architecture.