WEBVTT 0 00:05.480 --> 00:07.190 Hello and welcome to this lecture. 1 00:07.190 --> 00:09.950 My name is Mumshad Mannambeth and we are learning 2 00:10.000 --> 00:11.460 Kubernetes for beginners. 3 00:12.340 --> 00:15.300 Before we head into setting up a Kubernetes Cluster, 4 00:15.310 --> 00:18.900 It is important to understand some of the basic concepts. 5 00:19.030 --> 00:25.270 This is to make sense of the terms that we will come across while setting up a Kubernetes cluster. 6 00:25.290 --> 00:27.230 Let us start with Nodes. 7 00:27.350 --> 00:34.690 A node is a machine, physical or virtual on which Kubernetes is installed. A node is a worker machine 8 00:34.750 --> 00:39.290 and that is where containers will be launched by Kubernetes. 9 00:39.310 --> 00:46.790 It was also known as minions in the past. So you might hear these terms used interchangeably. But what 10 00:46.790 --> 00:50.290 if the node on which your application is running fails? 11 00:50.690 --> 00:53.420 Well obviously our application goes down. 12 00:53.810 --> 01:01.730 So you need to have more than one nodes. A Cluster is a set of nodes grouped together. 13 01:02.150 --> 01:08.960 This way even if one node fails you have your application still accessible from the other nodes. 14 01:09.020 --> 01:13.110 Moreover having multiple nodes helps in sharing load as well. 15 01:15.030 --> 01:19.690 Now we have a cluster. But who is responsible for managing the cluster? 16 01:19.740 --> 01:23.290 Where is the information about members of the cluster stored? 17 01:23.400 --> 01:25.650 How are the nodes monitored? 18 01:25.650 --> 01:31.550 When a node fails how do you move the workload of the field node to another worker node? 19 01:31.980 --> 01:34.360 Thats where the Master comes in. 20 01:34.500 --> 01:41.340 The Master is another node with Kubernetes installed in it and is configured as a Master. 21 01:41.580 --> 01:47.580 The master watches over the nodes in the cluster and is responsible for the actual orchestration of 22 01:47.580 --> 01:49.870 containers on the worker nodes. 23 01:52.020 --> 01:58.370 When you install Kubernetes on a system, you're actually installing the following components. An API 24 01:58.380 --> 02:08.130 server and etcd service, a kubelet service, a Container Runtime, Controllers and Schedulers. The API server 25 02:08.220 --> 02:15.660 acts as the front end for Kubernetes. The users, management devices, command line interfaces, all talk 26 02:15.660 --> 02:24.800 to the API server to interact with Kubernetes cluster. Next is the etcd key store. etcd is a distributed 27 02:24.800 --> 02:31.520 reliable key value store used by Kubernetes to store all data used to manage the cluster. 28 02:31.520 --> 02:32.720 Think of it this way. 29 02:32.930 --> 02:39.470 When you have multiple nodes and multiple Masters in your cluster, etcd stores all that information 30 02:39.560 --> 02:41.290 on all the nodes in the cluster 31 02:41.290 --> 02:48.860 in a distributed manner. etcd is responsible for implementing locks within the cluster to ensure that there 32 02:48.860 --> 02:56.250 are no conflicts between the Masters. The Scheduler is responsible for distributing work or containers 33 02:56.610 --> 02:58.390 across multiple nodes. 34 02:58.410 --> 03:03.400 It looks for newly created containers and assigns them to nodes. 35 03:03.440 --> 03:06.560 The controllers are the brain behind orchestration. 36 03:06.630 --> 03:12.960 They are responsible for noticing and responding when nodes, containers or end points goes down. 37 03:13.040 --> 03:16.370 The controllers make decisions to bring up new containers 38 03:16.370 --> 03:23.820 in such cases. The Container Runtime is the underlying software that is used to run containers. 39 03:23.870 --> 03:28.860 In our case it happens to be Docker. But there are other options as well. 40 03:29.150 --> 03:34.770 And finally Kubelet is the agent that runs on each node in the cluster. 41 03:34.850 --> 03:43.480 The agent is responsible for making sure that the containers are running on the nodes as expected. So 42 03:43.480 --> 03:43.910 far, 43 03:43.930 --> 03:51.660 we saw two types of servers. Master and Worker and a set of components that make up Kubernetes. 44 03:51.810 --> 03:56.240 But how are these components distributed across different types of servers? 45 03:56.250 --> 04:02.910 In other words, how does one server become a master and the other the slave? The worker node or minion 46 04:02.970 --> 04:06.810 as it is also known is where the containers are hosted. 47 04:06.870 --> 04:08.640 For example, Docker containers. 48 04:08.700 --> 04:15.290 And to run Docker containers on a system, we need container runtime installed and that's where the container 49 04:15.300 --> 04:16.380 runtime falls. 50 04:16.410 --> 04:18.960 In this case it happens to be Docker. 51 04:19.320 --> 04:21.360 This doesn't have to be Docker. 52 04:21.360 --> 04:27.030 There are other container runtime alternatives available such as Rocket or Cryo. 53 04:27.210 --> 04:33.230 But throughout this course, we are going to use Docker as our container runtime engine. 54 04:33.410 --> 04:38.660 The master server has the kube API server and that is what makes it a master. 55 04:38.660 --> 04:44.990 Similarly, the worker nodes have the kubelet agent that is responsible for interacting with a master 56 04:45.290 --> 04:50.930 to provide health information of the worker node and carry out actions requested by the Master on the 57 04:50.930 --> 04:52.180 worker nodes. 58 04:52.700 --> 04:57.090 All the information gathered are stored in a key value store on the master. 59 04:57.210 --> 05:03.030 The key value store is based on the popular etcd framework as we just discussed. 60 05:03.190 --> 05:07.360 The master also has the control manager and the Scheduler. 61 05:07.360 --> 05:10.580 There are other components as well. But we will stop there for now. 62 05:10.750 --> 05:17.040 The reason we went through this is to understand what components constitute the master and worker nodes. 63 05:17.050 --> 05:22.120 This will help us install and configure the right components on different systems 64 05:22.240 --> 05:29.720 when we set up our infrastructure. And finally we also need to learn a little bit about one of the command 65 05:29.720 --> 05:37.100 line utilities known as the kube command line tool or kubectl or kube control as it is also called. 66 05:37.820 --> 05:44.630 The kubectl tool is used to deploy and manage applications on a Kubernetes cluster. To get cluster 67 05:44.630 --> 05:50.840 information, to get the status of other nodes in the cluster and to manage many other things. 68 05:51.010 --> 05:56.080 The kubectl run command is used to deploy an application on the cluster. 69 05:56.590 --> 06:03.070 The kubectl cluster info command is used to view information about the cluster and the kube ctl get 70 06:03.070 --> 06:03.480 nodes 71 06:03.490 --> 06:07.180 command is used to list all the nodes part of the cluster. 72 06:07.570 --> 06:12.570 That's all we need to know for now and we will keep learning more commands throughout this course. 73 06:12.640 --> 06:17.780 We will explore more commands with kube ctl when we learn the associated concepts. 74 06:17.830 --> 06:24.730 For now, just remember the run cluster info and get nodes command and that will help us get through the first 75 06:24.730 --> 06:25.780 few laps. 76 06:26.170 --> 06:27.420 That's it for this lecture. 77 06:27.550 --> 06:29.360 I will see you in the next lecture.