kubernetes command to check how much time has passed after a pod has gone to Terminating state

7/14/2020

I have used kubectl get pods -n somenamespace but it gives the AGE and not how much time has passed after the pod has gone to terminating state.

Thanks in advance

-- DockerNaughty
kubernetes

1 Answer

7/14/2020

You have to get the pod name using the following command

$ kubectl get pods -n somenamespace | grep Terminating
some-pod-7c5d849f6b-qv48m             1/1     Terminating   0          17h

Then you can run the following command to get what you need

$ kubectl describe pod some-pod-7c5d849f6b-qv48m -n somenamespace | grep Terminating
Status:                    Terminating (lasts 3h10m)
-- codeaprendiz
Source: StackOverflow