This guide answers questions about your Kubernetes cluster environment and shows how to retrieve details using various commands.
In this guide, we will answer several questions regarding your Kubernetes cluster environment and illustrate how to retrieve the required details using various commands.
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:
Copy
Ask AI
ip address
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.
Copy
Ask AI
controlplane ~ ⌁ ip address1: lo: <LOOPBACK UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever2: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default link/ether 7a:88:3a:71:47:f7 brd ff:ff:ff:ff:ff:ff inet 10.244.1.1/32 scope global flannel.1 valid_lft forever preferred_lft forever3: cni0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default link/ether 4a:ba:dc:3d:2c:7b brd ff:ff:ff:ff:ff:ff inet 10.244.0.2/24 scope global cni0 valid_lft forever preferred_lft forever4: veth38a0c647: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether 4e:41:6e:6b:6d:bb brd ff:ff:ff:ff:ff:ff5: veth0f5b312d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether 5e:9b:da:c5:43:fa brd ff:ff:ff:ff:ff:ff inet 192.168.0.2/24 brd 192.168.0.255 scope global eth0 valid_lft forever preferred_lft forever6: eth0@if49800f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master cni0 state UP group default link/ether 56:1b:87:f1:9a:05 brd ff:ff:ff:ff:ff:ff inet 172.25.0.42/24 brd 172.25.0.255 scope global eth1 valid_lft forever preferred_lft forever
The interface selected for cluster connectivity is the one with the IP address matching that of the control plane node.
To retrieve node one’s MAC address, SSH into node one and execute:
Copy
Ask AI
ip address
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.
Copy
Ask AI
root@node01 ~ # ip address1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever2: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default link/ether 36:1c:bg:bf:ef:db brd ff:ff:ff:ff:ff:ff inet 10.244.0.1/32 scope global flannel.1 valid_lft forever preferred_lft forever598: eth0@if599: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:c0:05:72:06 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 192.5.114.6/24 brd 192.5.114.255 scope global eth0 valid_lft forever preferred_lft forever600: eth1@if601: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:19:00:28 brd ff:ff:ff:ff:ff:ff link-netnsid 1 inet 172.25.0.32/24 brd 172.25.0.255 scope global eth1 valid_lft forever preferred_lft forever
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:
Copy
Ask AI
ip address
In the output, the cni0 interface is visible and serves as the bridge for container connectivity.
Copy
Ask AI
controlplane ~ ⟶ ip address...3: cni0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default link/ether 2a:4d:3a:9c:2f:a2 brd ff:ff:ff:ff:ff:ff inet 10.244.0.2/24 brd 10.244.0.255 scope global cni0 valid_lft forever preferred_lft forever...
The cni0 bridge interface is essential for container networking. Ensure your CNI configuration is correct for proper connectivity.
To check the current state of the cni0 interface, run:
Copy
Ask AI
ip address show cni0
The output will display details, including the interface state. In the provided output, the state is UP.
Copy
Ask AI
controlplane ~ ➜ ip address show cni03: cni0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether ba:4d:3a:9c:1a:20 brd ff:ff:ff:ff:ff:ff inet 10.244.0.2/24 brd 10.244.0.255 scope global cni0 valid_lft forever preferred_lft forever
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:
Copy
Ask AI
ip route
The output indicates the default gateway. For example, the default route via 172.25.0.1 on interface eth1 is used for external connectivity.
Copy
Ask AI
controlplane ~ ➜ ip routedefault via 172.25.0.1 dev eth110.244.0.0/24 dev cni0 proto kernel scope link src 10.244.0.1172.25.0.0/24 via 10.244.1.0 dev flannel.1 onlink172.25.0.0/24 dev eth1 proto kernel scope link src 172.25.0.42192.5.114.0/24 dev eth0 proto kernel scope link src 192.5.114.3controlplane ~ ➜
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.