kubernetes ComponentStatus已弃用-然后使用什么

qlvxas9a  于 2023-06-05  发布在  Kubernetes
关注(0)|答案(1)|浏览(131)

你用什么代替og kubectl get ComponentStatus?

kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
7tofc5zh

7tofc5zh1#

是的,此API已弃用,因为它提供了etcd, kube-scheduler, and kube-controller-manager组件的状态,我们可以通过kubectl或使用/livez端点获取。
所以你可以试试

kubectl get --raw='/readyz?verbose'
#local cluster
curl -k https://localhost:6443/livez?verbose

输出

[+]ping ok
[+]log ok
[+]etcd ok
[+]informer-sync ok
[+]poststarthook/start-kube-apiserver-admission-initializer ok
[+]poststarthook/generic-apiserver-start-informers ok
[+]poststarthook/priority-and-fairness-config-consumer ok
[+]poststarthook/priority-and-fairness-filter ok
[+]poststarthook/start-apiextensions-informers ok
[+]poststarthook/start-apiextensions-controllers ok
[+]poststarthook/crd-informer-synced ok
[+]poststarthook/bootstrap-controller ok
[+]poststarthook/rbac/bootstrap-roles ok
[+]poststarthook/scheduling/bootstrap-system-priority-classes ok
[+]poststarthook/priority-and-fairness-config-producer ok
[+]poststarthook/start-cluster-authentication-info-controller ok
[+]poststarthook/aggregator-reload-proxy-client-cert ok
[+]poststarthook/start-kube-aggregator-informers ok
[+]poststarthook/apiservice-registration-controller ok
[+]poststarthook/apiservice-status-available-controller ok
[+]poststarthook/kube-apiserver-autoregistration ok
[+]autoregister-completion ok
[+]poststarthook/apiservice-openapi-controller ok
[+]shutdown ok
readyz check passed

此API的当前状态存在问题,需要反转实际数据流(需要API服务器调用其客户端),并且在部署拓扑中不起作用。
它应该被清楚地标记为已弃用。
Mark componentstatus as deprecated
Kubernetes API服务器提供了3个API端点(healthz,livez和readyz)来指示API服务器的当前状态。healthz端点已弃用(自Kubernetes v1.16起),您应该使用更具体的livez和readyz端点。
using-api-health-checks

相关问题