1

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?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Justin
  • 42,716
  • 77
  • 201
  • 296

1 Answers1

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