1 00:00:00,001 --> 00:00:05,901 [No Audio] 2 00:00:05,901 --> 00:00:09,967 Open your favorite web browser and go to this link, 3 00:00:10,001 --> 00:00:15,301 console.cloud.google.com. This is the link for 4 00:00:15,301 --> 00:00:20,334 Google Cloud Platform Dashboard, or GCP Dashboard. 5 00:00:20,734 --> 00:00:24,534 But before we can go there, we need to sign in to 6 00:00:24,534 --> 00:00:28,601 our Google account, enter your ID and password, 7 00:00:29,101 --> 00:00:33,934 and hit next. We get a pop-up, which asks us to 8 00:00:33,934 --> 00:00:38,201 confirm about the terms and services of GCP and 9 00:00:38,201 --> 00:00:41,301 also provide Google our residential detail. 10 00:00:41,301 --> 00:00:44,434 I'm putting India, you can put your own country, 11 00:00:44,434 --> 00:00:47,834 and then we have a choice whether we want any feature 12 00:00:47,867 --> 00:00:50,867 updates or survey emails from Google or not. 13 00:00:51,001 --> 00:00:55,101 Well, since I don't want to receive them, I will click No. 14 00:00:55,101 --> 00:00:57,301 [No Audio] 15 00:00:57,301 --> 00:01:00,567 Click on AGREE AND CONTINUE and the prompt 16 00:01:00,567 --> 00:01:03,867 will be gone. What you see in front of your screen 17 00:01:03,867 --> 00:01:08,134 is the Getting Started view of GCP Dashboard. 18 00:01:08,234 --> 00:01:12,134 We have a bunch of most used products like Compute 19 00:01:12,134 --> 00:01:15,967 Engine, which we will be using to create virtual machines, 20 00:01:16,234 --> 00:01:18,867 Cloud Storage, which is Google's 21 00:01:18,901 --> 00:01:22,101 affordable block storage, and Cloud SQL, which 22 00:01:22,101 --> 00:01:25,834 is managed MySQL or PostgreSQL from Google. 23 00:01:26,834 --> 00:01:30,434 But before we can use any of these, we need to set 24 00:01:30,434 --> 00:01:34,001 up something called Billing, which means we need 25 00:01:34,001 --> 00:01:37,601 to initiate our free trial of Google Cloud account 26 00:01:37,601 --> 00:01:41,601 by doing which, we will receive a $300 credit, 27 00:01:41,801 --> 00:01:46,734 which can be spent within a year. Click on try for free. 28 00:01:47,734 --> 00:01:50,634 It seems like it is a two-step payment setup 29 00:01:50,634 --> 00:01:54,567 process. Google is explicitly stating that we will 30 00:01:54,567 --> 00:01:58,767 get $300 credit for free for starting this trial 31 00:01:58,767 --> 00:02:01,867 account and even once the credits are finished, 32 00:02:01,867 --> 00:02:05,501 we won't be charged unless we agreed to be billed. 33 00:02:06,301 --> 00:02:09,567 Step one is pretty much similar to what we have 34 00:02:09,567 --> 00:02:12,033 done previously to the prompt which appeared. 35 00:02:12,033 --> 00:02:15,301 We need to agree to the terms and services of Google, 36 00:02:15,434 --> 00:02:17,967 and we need to tell them whether we want email 37 00:02:17,967 --> 00:02:21,501 setup or not. And click on AGREE AND CONTINUE. 38 00:02:21,967 --> 00:02:26,067 Step two involves personal information, like 39 00:02:26,067 --> 00:02:28,667 Account type, which can be either Business or 40 00:02:28,667 --> 00:02:32,167 Individual, Tax information, which can be 41 00:02:32,167 --> 00:02:35,434 Registered or Unregistered Individual, Billing 42 00:02:35,434 --> 00:02:39,434 Name, Billing Address, etc. Once you have filled 43 00:02:39,434 --> 00:02:42,834 in all of these details, when you scroll down, we 44 00:02:42,834 --> 00:02:45,834 get to the payment methods. Currently, the 45 00:02:45,834 --> 00:02:49,334 available option is Monthly automatic payments. 46 00:02:49,467 --> 00:02:52,834 And to enable them, we need to provide credit or 47 00:02:52,834 --> 00:02:56,201 debit card details. If you live in a country like 48 00:02:56,201 --> 00:02:59,567 India, where electronic transactions are protected 49 00:02:59,567 --> 00:03:03,634 by one time passwords or 3D pins, your debit card 50 00:03:03,634 --> 00:03:06,567 will not be accepted and you will have to use a 51 00:03:06,567 --> 00:03:10,001 credit card. The bottom line is whichever card you 52 00:03:10,001 --> 00:03:14,667 use, should have feature of auto payments. Once you 53 00:03:14,667 --> 00:03:18,934 enter your details, hit on start my Free Trial button. 54 00:03:20,634 --> 00:03:22,967 And the next screen says that Google is 55 00:03:22,967 --> 00:03:27,201 creating a project for us, and this may take a few moments. 56 00:03:28,267 --> 00:03:30,734 It seems like our free trial is set up. 57 00:03:31,167 --> 00:03:34,467 Now we have $300 credit on our Google Cloud 58 00:03:34,467 --> 00:03:37,767 Platform billing account, and we can get started 59 00:03:37,767 --> 00:03:42,734 by using GCP services. So what do we want to try first? 60 00:03:42,734 --> 00:03:45,234 Well, I want to try Computing and 61 00:03:45,234 --> 00:03:47,834 applications, so let's click on that. 62 00:03:47,834 --> 00:03:50,267 [No Audio] 63 00:03:50,267 --> 00:03:53,967 These services or these provisions from Google fall 64 00:03:53,967 --> 00:03:57,267 under the category of computing services. Now if 65 00:03:57,267 --> 00:04:01,067 you take a look at the left-hand side pane, we 66 00:04:01,067 --> 00:04:03,834 have multiple options here. Currently, we are on 67 00:04:03,834 --> 00:04:06,734 Getting Started tab, but the other tabs are 68 00:04:06,734 --> 00:04:12,167 Billing, Marketplace, APIs & Services, Support 69 00:04:12,167 --> 00:04:14,634 which would provide consumer and business level 70 00:04:14,634 --> 00:04:18,067 support, IAM & admin, which is useful for 71 00:04:18,067 --> 00:04:22,034 setting up permissions and roles, Security, etc. 72 00:04:22,233 --> 00:04:24,166 Let's click on Billing. 73 00:04:24,966 --> 00:04:27,966 This is the overview page of our billing account. 74 00:04:28,166 --> 00:04:36,467 And it says that we held $300 or 22,183 INR 75 00:04:36,467 --> 00:04:41,034 or Indian Rupees remaining in our credit. Also, the 76 00:04:41,034 --> 00:04:45,134 tenure remaining for credit is 365 days or a year 77 00:04:45,134 --> 00:04:49,001 because we have just started using GCP. If you see 78 00:04:49,001 --> 00:04:52,534 below it, we have a project link to this billing 79 00:04:52,534 --> 00:04:56,601 account, which is my first project. In case of 80 00:04:56,601 --> 00:05:00,834 Google Cloud Platform resources, services, provisions, etc, 81 00:05:00,834 --> 00:05:03,901 are managed under projects, which means that 82 00:05:03,901 --> 00:05:06,901 one GCP account can have multiple projects for 83 00:05:06,901 --> 00:05:10,734 multiple purposes. We have a default created 84 00:05:10,734 --> 00:05:14,434 project, which is called My First Project. GCP has 85 00:05:14,434 --> 00:05:17,367 provided it to us and if you remember, we had 86 00:05:17,367 --> 00:05:20,234 previously seen a screen, which said creating your 87 00:05:20,234 --> 00:05:23,567 first project. Well, it was this project. 88 00:05:23,934 --> 00:05:27,167 We will be using this project throughout this course. 89 00:05:27,467 --> 00:05:31,701 Go to the upper pane of our dashboard, and click on 90 00:05:31,701 --> 00:05:35,101 the drop down menu of project, which appears right 91 00:05:35,101 --> 00:05:38,067 after the Google Cloud Platform. Now let's click 92 00:05:38,067 --> 00:05:41,967 on Home button and let's select my first project 93 00:05:41,967 --> 00:05:45,701 as our project. Once we have selected the project, 94 00:05:45,701 --> 00:05:48,967 the view of our dashboard changes and instead of 95 00:05:48,967 --> 00:05:51,734 having a Getting Started view, we are having our 96 00:05:51,734 --> 00:05:54,967 project specific view, where the information is 97 00:05:54,967 --> 00:05:58,901 divided into multiple cards. The first card is 98 00:05:58,901 --> 00:06:02,867 Project info, which gives information about the 99 00:06:02,867 --> 00:06:06,167 Project name, Project ID, and Project number, 100 00:06:06,167 --> 00:06:09,634 which are unique across the globe. Then, we have the 101 00:06:09,634 --> 00:06:12,801 resources card. Right now, we don't have any 102 00:06:12,801 --> 00:06:17,567 resources provision, so it says this project has no resources. 103 00:06:18,001 --> 00:06:22,067 Then we have APIs card. The more we 104 00:06:22,067 --> 00:06:25,534 use GCP APIs, the more fluctuations we will see 105 00:06:25,534 --> 00:06:30,001 in the graph of this card. Currently, we haven't 106 00:06:30,001 --> 00:06:32,667 used much of the APIs, so the graph is pretty 107 00:06:32,667 --> 00:06:35,501 much plain apart from one spike, which might 108 00:06:35,501 --> 00:06:38,201 have generated when we activated our free trial. 109 00:06:38,467 --> 00:06:41,401 Then we have Google Cloud Platform services 110 00:06:41,401 --> 00:06:44,534 status, and it says All services are normal. 111 00:06:44,534 --> 00:06:49,201 Next up is error card, we have no signs of any errors, 112 00:06:49,201 --> 00:06:51,534 which makes sense because we haven't used any 113 00:06:51,534 --> 00:06:54,867 resources in the first place. Then we have some 114 00:06:54,867 --> 00:06:58,734 miscellaneous cards, like News, Documentation, 115 00:06:58,734 --> 00:07:02,367 Getting Started, etc. Let's click on the 116 00:07:02,367 --> 00:07:06,334 navigation menu icon of GCP dashboard, which is 117 00:07:06,367 --> 00:07:10,001 also called the hamburger icon, or three 118 00:07:10,001 --> 00:07:14,267 horizontal lines, which are on the top left corner 119 00:07:14,267 --> 00:07:17,834 of our dashboard view. Go to Compute Engine 120 00:07:17,834 --> 00:07:22,867 section and click on VM instances. Since we don't 121 00:07:22,867 --> 00:07:26,234 have any VM instances created whatsoever, we are 122 00:07:26,234 --> 00:07:29,834 getting this response, we have three options. 123 00:07:30,034 --> 00:07:34,001 First, to take a quick start tour, second to import 124 00:07:34,001 --> 00:07:37,801 some VM or third to create a VM or virtual machine 125 00:07:37,801 --> 00:07:42,101 by ourselves. Well, let's create a virtual machine. 126 00:07:42,101 --> 00:07:45,001 Now we are guided to virtual machine 127 00:07:45,001 --> 00:07:48,167 creation page where Google has filled in default 128 00:07:48,167 --> 00:07:52,134 data for a standard virtual machine. But we will 129 00:07:52,134 --> 00:07:56,034 modify it a bit. Let's change our instance name 130 00:07:56,901 --> 00:08:00,201 to Master, then we have two location related 131 00:08:00,201 --> 00:08:03,434 choices which include region and zone. 132 00:08:03,434 --> 00:08:07,801 Region indicates the overall place, whereas zone indicates 133 00:08:07,801 --> 00:08:11,001 a particular data center within that region. 134 00:08:11,001 --> 00:08:14,634 Let's change our region to asia-south1, 135 00:08:14,634 --> 00:08:18,801 which redirects to Mumbai. And accordingly, we are 136 00:08:18,801 --> 00:08:21,767 choosing asia-south1-c, you can choose your 137 00:08:21,767 --> 00:08:25,134 closest region and zones accordingly. 138 00:08:25,234 --> 00:08:29,167 In this course, the choice of region and zone will not 139 00:08:29,167 --> 00:08:31,867 matter that much. But if you are making some 140 00:08:31,867 --> 00:08:34,933 performance intensive applications, where you might 141 00:08:34,933 --> 00:08:38,900 require a certain type of resources, like GPU, 142 00:08:38,900 --> 00:08:42,866 you may have to choose regions and zones which provide 143 00:08:42,866 --> 00:08:45,967 those resources. Having said that, next up, 144 00:08:45,967 --> 00:08:49,601 we have machine type. The default value for those is 145 00:08:49,601 --> 00:08:53,667 1 vCPU, which means 1 virtual CPU 146 00:08:53,667 --> 00:08:57,967 and 3.75 GB of memory, it means that our virtual 147 00:08:57,967 --> 00:09:01,467 machine will have 1 virtual core of CPU assigned 148 00:09:01,467 --> 00:09:05,067 to it, along with 3.75 GB of RAM. 149 00:09:05,101 --> 00:09:09,967 Let's increase both of these provisions to 2 vCPUs, 150 00:09:10,167 --> 00:09:14,601 and 7.5 GB of memory. Next up, we have an optional 151 00:09:14,601 --> 00:09:16,801 choice to make, whether we want to deploy a 152 00:09:16,801 --> 00:09:19,734 container image to this VM instance or not. 153 00:09:19,734 --> 00:09:22,934 Well, we don't want to deploy a container image, 154 00:09:23,367 --> 00:09:26,334 because we'll be doing all of those things by ourselves. 155 00:09:26,501 --> 00:09:30,201 Next up is Boot disk, which means which operating 156 00:09:30,201 --> 00:09:33,867 system will be used on this VM. The default is 157 00:09:33,867 --> 00:09:39,467 Debian Linux 9, but we will change it to Ubuntu 16.04. 158 00:09:39,467 --> 00:09:42,734 We can also choose between SSD persistent 159 00:09:42,734 --> 00:09:46,167 disk or Standard persistent disk and both of their 160 00:09:46,167 --> 00:09:51,334 limits are 65,536 gigabytes. We will stick to 161 00:09:51,334 --> 00:09:54,234 Standard persistent disk but increase the limits 162 00:09:54,234 --> 00:09:58,867 to 20 GB, let's hit Select. We will keep our 163 00:09:58,867 --> 00:10:01,767 service account as Compute Engine default service 164 00:10:01,767 --> 00:10:05,567 account, and we will allow full access to all 165 00:10:05,567 --> 00:10:08,867 Cloud APIs. Although we won't be using most of 166 00:10:08,867 --> 00:10:12,301 the APIs, having access just avoids potential 167 00:10:12,301 --> 00:10:15,867 errors. Finally, we have Firewall settings where 168 00:10:15,867 --> 00:10:19,734 we are going to allow all HTTP and HTTPS traffic. 169 00:10:19,734 --> 00:10:23,267 Let's hit Create button. We are redirected to VM 170 00:10:23,267 --> 00:10:26,801 instances page, and our master instance has been 171 00:10:26,801 --> 00:10:30,134 created. If we click on it, we can see the 172 00:10:30,134 --> 00:10:32,501 information that we had provided earlier. 173 00:10:33,201 --> 00:10:36,934 On top of that, we get another bunch of information such 174 00:10:36,934 --> 00:10:40,401 as the CPU platform, which is Intel Skylake, 175 00:10:40,867 --> 00:10:45,201 Creation time, Network Interface details, Firewall 176 00:10:45,201 --> 00:10:48,934 details, Boot disk preferences, etc. 177 00:10:48,934 --> 00:10:52,834 Let's go back to VM Instances page. If we click on the 178 00:10:52,834 --> 00:10:56,367 checkbox, right beside the master instance, we see 179 00:10:56,367 --> 00:11:00,134 a few buttons lit up, they respectively allow us 180 00:11:00,167 --> 00:11:04,901 to stop, restart, or delete the VM instance. 181 00:11:04,901 --> 00:11:07,867 But we won't be doing any of that, because we want to 182 00:11:07,867 --> 00:11:10,401 keep this instance and want to work on it. 183 00:11:10,834 --> 00:11:14,767 In fact, we will create 2 more of such VM instances, 184 00:11:14,767 --> 00:11:17,867 and we will name them node-1 and node-2. 185 00:11:17,867 --> 00:11:21,834 It is recommended that you create all of these instances 186 00:11:21,834 --> 00:11:25,634 in the same region. There we are, our two other 187 00:11:25,634 --> 00:11:29,201 instances are created. You might be wondering, the 188 00:11:29,201 --> 00:11:33,834 instances are created, means VMs are ready. But how 189 00:11:33,834 --> 00:11:37,167 do we use them? Well, the simple most option to 190 00:11:37,167 --> 00:11:40,467 connect to it would be to SSH into it, and the 191 00:11:40,467 --> 00:11:44,067 moment I said SSH, I know your site is stuck on 192 00:11:44,067 --> 00:11:47,534 the SSH button. But before we click on that, take 193 00:11:47,534 --> 00:11:50,734 a look at the internal and external IP of all of 194 00:11:50,734 --> 00:11:54,267 our VMs. Let's connect it, we have multiple 195 00:11:54,267 --> 00:11:57,534 options, but we will choose the first one which is 196 00:11:57,534 --> 00:12:01,067 open in a different browser window. There we are, 197 00:12:01,067 --> 00:12:04,167 we are connecting to the master instance of master 198 00:12:04,167 --> 00:12:07,401 VM instance of our GCP Compute Engine. 199 00:12:07,401 --> 00:12:11,434 The connection seems successful. Let's clear the screen out. 200 00:12:11,434 --> 00:12:14,067 Now we want to bootstrap a Kubernetes 201 00:12:14,067 --> 00:12:17,334 cluster on these instances. So let's start by 202 00:12:17,334 --> 00:12:21,234 getting root privileges. Run the command sudo su. 203 00:12:21,701 --> 00:12:25,367 Let's run a standard update using apt-get update. 204 00:12:25,467 --> 00:12:28,667 Once the update is finished, let's install Docker 205 00:12:28,701 --> 00:12:32,801 using apt-get install docker.io and provide the 206 00:12:32,801 --> 00:12:35,534 flag -y for default yes. 207 00:12:35,534 --> 00:12:38,201 [No Audio] 208 00:12:38,201 --> 00:12:41,034 Let's check out if our Docker is installed properly. 209 00:12:41,034 --> 00:12:44,334 Run docker version and it says that we 210 00:12:44,334 --> 00:12:48,634 are running Docker 17.03 Community Edition, 211 00:12:48,634 --> 00:12:51,701 which is perfectly fine because that's what we wanted to run. 212 00:12:51,967 --> 00:12:54,034 If you're wondering why are we running 213 00:12:54,034 --> 00:12:57,834 Docker? Well, Kubernetes is just an orchestrator. 214 00:12:57,967 --> 00:13:01,634 It still needs a containerization platform, so we 215 00:13:01,634 --> 00:13:03,067 are installing Docker. 216 00:13:03,401 --> 00:13:05,167 Oops, looks like I closed 217 00:13:05,201 --> 00:13:08,801 the window. Well, let's open it again. Now let's 218 00:13:08,801 --> 00:13:11,467 install some basic dependencies of Kubernetes, 219 00:13:11,601 --> 00:13:16,267 like HTTPS and curl, the installation seems successful. 220 00:13:16,801 --> 00:13:20,367 Now let's get the GPG for GNU 221 00:13:20,367 --> 00:13:25,767 Privacy Guard key for Kubernetes and add it to the system. 222 00:13:26,001 --> 00:13:28,667 We get the response OK, which means that 223 00:13:28,667 --> 00:13:31,867 the key was added successfully. We are adding the 224 00:13:31,867 --> 00:13:36,401 line the deb which stands for Debian followed by 225 00:13:36,401 --> 00:13:43,634 the link which is http://apt.kubernetes.io/kubernetes-xenial main 226 00:13:43,834 --> 00:13:46,934 at the end of our sources.list file. We are doing 227 00:13:46,934 --> 00:13:51,001 this so that our apt-packagemanager can access 228 00:13:51,001 --> 00:13:53,734 Kubernetes libraries whenever it is performing 229 00:13:53,734 --> 00:13:57,301 updates. Let's verify if the step was successful. 230 00:13:57,301 --> 00:14:00,601 Run apt-get update again, and as you can see, 231 00:14:00,601 --> 00:14:05,667 our last Get: 7 entry includes update received 232 00:14:05,667 --> 00:14:09,067 from Kubernetes URL. Now let's install all of the 233 00:14:09,067 --> 00:14:12,567 components of Kubernetes which include kubelet, 234 00:14:12,567 --> 00:14:17,267 kubeadm and kubectl. Run apt-get install 235 00:14:17,667 --> 00:14:23,067 kubelet kubeadm kubectl accompanied by the flag -y. 236 00:14:24,234 --> 00:14:26,734 Looks like the installation is complete. 237 00:14:26,734 --> 00:14:32,267 Let's exit our SSH and log in again. Run sysctl 238 00:14:32,267 --> 00:14:37,001 command and set our default net.bridge iptables=1. 239 00:14:37,001 --> 00:14:40,001 This is a prerequisite for installing 240 00:14:40,001 --> 00:14:42,901 the pod network which we will be using while 241 00:14:42,901 --> 00:14:45,767 setting up the Kubernetes cluster. Now let's 242 00:14:45,801 --> 00:14:50,901 initialize our Kubernetes cluster using kubeadm init command. 243 00:14:50,901 --> 00:14:54,334 Seems like the cluster initialization is in progress. 244 00:14:54,334 --> 00:14:56,834 And once the preflight checks are complete, 245 00:14:56,834 --> 00:14:59,667 we are getting a lot of certificates generated. 246 00:14:59,667 --> 00:15:03,201 Once the initialization is complete, we have provided a few 247 00:15:03,201 --> 00:15:07,067 suggestions. First of all, we have a confirmation 248 00:15:07,067 --> 00:15:10,067 that our Kubernetes master has been initialized 249 00:15:10,067 --> 00:15:12,767 successfully. Next up, we have a bunch of 250 00:15:12,767 --> 00:15:15,301 commands, which should be used if we want to use 251 00:15:15,301 --> 00:15:19,401 this cluster as regular user and not just root user. 252 00:15:19,401 --> 00:15:22,534 I recommend, you copy all of these three 253 00:15:22,534 --> 00:15:25,767 commands at a safe place, because we will be using 254 00:15:25,767 --> 00:15:29,734 them later on. Next is a suggested command to 255 00:15:29,734 --> 00:15:33,001 deploy a pod network on the cluster. But we don't 256 00:15:33,001 --> 00:15:38,567 need to copy that. And finally, we have a kubeadm join command 257 00:15:38,567 --> 00:15:40,667 followed by the token, which is 258 00:15:40,667 --> 00:15:44,567 generated by our master and 64 digit certificate, 259 00:15:44,567 --> 00:15:47,967 which we must copy and save at some place. 260 00:15:47,967 --> 00:15:51,867 Because this command is extremely crucial, and will be 261 00:15:51,867 --> 00:15:55,034 used by all other nodes to join our master. 262 00:15:55,034 --> 00:15:59,034 Once you have copied all of this, let's clear out the terminal. 263 00:15:59,267 --> 00:16:02,267 Before we proceed any further, make sure 264 00:16:02,267 --> 00:16:05,267 you don't leave any unnecessary white spaces 265 00:16:05,267 --> 00:16:09,567 when you copy the command. Now let's run kubectl apply 266 00:16:09,567 --> 00:16:14,134 command followed by the URL of our pod network configuration. 267 00:16:14,134 --> 00:16:17,201 We are using weave net, so the URL 268 00:16:17,201 --> 00:16:20,434 starts with cloud.weave.works. But you can 269 00:16:20,434 --> 00:16:23,434 use any pod network you like such as Flannel, 270 00:16:23,434 --> 00:16:27,034 Calico, etc, and the details for other pod 271 00:16:27,034 --> 00:16:30,401 networks can be found at Kubernetes documentation. 272 00:16:31,401 --> 00:16:33,901 It seems like our pod network is set up. 273 00:16:33,901 --> 00:16:39,101 Let's check if our cluster is working. Run kubectl get pods 274 00:16:39,101 --> 00:16:42,934 followed by a flag, --all-namespaces. 275 00:16:42,934 --> 00:16:44,667 You don't need to dig too deep into 276 00:16:44,667 --> 00:16:47,201 this command, because we will be going through the 277 00:16:47,201 --> 00:16:50,067 whole Kubernetes command line step by step. 278 00:16:50,067 --> 00:16:53,534 All you have to notice are the familiar names such as 279 00:16:53,801 --> 00:16:58,301 etcd, kube-apiserver, kube-controllermanager, 280 00:16:58,401 --> 00:17:03,567 kube-proxy, kube-scheduler, etc. All of these are 281 00:17:03,567 --> 00:17:06,300 components of Kubernetes architecture, which we 282 00:17:06,334 --> 00:17:09,834 have studied in theory. And now they are deployed 283 00:17:09,834 --> 00:17:12,934 on your Google Cloud VM instance. Of course, these 284 00:17:12,934 --> 00:17:15,334 were the components of a Kubernetes master. 285 00:17:15,334 --> 00:17:18,733 For node instances, we will have different components. 286 00:17:18,733 --> 00:17:23,267 Now, let's grant regular user access to our master. 287 00:17:23,334 --> 00:17:26,233 Run the three commands one by one, which we had 288 00:17:26,233 --> 00:17:30,001 copied earlier. And to see if our Kubernetes is 289 00:17:30,001 --> 00:17:33,800 working on regular user or not, let's run the same 290 00:17:33,800 --> 00:17:37,166 kubectl get pods command again. And it seems like 291 00:17:37,166 --> 00:17:40,666 all of the pods are up and running and Kubernetes 292 00:17:40,666 --> 00:17:43,901 master is accessible from regular user as well. 293 00:17:44,300 --> 00:17:49,834 Now let's get back to our GCP VMs page and SSH to node-1. 294 00:17:50,601 --> 00:17:52,967 Let's get the root user access again. 295 00:17:53,634 --> 00:17:58,167 Now run kubeadm join command. If you remember, 296 00:17:58,234 --> 00:18:01,701 we had run kubeadm init from master and we had 297 00:18:01,701 --> 00:18:06,234 received a token from there. Now we are using kubeadm join 298 00:18:06,234 --> 00:18:09,167 from node instances to join the master 299 00:18:09,167 --> 00:18:12,001 as the members of cluster. The tokens which we are 300 00:18:12,001 --> 00:18:14,534 providing are the same that we had received when 301 00:18:14,534 --> 00:18:18,234 the master was initialized, press Enter. 302 00:18:18,234 --> 00:18:21,401 There we go, once the joining process is complete, 303 00:18:21,401 --> 00:18:25,267 we get a suggestion that we should run kubectl get nodes 304 00:18:25,267 --> 00:18:29,267 on master to see if the node has joined the cluster. 305 00:18:29,267 --> 00:18:34,334 Well, we'll do it, but after making node-2 join the cluster. 306 00:18:34,334 --> 00:18:38,867 Back to GCP VMs, let's SSH to node-2. 307 00:18:38,867 --> 00:18:41,367 Nothing too complicated, exactly the 308 00:18:41,367 --> 00:18:44,001 same steps which we had performed on node-1. 309 00:18:44,067 --> 00:18:47,434 Get the root user access and run the kubeadm join 310 00:18:47,434 --> 00:18:49,267 command with the same tokens. 311 00:18:50,334 --> 00:18:51,634 Once that is done, 312 00:18:51,634 --> 00:18:54,201 let's follow their suggestion and head back to 313 00:18:54,201 --> 00:18:57,401 master. We have already set up a non-root user 314 00:18:57,401 --> 00:19:00,334 kubectl access on master, so we don't need to run 315 00:19:00,334 --> 00:19:04,234 sudo su again, just simply run kubectl get nodes. 316 00:19:05,134 --> 00:19:09,167 And there we go, we have all the three nodes listed, 317 00:19:09,167 --> 00:19:13,467 but if you notice, node-1 is not ready yet. 318 00:19:13,867 --> 00:19:16,534 Nothing too much to worry about. Let's give 319 00:19:16,534 --> 00:19:18,967 it some time and run the command again. 320 00:19:18,967 --> 00:19:22,834 Bingo, all of the nodes have joined the cluster successfully 321 00:19:22,834 --> 00:19:25,701 and are ready to work on. Now that our Kubernetes 322 00:19:25,701 --> 00:19:28,434 cluster is properly set up, we are ready to explore 323 00:19:28,434 --> 00:19:31,134 different aspects of Kubernetes like Workloads 324 00:19:31,134 --> 00:19:33,367 kubectl, command line, etc. See you in the next 325 00:19:33,367 --> 00:19:35,001 See you in the next lecture.