WEBVTT

00:00.980 --> 00:08.170
Hello and welcome to this lecture. In this lecture, we will talk about Kube Proxy. Within a kubernetes

00:08.170 --> 00:12.210
cluster every pod can reach every other pod.

00:12.220 --> 00:19.150
This is accomplished by deploying a POD networking solution to the cluster.  A  POD network is an internal

00:19.150 --> 00:25.810
virtual network that spans across all the nodes in the cluster to which all the PODs connect to. Through  this

00:25.810 --> 00:29.200
network are able to communicate with each other.

00:29.200 --> 00:32.830
There are many solutions available for deploying such a network.

00:32.830 --> 00:38.770
In this case I have a web application deployed on the first node and a database application deployed

00:38.770 --> 00:39.890
on the second.

00:40.220 --> 00:45.320
The web app can reach the database, simply by using the IP of the database POD.

00:45.340 --> 00:50.520
But there is no guarantee that the IP of the database part will always remain the same.

00:50.560 --> 00:56.140
If you've gone through the lecture on services as discussed in the beginners course you must know that

00:56.200 --> 01:02.470
a better way for the web application to access the database is using a service. So we create a service

01:02.500 --> 01:05.670
to expose the database application across the cluster.

01:06.520 --> 01:12.400
The web application can now access the database using the name of the service db.

01:12.520 --> 01:19.670
The service also gets an IP address assigned to it whenever a pod tries to reach the service using its

01:19.670 --> 01:24.340
IP or name it forwards the traffic to the back end pod.

01:24.350 --> 01:26.550
In this case the database.

01:26.550 --> 01:29.890
But what is this service and how does it get an IP?

01:29.900 --> 01:33.210
Does the service join the same POD Network?

01:33.400 --> 01:38.960
The service cannot join the pod network because the service is not an actual thing.

01:39.090 --> 01:45.570
It is not a container like pod so it doesn't have any interfaces or an actively listening process.

01:45.570 --> 01:49.850
It is a virtual component that only lives in the cabinet as memory.

01:50.430 --> 01:55.470
But then we also said that the service should be accessible across the cluster from any not.

01:55.830 --> 01:57.670
So how is that achieved?

01:57.690 --> 02:00.140
Thatâ€™s where kube-proxy comes in.

02:00.240 --> 02:06.380
Kube-proxy is a process that runs on each node in the kubernetes cluster.

02:06.390 --> 02:14.040
Its job is to look for new services and every time a new service is created it creates the appropriate

02:14.100 --> 02:20.490
rules on each node to forward traffic to those services to the backend pods.

02:20.490 --> 02:24.170
One way it does this is using IPTABLES rules.

02:24.300 --> 02:31.080
In this case it creates an IP tables rule on each node in the cluster to forward traffic heading to

02:31.080 --> 02:38.540
the IP of the service which is 10.96.0.12 to the IP of the actual pod which is

02:38.550 --> 02:44.220
10.32.0.15. So how kube-proxy configure the service

02:44.220 --> 02:50.180
We discuss a lot more about networking and services kube-proxy and POD networking.

02:50.220 --> 02:55.930
Later in this course again we have a large section just for networking.

02:56.010 --> 02:59.000
This is a high level overview for now.

02:59.280 --> 03:02.400
We will now see how to install kube-proxy.

03:02.400 --> 03:09.140
Download the kube-proxy binary from the kubernetes release page. Extract it and run it as a service. The

03:09.140 --> 03:12.980
kubeadm tool deploys kube-proxy as PODs on each node.

03:12.980 --> 03:20.210
In fact it is deployed as a daemon set, so a single POD is always deployed on each node in the cluster.

03:20.210 --> 03:25.010
Well if you don't know about daemon set yet don't worry we have a lecture on that coming up in this

03:25.010 --> 03:26.460
course.

03:26.510 --> 03:31.640
We have now covered a high-level overview of the various components in the kubernetes control plane.

03:31.640 --> 03:37.580
As mentioned we will look at some of these in much more detail at various sections in this course.

03:37.580 --> 03:39.210
Well that's it for this lecture.

03:39.620 --> 03:41.300
I will see you in the next section.

