Skip to main content

Pregunta 17 - Localizar Container del 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

# vea cuál node recibe y entre en él
ssh cluster1-node2
# para obtener el id
crictl ps | grep tigers-reunite
b01edbe6f89ed
# haga un inspect buscando por runtimetype
crictl inspect b01edbe6f89ed | grep runtimetype
runtimeType": "io.containerd.runc.v2"

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