Get pod restart count?
See original GitHub issueI would like to get the number of times a certain pod has restarted. Is there any method in the k8 client that allows this?
When we do kubectl get pods
, there is a restart column that I am interested in.
I see there is a restartCount for individual containers within a pod, but I am more interested in the pod level restart count.
thanks
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
kubernetes pod restart count shows inconsistent values when ...
RestartCount represents the number of times the container inside a pod has been restarted, it is based on the number of dead containers...
Read more >How to alert for Pod Restart & OOMKilled in Kubernetes - Blog
We can use the pod container restart count in the last 1h and set the alert when it exceeds the threshold. 1 2,...
Read more >How could I find the Kubernetes POD restart reasons
"When I say POD restart, it is getting deleted and created freshly" - So its not being restarted, it's being recreated.
Read more >A Pod Restarts. So, What's Going on? | by Raju Dawadi
The 4th column shows the count of restart. The fifth pods has RESTARTS value of 2 means the pod was restarted twice in...
Read more >Pod Lifecycle | Kubernetes
Whilst a Pod is running, the kubelet is able to restart containers to handle ... In the Kubernetes API, Pods have both a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@deod use the dsl to get a Pod (client.pods()…), then use pod.getStatus().getContainerStatuses().get(index).getRestartCount() - where index is the appropriate container index.
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!