Pular para o conteúdo principal

Questão 17 - Localizar Container do Pod

Question 17 | Find Container of Pod and check info

Use context: kubectl config use-context k8s-c1-H

In Namespace project-tiger create a Pod named tigers-reunite of image httpd:2.4.41-alpine with labels pod=container and container=pod. Find out on which node the Pod is scheduled. Ssh into that node and find the containerd container belonging to that Pod.

Using command crictl: Write the ID of the container and the info.runtimeType into /opt/course/17/pod-container.txt Write the logs of the container into /opt/course/17/pod-container.log


k run tigers-reunite  -n project-tiger --image=httpd:2.4.41-alpine --labels "pod=container,container=pod"
kubectl get pods -n project-tiger -o wide

# veja qual node recebe e entre nele
ssh cluster1-node2
# para pegar o id
crictl ps | grep tigers-reunite
b01edbe6f89ed
# faça um inspect procurando por runtimetype
crictl inspect b01edbe6f89ed | grep runtimetype
runtimeType": "io.containerd.runc.v2"

echo "b01edbe6f89ed io.containerd.runc.v2" > /opt/course/17/pod-container.txt