myquest4 sh
myquest4 sh

Reputation: 441

How to reset restart count in kubectl get pods

How can I reset RESTART counts to zero in below Kubernetes command output. I know stats are saved in etcd, but how to reset/erase the data?

/home/mytest>kubectl get pods -A -o wide
NAMESPACE              NAME                                                       READY   STATUS      RESTARTS   AGE     IP                NODE            NOMINATED NODE   READINESS GATES
default                load-generator                                             1/1     Running     2          3d21h   192.168.252.102   testnode   <none>           <none>
kube-system            calico-kube-controllers-65f8bc95db-ph48b                   1/1     Running     7          51d     192.168.252.80    testnode   <none>           <none>
kube-system            calico-node-tr8dr                                          1/1     Running     6          51d     10.61.62.152      testnode   <none>           <none>
kube-system            coredns-66bff467f8-lcn5z                                   1/1     Running     18         51d     192.168.252.116   testnode   <none>           <none>
kube-system            coredns-66bff467f8-tmgml                                   1/1     Running     17         51d     192.168.252.123   testnode   <none>           <none>
kube-system            etcd-testnode                                              1/1     Running     23         51d     10.61.62.152      testnode   <none>           <none>
kube-system            kube-apiserver-testnode                                    1/1     Running     50         51d     10.61.62.152      testnode   <none>           <none>
kube-system            kube-controller-manager-testnode                           1/1     Running     238        51d     10.61.62.152      testnode   <none>           <none>
kube-system            kube-proxy-wn28b                                           1/1     Running     6          51d     10.61.62.152      testnode   <none>           <none>
kube-system            kube-scheduler-testnode                                    1/1     Running     233        51d     10.61.62.152      testnode   <none>           <none>
kube-system            metrics-server-585bd46ccb-55q59                            1/1     Running     1          37h     192.168.252.84    testnode   <none>           <none>
kube-system            tiller-deploy-56b574c76d-kj45f                             1/1     Running     4          45d     192.168.252.65    testnode   <none>           <none>

Upvotes: 4

Views: 8933

Answers (1)

KevinO
KevinO

Reputation: 1030

The only way to accomplish this is by restarting the pod.

Also, a feature to artificially reset the counter has been rejected.

https://github.com/kubernetes/kubernetes/issues/50375

Upvotes: 5

Related Questions