1
00:00:00,980 --> 00:00:08,170
Hello and welcome to this lecture. In this lecture, we will talk about Kube Proxy. Within a kubernetes

2
00:00:08,170 --> 00:00:12,210
cluster every pod can reach every other pod.

3
00:00:12,220 --> 00:00:19,150
This is accomplished by deploying a POD networking solution to the cluster.  A  POD network is an internal

4
00:00:19,150 --> 00:00:25,810
virtual network that spans across all the nodes in the cluster to which all the PODs connect to. Through  this

5
00:00:25,810 --> 00:00:29,200
network are able to communicate with each other.

6
00:00:29,200 --> 00:00:32,830
There are many solutions available for deploying such a network.

7
00:00:32,830 --> 00:00:38,770
In this case I have a web application deployed on the first node and a database application deployed

8
00:00:38,770 --> 00:00:39,890
on the second.

9
00:00:40,220 --> 00:00:45,320
The web app can reach the database, simply by using the IP of the database POD.

10
00:00:45,340 --> 00:00:50,520
But there is no guarantee that the IP of the database part will always remain the same.

11
00:00:50,560 --> 00:00:56,140
If you've gone through the lecture on services as discussed in the beginners course you must know that

12
00:00:56,200 --> 00:01:02,470
a better way for the web application to access the database is using a service. So we create a service

13
00:01:02,500 --> 00:01:05,670
to expose the database application across the cluster.

14
00:01:06,520 --> 00:01:12,400
The web application can now access the database using the name of the service db.

15
00:01:12,520 --> 00:01:19,670
The service also gets an IP address assigned to it whenever a pod tries to reach the service using its

16
00:01:19,670 --> 00:01:24,340
IP or name it forwards the traffic to the back end pod.

17
00:01:24,350 --> 00:01:26,550
In this case the database.

18
00:01:26,550 --> 00:01:29,890
But what is this service and how does it get an IP?

19
00:01:29,900 --> 00:01:33,210
Does the service join the same POD Network?

20
00:01:33,400 --> 00:01:38,960
The service cannot join the pod network because the service is not an actual thing.

21
00:01:39,090 --> 00:01:45,570
It is not a container like pod so it doesn't have any interfaces or an actively listening process.

22
00:01:45,570 --> 00:01:49,850
It is a virtual component that only lives in the cabinet as memory.

23
00:01:50,430 --> 00:01:55,470
But then we also said that the service should be accessible across the cluster from any not.

24
00:01:55,830 --> 00:01:57,670
So how is that achieved?

25
00:01:57,690 --> 00:02:00,140
That’s where kube-proxy comes in.

26
00:02:00,240 --> 00:02:06,380
Kube-proxy is a process that runs on each node in the kubernetes cluster.

27
00:02:06,390 --> 00:02:14,040
Its job is to look for new services and every time a new service is created it creates the appropriate

28
00:02:14,100 --> 00:02:20,490
rules on each node to forward traffic to those services to the backend pods.

29
00:02:20,490 --> 00:02:24,170
One way it does this is using IPTABLES rules.

30
00:02:24,300 --> 00:02:31,080
In this case it creates an IP tables rule on each node in the cluster to forward traffic heading to

31
00:02:31,080 --> 00:02:38,540
the IP of the service which is 10.96.0.12 to the IP of the actual pod which is

32
00:02:38,550 --> 00:02:44,220
10.32.0.15. So how kube-proxy configure the service

33
00:02:44,220 --> 00:02:50,180
We discuss a lot more about networking and services kube-proxy and POD networking.

34
00:02:50,220 --> 00:02:55,930
Later in this course again we have a large section just for networking.

35
00:02:56,010 --> 00:02:59,000
This is a high level overview for now.

36
00:02:59,280 --> 00:03:02,400
We will now see how to install kube-proxy.

37
00:03:02,400 --> 00:03:09,140
Download the kube-proxy binary from the kubernetes release page. Extract it and run it as a service. The

38
00:03:09,140 --> 00:03:12,980
kubeadm tool deploys kube-proxy as PODs on each node.

39
00:03:12,980 --> 00: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.

40
00:03:20,210 --> 00: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

41
00:03:25,010 --> 00:03:26,460
course.

42
00:03:26,510 --> 00:03:31,640
We have now covered a high-level overview of the various components in the kubernetes control plane.

43
00:03:31,640 --> 00:03:37,580
As mentioned we will look at some of these in much more detail at various sections in this course.

44
00:03:37,580 --> 00:03:39,210
Well that's it for this lecture.

45
00:03:39,620 --> 00:03:41,300
I will see you in the next section.
