Good day,
Please help me understand if I mis-read this question:
Identify the pod CIDR network of the Kubernetes cluster.
This information is crucial for configuring the CNI plugin during installation.
Output the pod CIDR network to a file at /root/pod-cidr.txt.
Please see the solution provided by the tester:
Use kubectl cluster-info to find details about the cluster and
check the network range for pods.
To identify the Pod CIDR network of the Kubernetes cluster,
use the following command:
kubectl get node -o jsonpath='{.items[0].spec.podCIDR}' > /root/pod-cidr.txt
To verify:
cat /root/pod-cidr.txt
controlplane ~ âžś k get nodes
NAME STATUS ROLES AGE VERSION
controlplane Ready control-plane 38m v1.32.0
node01 Ready <none> 37m v1.32.0
controlplane ~ âžś kubectl get node -o jsonpath='{.items[0].spec.podCIDR}'
172.17.0.0/24
Please note that the tester is getting the pod cidr for the NODE. However, this is faulty (because the question is asking for the cluster, not just one node and even if it were just one node, the question didn’t specify).
Anyway, this is the information I provided in my /root/pod-cidr.txt file (and I was marked wrong) -
by the way, I don’t mind being marked wrong, I just want to know that what I understood and executed was correct:
controlplane ~ âžś k get nodes
NAME STATUS ROLES AGE VERSION
controlplane Ready control-plane 36m v1.32.0
node01 Ready <none> 35m v1.32.0
controlplane ~ âžś k get pods -n kube-system kube-contro1ler-manager-controlplane -o yaml | grep -i cluster-cidr
- --cluster-cidr=172.17.0.0/16
controlplane ~ âžś echo "172.17.0.0/16" > /root/pod-cidr.txt
controlplane ~ âžś cat /root/pod-cidr.txt
172.17.0.0/16