Score:1

kubernetes: how to check pod IP range allocated to node

co flag

Every node in a kubernetes cluster has a dedicated range of IP addresses that it can allocate to the pods. How can one check what that IP range is?

Score:1
kp flag

You can do something like this

[root@kmaster ~]# k get nodes
NAME                 STATUS   ROLES           AGE   VERSION
kmaster.mylab.edu    Ready    control-plane   26h   v1.25.4
kworker0.mylab.edu   Ready    <none>          25h   v1.25.4
kworker1.mylab.edu   Ready    <none>          25h   v1.25.4
[root@kmaster ~]# k describe node | egrep -w  "PodCIDR:|Name:"
Name:               kmaster.mylab.edu
PodCIDR:                      10.244.0.0/24
Name:               kworker0.mylab.edu
PodCIDR:                      10.244.1.0/24
Name:               kworker1.mylab.edu
PodCIDR:                      10.244.3.0/24
[root@kmaster ~]#
Score:0
co flag

One of the ways is to check etcd.

oc rsh -n openshift-etcd etcd-master02

To check pod range allocated to a particular node:

etcdctl get /kubernetes.io/network.openshift.io/hostsubnets/master01

In the output you will see a subnet, e.g. "10.8.2.0/23" `

To list allocations for all cluster nodes:

etcdctl get --prefix /kubernetes.io/network.openshift.io/hostsubnets/

asmath avatar
cn flag
you can check the pod allocated ip range in kube-api manifest file if you are running local kubernetes cluster.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.