How via command line can I detect if a Kubernetes node is a master/control plane or not? Is there an environment variable I can check?
Asked
Active
Viewed 1,460 times
1
-
Do you mean inside the node, which is part of the cluster? – vraa Sep 01 '22 at 20:15
1 Answers
0
You can use the kubectl get nodes -o wide
command to get a more detailed list of the nodes, containing the Roles column. There you can see that control-plane, master, etcd nodes have a special label.

Root -
- 356
- 2
- 5
-
I'm looking to programmatically detect from a given node though if it's role is control panel. That will just list all nodes. – Justin Apr 20 '22 at 01:58