Skip to main content
In this guide, we will answer several questions regarding your Kubernetes cluster environment and illustrate how to retrieve the required details using various commands.

1. How Many Nodes Are in the Cluster?

To find out how many nodes are part of your cluster, run:
The command outputs a list of nodes. In this example, there are two nodes—one functioning as the control plane and another as a worker node.

2. What Is the Internal IP Address of the Control Plane Node?

Use the -o wide option with kubectl get nodes to view additional details, including the internal IP address:
Locate the control plane node entry. In this sample output, the internal IP for the control plane is 192.5.114.3.

3. Which Network Interface Is Configured for Cluster Connectivity on the Control Plane Node?

To determine which network interface is used for cluster connectivity, run:
Review the output and look for the interface that shows the relevant IP address (in this case, an IP ending in .3). In the sample provided, the eth0 interface has the correct binding.
The interface selected for cluster connectivity is the one with the IP address matching that of the control plane node.

4. What Is the MAC Address of the Control Plane Node’s Network Interface?

Once you know the interface name (in this example, eth0), you can use the following command to display its MAC address:
The MAC address appears in the output; for instance, you might see a value like 5e:9b:da:c5:43:fa. Use this value as needed.

5. What Is the IP Address Assigned to Node One?

To discover the internal IP address of the worker node (node one), run:
Examine the entry corresponding to node01. In the sample output below, the worker node’s internal IP address is 192.5.114.6.

6. What Is the MAC Address Assigned to Node One?

To retrieve node one’s MAC address, SSH into node one and execute:
Scroll through the output until you find the interface associated with the internal IP (e.g., matching 192.5.114.6). The corresponding MAC address—in this case, 02:42:c0:05:72:06—is the answer.

7. What Is the Container Runtime’s Bridge Interface on the Host?

ContainerD commonly uses a CNI plugin to manage networking, which creates a bridge interface. Typically, this interface is named cni0. Confirm by listing all network interfaces:
In the output, the cni0 interface is visible and serves as the bridge for container connectivity.
The cni0 bridge interface is essential for container networking. Ensure your CNI configuration is correct for proper connectivity.

8. What Is the State of Interface cni0?

To check the current state of the cni0 interface, run:
The output will display details, including the interface state. In the provided output, the state is UP.

9. What Is the Default Gateway Used When Pinging Google from the Control Plane Node?

To identify the route taken for external traffic, inspect the default routing table using:
The output indicates the default gateway. For example, the default route via 172.25.0.1 on interface eth1 is used for external connectivity.
Thus, the default gateway is 172.25.0.1.

10. On Which Port Is the Kube Scheduler Listening?

To determine the port on which the Kube Scheduler is active, use the netstat command with filtering options:
The output shows that the scheduler is listening on port 10259 on localhost.

11. Which ETCD Port Sees More Client Connections?

ETCD typically listens on multiple ports, such as 2379 (client communication) and 2380 (peer communication). To inspect ETCD-related sockets, run:
A sample output could be:
To count established connections for each port, use the following commands:
Typically, port 2379 will show significantly more client connections compared to port 2380, which is reserved for peer-to-peer communication among ETCD members.

This concludes the lab. Each step illustrated above demonstrates how to gather network and runtime configuration details within your Kubernetes cluster environment. For further reading on Kubernetes networking and node configuration, please visit the Kubernetes Documentation.

Watch Video