gpt4 book ai didi

kubernetes - ComponentStatus 已弃用 - 那么该使用什么

转载 作者:行者123 更新时间:2023-12-05 03:19:39 27 4
gpt4 key购买 nike

您使用什么代替 og kubectl get ComponentStatus?

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

最佳答案

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

所以你可以试试

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

The current state of this API is problematic, and requires reversing the actual data flow (it requires the API server to call to its clients), and is not functional across deployment topologies.

It should be clearly marked as deprecated.

Mark componentstatus as deprecated

The Kubernetes API server provides 3 API endpoints (healthz, livez and readyz) to indicate the current status of the API server. The healthz endpoint is deprecated (since Kubernetes v1.16), and you should use the more specific livez and readyz endpoints instead.

using-api-health-checks

关于kubernetes - ComponentStatus 已弃用 - 那么该使用什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73407661/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com