Reputation: 5433
I know that i can use kubectl get componentstatus
command to check the health status of the k8 cluster but some how the output i am receiving do not show the health. Below is the output from master server.
I can do deployments, can create pods and services which means everything is working fine but not sure how to check the health status.
Upvotes: 1
Views: 3754
Reputation: 3086
Solved in kube-apiserver v1.17.0, also you should use command below in your older apiserver.
kubectl get cs -o=go-template='{{printf "NAME\t\t\tHEALTH_STATUS\tMESSAGE\t\n"}}{{range .items}}{{$name := .metadata.name}}{{range .conditions}}{{printf "%-24s%-16s%-20s\n" $name .status .message}}{{end}}{{end}}'
enjoy
Upvotes: 1
Reputation: 3328
can you try with this command
kubectl get componentstatus -o jsonpath="{.items[*].conditions[*].status}"
I know both commands are same but outputting it as yaml worked for me
Upvotes: 1