This guide analyzes the networking configuration of a Kubernetes cluster, covering node IP range, pod IP allocation, service IP range, and kube-proxy configuration.
In this guide, we analyze the networking configuration of a Kubernetes cluster. We will review the node IP range, pod IP allocation, service IP range, and kube-proxy configuration. The sections below include command outputs and configuration excerpts to explain each concept in detail.
First, verify the IP addresses of the nodes in your cluster (note that these addresses do not pertain to pods or services). Run the following command:
Copy
Ask AI
kubectl get nodes -o wide
You might see output similar to:
Copy
Ask AI
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSIONcontrolplane Ready control-plane 52m v1.26.0 192.168.10.10 <none> Ubuntu 20.04.5 LTS 5.4.0-1104-gcnode01 Ready <none> 51m v1.26.0 192.168.10.3 <none> Ubuntu 20.04.5 LTS 5.4.0-1104-gc
In this example, the control plane has an internal IP of 192.168.10.10. To ensure which network interface uses this IP, run:
Copy
Ask AI
ip add
Locate the interface (e.g., Ethernet 0) that shows the IP 192.168.10.10. Since the IP belongs to the 192.168.10.x range, the subnet is 192.168.10.0/24.
A /24 subnet mask means the last octet is reserved for host addresses.
To understand your pod network setup, check node details with:
Copy
Ask AI
kubectl get nodes -o wide
Then, examine the network interfaces on your control plane node:
Copy
Ask AI
ip add
You may notice interfaces related to your networking solution (e.g., Weave). For example, an interface might show an IP address from the range 10.244.0.0/16, indicating the pod CIDR.To verify the pod network range, inspect the logs from one of the Weave pods:
Copy
Ask AI
kubectl logs weave-net-rbx4p -n kube-system
Scroll through the logs to find an entry such as “added entry to weave-addr” which confirms the pod allocation range as 10.244.0.0/16. This means every pod receives an IP address from the 10.244.0.0/16 subnet.
The service IP range for the cluster is defined in the API server configuration. Locate the kube-apiserver manifest file, typically found at /etc/kubernetes/manifests/kube-apiserver.yaml. Look for the flag:
Copy
Ask AI
--service-cluster-ip-range=10.96.0.0/12
Below is an excerpt from the kube-apiserver manifest:
Kube-proxy must run on every node to manage the network rules effectively. This is achieved by deploying kube-proxy as a DaemonSet. A DaemonSet automatically ensures that one instance of a pod runs on every node in the cluster.To verify this configuration, execute:
Copy
Ask AI
kubectl get daemonset -n kube-system
A sample output could be:
Copy
Ask AI
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTORkube-proxy 2 2 2 2 2 kubernetes.io/os=linuxweave-net 2 2 2 2 2 <none>
This confirms that kube-proxy is deployed as a DaemonSet, ensuring a consistent network setup across all cluster nodes.
Ensure that any changes to the DaemonSet configuration are carefully validated to prevent disruptions to cluster networking.
Derived from control plane interface configuration
Pod IP Range
10.244.0.0/16
Confirmed via Weave logs and network interface details
Service IP Range
10.96.0.0/12
Configured in the kube-apiserver manifest
Kube Proxy Mode
IPTables
Verified via kube-proxy logs
Deployment
DaemonSet
Ensures one kube-proxy pod per node
By reviewing node interfaces, Weave logs, and the API server configuration, you can confirm the cluster’s networking setup and understand the kube-proxy deployment strategy. For further details on Kubernetes networking, check out the Kubernetes Documentation.