-In this solution video,
we will explore the network configuration
for our Kubernetes cluster.
For the first question,
we have to identify the number of nodes part
of the cluster including master and worker.
Let's run the command kubectl get nodes.
Here we can see that we have two nodes in total.
What is the network interface configured
for cluster connectivity on the master node?
This is what is used for our node-to-node communication.
For this, let's go back to the terminal and we'll run ifconfig -a,
which will show all the network interfaces used.
This will show you all the interfaces including the loopback,
the actual physical interface used by the cluster, et cetera.
There's another way to do this in Ubuntu.
Let's run cat /etc/network/interfaces file which will open up this file
and show us the physical interface used.
Here we can see that besides the loopback interface,
the other physical interface available to the system is called ens3.
Let's select that as our answer.
Before we do that, we can also run IP link
to show all the physical links on this system.
Here you can see ens3.
Let's select that as our answer.
What is the IP address assigned to the master node on this interface?
For this, we can go back to our ifconfig command.
We can run ifconfig
and instead of dash here, we can just specify the interface here.
Here we have the IP, which is 172.17.0.4.
What is the MAC address of the interface on the master node?
Again, we can make use of the exact same command.
it is available in ifconfig.
As you can see for the field called ether, there is the MAC address.
We can also use IP link command.
Type IP link and look up the hardware address assigned to ens3,
which starts with 02 and ends with 04.
Let's select that as our answer,
which is our option number one here.
What is the IP address assigned to node01?
We do the exact same process, but we'll run it on node01.
For that we'll run ssh node01, followed by ifconfig ens3.
This will fetch the output
of the command ifconfig ens3
and print it on the screen.
We are already on the master server.
This will just ssh to node01.
Run that command and it will display the result on our terminal.
Here we have the IP address of ens3 on node01,
which is 172.17.0.7.
What is the MAC address assigned to the nodes01?
Let's use the same command
and we have the MAC address in the same command as well.
It ends with 07.
Let's select that as our answer.
We use Docker as our container runtime,
what is the interface or bridge created by Docker on this host?
Let's run ifconfig -a again
and that will list all the different interfaces
including the Docker bridge, which in this case is named docker0.
What is the state of the interface docker0?
Let's run IP link.
It will not be available in the ifconfig command.
Let us run IP link for docker0.
Here, if you look up the status of docker0 interface, it is set to down.
If we were to ping Google from the master node,
which route does it take?
What is the IP address of the default gateway?
This can be found out using a single command
called IP route or IP r.
What we have to do is look up the default route,
which in this case is the very first line.
The default route goes through the default gateway
which is 172.17.0.1
for our physical interface, ens3.
We'll select that as the answer.
What is the port the kube-scheduler is listening on in the master node?
There are multiple ways we can do that,
we can look up at the configuration of our kube-scheduler,
which is a static port.
There's another way to look at the live port
which the kube-scheduler is listening on.
For that, we'll use netstat
and we'll use these additional flags,
natulp, p for process, grep for kube-scheduler.
This will print the process used by kube-scheduler along with the ports
that it's listening on.
In this, we can see that in the very bottom of the screen
of the output, the port that is used is 10251,
which is used for my kube-scheduler.
Look for the listen session
and here the port that is being used is 10251.
That's our answer.
Notice that ETCD is listening on two ports,
which of these have more client connections established?
Let's run the same command as before, which is netstat.
This time, we will search for ETCD instead
and we'll look at the different connections
on different ports used by the ETCD port.
Here we can see four different listen sessions.
If you observe closely, 2379 is used the most.
We also have 2380
and there is also another port, 2381,
which is also used by ETCD,
but the one that is used most is 2379.
That's because 2379 is the port of ETCD
to which all control plane components connect.
2380 is used for peer-to-peer connectivity.
In this case, we do not have additional master nodes,
so we don't have multiple sessions for that specific port.
That was the last question.
Thank you for joining me in this video.
I'll see you in the next one.