kubernetes 如何在kubectl get pod中重置重启计数

rqdpfwrv  于 2023-10-17  发布在  Kubernetes
关注(0)|答案(1)|浏览(147)

如何在下面的Kubernetes命令输出中将RESTART计数重置为零。我知道统计数据保存在etcd中,但如何重置/删除数据?

/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>
mwyxok5s

mwyxok5s1#

唯一的方法是重新启动pod。
此外,人工重置计数器的功能已被拒绝。
https://github.com/kubernetes/kubernetes/issues/50375

相关问题