eec9bbcd08
* Update killing_containers.md rectify the spelling of properly * Update topics/kubernetes/solutions/killing_containers.md correct the grammatical errors to make the sentence meaningful Co-authored-by: andrzejsydor <andrzejsydor@users.noreply.github.com> * Update topics/kubernetes/solutions/killing_containers.md commiting the suggested changes Co-authored-by: andrzejsydor <andrzejsydor@users.noreply.github.com> --------- Co-authored-by: andrzejsydor <andrzejsydor@users.noreply.github.com> Co-authored-by: Arie Bregman <bregman.arie@gmail.com>
692 B
692 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
ps
command -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? -
Kubernetes restarted the Pod because we killed the process and the container was not running properly.