How Kubernetes pod get terminated
A stage by stage transition
The pod is set to
Terminating
. And it will be isolated from end pointsKubernetes sends SIGTERM signal to all the containers in the pod. This lets them know that they are going to be terminated. SIGTERM can be handled, or ignored.
apiVersion: v1
kind: pod
metadata:
name: app-pod
spec:
containers:
- name: app-container
image: busybox
terminationGracePeriodSeconds: 60
If the containers are still running it sends SIGKILL command. Kubernetes cleanup all the objects related to the terminated pod.