How do I get a list of worker nodes associated to the same master node?

7/12/2019

I am looking for a way (Kubernetes API/Command) that returns a list of worker nodes associated to the same master node. I have been digging clues on Google for days but to no avail.

I have tried to look into details of every worker node using "kubectl describe nodes" but none of the options indicate any relationship between the worker node and master node.

I expect something like a list of Worker Node A, Worker Node B and Worker Node C returns when I input the common master node.

-- JH G
kubernetes

1 Answer

7/12/2019

In scenario with more than one master, the Kubernetes make leader selection so the other masters stays inactive.

You can use endpoints to check who the master is.

-- Християн Заров
Source: StackOverflow