WEBVTT

00:00.520 --> 00:04.480
-This is the solution video
for the Service Networking lab.

00:05.400 --> 00:09.220
In the first question, we have to identify
the network range of the nodes,

00:09.440 --> 00:10.990
which are part of this cluster.

00:12.000 --> 00:17.310
In the Terminal,
let's run kubectl get nodes -o wide.

00:18.320 --> 00:21.780
This will give us the IP address
of both the nodes.

00:21.950 --> 00:24.630
We have two nodes master and node01.

00:25.330 --> 00:30.900
The internal IP address starts
with 172.17.0.24 and 27.

00:31.370 --> 00:35.470
Let us look at the CIDR range
for this network,

00:35.640 --> 00:39.020
which makes use of ens3
as we saw in one of the labs earlier,

00:39.580 --> 00:41.300
for a node to node communication.

00:41.710 --> 00:44.540
Here we can see that it's using /16.

00:45.530 --> 00:48.870
It begins with 172.17.0.

00:49.590 --> 00:54.880
Most appropriate answer here
is 172.17.0.0,

00:55.040 --> 00:56.390
which is the exact network,

00:56.920 --> 00:58.920
and /16 is the CIDR.

01:00.300 --> 01:04.690
What is the range of IP address configured
for PODs on this cluster?

01:05.440 --> 01:09.470
This is specifically for the pods,
not the nodes itself.

01:14.570 --> 01:18.100
To check this,
we can see the configuration

01:18.270 --> 01:19.990
of the weave plugin pod.

01:24.460 --> 01:28.040
I'm going to run kubectl logs

01:33.060 --> 01:34.750
for the weave-net pod

01:35.240 --> 01:37.770
and inside we have a container
called weave.

01:38.620 --> 01:40.680
If we open up the logs for this,

01:40.850 --> 01:45.490
we should see the IP allocation range
somewhere here.

01:45.660 --> 01:48.760
If you scroll to the very top,
you see that ipalloc range

01:49.820 --> 01:56.810
is set to 10.32.0.0/12.

01:58.220 --> 01:59.260
That's one way of doing it.

01:59.420 --> 02:02.460
We can also look up
at the configuration for weave,

02:02.930 --> 02:05.450
but in this case,
this is the most appropriate answer.

02:05.620 --> 02:06.620
We'll go with that.

02:07.130 --> 02:10.650
What is the IP range configured
for the services within the cluster?

02:10.820 --> 02:12.550
In this case, we are looking at services.

02:12.710 --> 02:14.840
We have already checked node and pods.

02:15.730 --> 02:17.740
Let's look at services for this.

02:17.910 --> 02:22.230
Another easy way to do it is
to check the address range,

02:22.400 --> 02:24.630
which is configured in the kube-apiserver.

02:24.790 --> 02:27.060
I'm going to open up
the static pod definition file

02:27.230 --> 02:30.790
for kube-apiserver using vi editor.

02:31.320 --> 02:33.310
If we scroll all the way to the bottom,

02:33.470 --> 02:35.240
in the command section

02:35.910 --> 02:37.960
we should see the service address range.

02:38.680 --> 02:44.410
Here the service cluster IP range
is 10.96.0.0/12.

02:46.000 --> 02:47.000
Let's select that.

02:50.170 --> 02:52.810
How many kube-proxy pods are deployed
in this cluster?

02:52.970 --> 02:56.610
Kube-proxy is typically run
as a DaemonSet as well.

03:06.280 --> 03:08.890
We can see that we have two pods running.

03:11.440 --> 03:15.060
What type of proxy
is kube-proxy configured to use?

03:15.800 --> 03:19.150
We know that by default it makes use
of Iptables chains,

03:19.670 --> 03:21.600
but we can validate that.

03:25.310 --> 03:29.660
Again, let's look at the logs
of kube-proxy.

03:29.820 --> 03:31.400
Let's select one of the pods here.

03:31.560 --> 03:37.530
We'll make use
of the command kubectl -n kube-system logs

03:37.810 --> 03:39.830
and the kube-proxy pod.

03:42.920 --> 03:46.680
If you see the first line,
it is assuming Iptables proxy.

03:46.850 --> 03:48.010
That's our answer.

03:52.500 --> 03:53.940
For the last question,

03:54.100 --> 03:55.590
we have to answer this,

03:55.760 --> 03:57.880
how does this Kubernetes cluster ensure

03:58.050 --> 04:01.230
that a kube-proxy pod runs
on all nodes in the cluster?

04:01.400 --> 04:05.480
We already discussed
that kube-proxy runs as a DaemonSet,

04:06.210 --> 04:09.680
but we can validate that on the Terminal
by running kubectl,

04:09.850 --> 04:13.350
get DaemonSets
in the cube system namespace.

04:18.240 --> 04:20.710
Here we can see
that kube-proxy is in the list

04:20.880 --> 04:25.010
and it requires two desired pods out
of which two are current

04:25.170 --> 04:26.210
and two are ready.

04:27.570 --> 04:30.840
The answer is using a DaemonSet.

04:31.560 --> 04:32.710
That was the last question.

04:32.880 --> 04:34.990
Thank you for joining me in this video.

04:35.160 --> 04:36.610
I'll see you in the next one.

