Skip to main content
In this lesson, we explore key aspects of the Kubernetes cluster networking configuration. We will answer several questions regarding node count, networking solutions, Weave deployment details, and pod network settings.

1. How Many Nodes are in the Cluster?

To determine the total number of nodes in the Kubernetes cluster, use the following command:
The output shows two nodes—one named “controlplane” and one named “node01”:
The command output indicates that the cluster consists of both control and worker nodes.

2. What is the Networking Solution Used by the Cluster?

The networking solution is identified by inspecting the CNI (Container Network Interface) configuration files. First, navigate to the directory containing these configuration files:
Now, view the contents of the Weave configuration file:
From the configuration, it is clear that the cluster uses Weave as its networking solution.

3. How Many Weave Agents are Deployed in the Cluster?

To find out how many Weave agents (pods) are running in the cluster, list all pods in the kube-system namespace:
The output includes two Weave pods:
There are two Weave pods deployed, indicating one Weave agent per node.

4. On Which Nodes are the Weave Pods Running?

To check on which nodes the Weave agents are running, include the -o wide option when listing pods:
The output shows:
Here, “weave-net-mknr5” is running on the “controlplane” node, and “weave-net-qgk9” is running on “node01”. This confirms that each node hosts one Weave agent.

5. What is the Name of the Bridge Network Interface Created by Weave on Each Node?

To verify the network interfaces on a node, run:
A sample output from the “controlplane” node appears as follows:
The interface named “weave” is the bridge network interface created by Weave.

6. What is the Pod IP Address Range Configured by Weave?

The assigned IP address range for pods can be observed from the network interface details of the “weave” bridge:
To further verify, check the logs of one of the Weave pods:
Within the logs, you will find an entry such as:
This confirms that the pod IP address range is set to 10.244.0.0/16.
Verifying both interface settings and pod logs can help ensure the accuracy of the IP allocation range.

7. What is the Default Gateway for Pods Deployed on Node “node01”?

To determine the default gateway for pods running on “node01,” follow these steps:

Step 1: Create a Busybox Pod Manifest

Generate a YAML configuration for a simple Busybox pod using the following command:
Next, edit the busybox.yaml file to ensure the pod is scheduled on “node01” by adding the nodeName field within the spec:

Step 2: Deploy the Busybox Pod

Apply the configuration file:
Verify that the pod is running:

Step 3: Inspect the Routing Table Inside the Pod

Once the Busybox pod is running, execute this command to view its routing table:
The output should display the default route, for example:
This shows that the default gateway for pods on node “node01” is 10.244.192.0.
Ensure that the Busybox pod is scheduled on the intended node by verifying the nodeName field in your YAML configuration.

Summary

In this lab, we verified several important network configurations: For additional information on Kubernetes networking, you can explore the Kubernetes Documentation. Happy networking!

Watch Video