What do you use instead og kubectl get ComponentStatus?
kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19
CodePudding user response:
Yes, this API is deprecated and as it provided status of etcd, kube-scheduler, and kube-controller-manager
components, which we can get through kubectl or using lives
endpoint.
so you can try
kubectl get --raw='/readyz?verbose'
#local cluster
curl -k https://localhost:6443/livez?verbose
output
[ ]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.