Rareshu
Rareshu

Reputation: 21

How to display a pods age?

I am working on two servers, each with a number of pods. The first server is Validation Env and I can use kubernetes commands, but the second server is on Prod Env I do not have full rights. It is out of the question to get full rights on the last one.

So, I am doing a platform stability statistic and I need info about the last reset of pods. I can see the "Age" but I cannot use a screenshot in my statistic, so I need a command that outputs every pods age or the last reset.

P.S. Every night at 00:00 the pods are saved and archived in a separate folder.

Upvotes: 0

Views: 1507

Answers (2)

Rareshu
Rareshu

Reputation: 21

I found a solution:

command:
zgrep "All subsystems started successfully" 201911??/*ota*

response:
23:23:37,429 [INFO ] main c.o.c.a.StartUp - All subsystems started successfully

P.S. "ota" is my pod's name.

Upvotes: 0

suren
suren

Reputation: 8786

Get pods already gives you that info:

$ kubectl get po
NAME                     READY   STATUS        RESTARTS   AGE
nginx-7cdbd8cdc9-8pnzq   1/1     Running       0          36s
$ kubectl delete po nginx-7cdbd8cdc9-8pnzq
pod "nginx-7cdbd8cdc9-8pnzq" deleted
$ kubectl get po
NAME                     READY   STATUS        RESTARTS   AGE
nginx-7cdbd8cdc9-67l8l   1/1     Running       0          4s

Upvotes: 1

Related Questions