Practice Test Service Networking
Solution
-
What network range are the nodes in the cluster part of?
```
kubectl get nodes -o wide
```
Note the INTERNAL-IP column to derive:
```
192.20.116.0/24
```
-
What is the range of IP addresses configured for PODs on this cluster?
```
kubectl get pods -A -o wide
```
From this list, exclude the static control plane pods like `kube-apiserver` as these run on the host network, not the pod network. From the remaining pods we can derive:
```
10.244.0.0/16
```
-
What is the IP Range configured for the services within the cluster?
```
kubectl get service -A
```
Note the CLUSTER-IP column to derive:
```
10.96.0.0/12
```
-
How many kube-proxy pods are deployed in this cluster?
```
kubectl get pod -n kube-system | grep kube-proxy
```
Count the results
-
What type of proxy is the kube-proxy configured to use?
From the output of the above question, you have two kube-proxy pods, e.g.
```
controlplane ~ kubectl get pod -n kube-system | grep kube-proxy
kube-proxy-rtr8p 1/1 Running 0 56m
kube-proxy-t7w8f 1/1 Running 0 56m
```
Pick either and check its logs. The answer is there.
```
k logs -n kube-system kube-proxy-rtr8p
```
-
How does this Kubernetes cluster ensure that a kube-proxy pod runs on all nodes in the cluster?
```
kubectl get all -n kube-system
```
From this, you can see that `kube-proxy` is a `daemonset`