mirror of
https://github.com/bregman-arie/devops-exercises.git
synced 2026-02-04 23:59:11 +00:00
717 B
717 B
"Killing" Containers - Solution
- Run Pod with a web service (e.g. httpd) -
kubectl run web --image registry.redhat.io/rhscl/httpd-24-rhel7 - Verify the web service is running with the
pscommand -kubectl exec web -- ps - Check how many restarts the pod has performed -
kubectl get po web - Kill the web service process -
kubectl exec web -- kill 1 - Check how many restarts the pod has performed -
kubectl get po web - Verify again the web service is running -
kubectl exec web -- ps
After you complete the exercise
- Why did the "RESTARTS" count raised? -
because we killed the process and Kubernetes identified the container isn't running properly so it performed restart to the Pod