1 00:00:01,460 --> 00:00:05,870 Now that I've told you a ton about config files without actually saying well what they're really doing 2 00:00:05,870 --> 00:00:06,590 internally. 3 00:00:06,590 --> 00:00:10,140 Let's go ahead and create our first config file in this first config file. 4 00:00:10,160 --> 00:00:16,860 We are going to try to create a pod directly so just a pod by itself out of our hosts service though 5 00:00:16,910 --> 00:00:18,810 just to look back at this diagram over here. 6 00:00:18,950 --> 00:00:24,740 The only part of this thing that I really want to make out of everything we discussed is just one pod 7 00:00:26,910 --> 00:00:27,870 like that right there. 8 00:00:27,990 --> 00:00:30,630 That's all I want to have a pod that's running container. 9 00:00:30,660 --> 00:00:32,370 There's not gonna be any other service. 10 00:00:32,370 --> 00:00:36,080 There's not going to be any deployment nothing like that just a pod by itself. 11 00:00:36,080 --> 00:00:37,810 So let's figure out how we will do this. 12 00:00:37,920 --> 00:00:41,250 And this video we're going to write out all the configuration for it and we'll have a deep discussion 13 00:00:41,250 --> 00:00:44,940 about what every line of this configuration really means to get started. 14 00:00:44,940 --> 00:00:47,440 We're going to first go back to our terminal. 15 00:00:47,600 --> 00:00:52,460 We will change into our post directory and we are going to rebuild that Docker image. 16 00:00:52,480 --> 00:00:56,300 Now it's really important that you rebuild this thing because we're going to apply a additional label 17 00:00:56,300 --> 00:01:00,070 to it that's gonna help us identify it inside the configuration that we're about to write. 18 00:01:00,070 --> 00:01:03,500 So even though we've built it several times down the last couple of videos yeah we're going to build 19 00:01:03,500 --> 00:01:04,490 it again. 20 00:01:04,570 --> 00:01:13,850 So inside of posts I going to run docker build dash T and we'll put down your Docker I.D. slash posts 21 00:01:14,550 --> 00:01:17,210 and then a colon and all through a version number on there. 22 00:01:17,250 --> 00:01:19,400 So you zero zero point one. 23 00:01:19,410 --> 00:01:24,960 Don't forget the colon Olympia space and put in the dot to say I want to build this image out of this 24 00:01:25,020 --> 00:01:29,370 current directory of posts and there we go. 25 00:01:29,380 --> 00:01:33,730 So I've now built that image and that's how we can refer to this exact image. 26 00:01:33,730 --> 00:01:38,200 We've got the name of the image of the tag line with the version number right there on the very ET Now 27 00:01:38,200 --> 00:01:39,190 that we've got that put together. 28 00:01:39,250 --> 00:01:43,810 Let's go back over to our Ed we're going to write out our configuration file to create a pod using this 29 00:01:43,810 --> 00:01:51,390 container or this image the back of my Ed. I'm going to first create a new directory called infra This 30 00:01:51,390 --> 00:01:52,900 is short for infrastructure. 31 00:01:52,900 --> 00:01:58,090 So this is going to contain all the configuration all the code related to the deployment or management 32 00:01:58,120 --> 00:02:04,340 of all of our different services inside there and then going to create a folder called K eights. 33 00:02:04,540 --> 00:02:06,920 We're going to eventually have several different folders inside of here. 34 00:02:06,970 --> 00:02:11,880 Right now we're going to say K AIDS is going to contain all of our Cuban 80s configuration files. 35 00:02:12,040 --> 00:02:19,810 Just you know k 8 s is short for Cuban edits then inside there I'll create a new file and we're going 36 00:02:19,810 --> 00:02:25,690 to call this thing those not yellow All right. 37 00:02:25,720 --> 00:02:26,530 So inside of here. 38 00:02:26,530 --> 00:02:28,990 Yep that's we're going to write out all of our configuration. 39 00:02:28,990 --> 00:02:32,920 Now as I mentioned at the start of this video we're just going to focus on writing on the configuration 40 00:02:33,010 --> 00:02:35,020 and creating this pod. 41 00:02:35,020 --> 00:02:38,440 Then we'll come back the next video and discuss exactly what all the config is actually doing. 42 00:02:38,440 --> 00:02:43,170 So right now we're going to do a little bit of a follow along write out exactly what I write out. 43 00:02:43,180 --> 00:02:53,100 They'll say API version with a capital V a colon and then V1 we'll put in a kind of pod notice that 44 00:02:53,100 --> 00:03:00,650 pod has a capital P well put in metadata well then put in a new line and on the next line there has 45 00:03:00,650 --> 00:03:04,940 to be one indentation that like so the really two spaces right there. 46 00:03:04,940 --> 00:03:09,260 If you don't have that then you're not running out valid camels to make sure you've got exactly two 47 00:03:09,260 --> 00:03:11,550 spaces right out. 48 00:03:11,560 --> 00:03:20,800 Name is post then back at the top level of indentation we'll put down spec we will indent again and 49 00:03:20,800 --> 00:03:24,760 say containers another new line. 50 00:03:24,870 --> 00:03:32,940 We're going to indent one we're level we'll put in a dash space name of posts and then image will be 51 00:03:33,210 --> 00:03:36,230 whatever the image is that you just built two seconds ago. 52 00:03:36,240 --> 00:03:37,110 Back at your terminal. 53 00:03:37,110 --> 00:03:39,120 So essentially that right there. 54 00:03:39,120 --> 00:03:44,430 So for me it will be Steven Greider slash posts Berlin 0 0 1. 55 00:03:44,800 --> 00:03:50,080 That's absolutely critical that you have the exact same indentation that I do all the way through if 56 00:03:50,080 --> 00:03:54,040 you save this and I try to run it as you're about to do a second and you get an error. 57 00:03:54,130 --> 00:03:59,530 I can just about guarantee you there is a typo somewhere inside of here. 58 00:03:59,570 --> 00:04:00,830 That's our config file. 59 00:04:00,950 --> 00:04:03,740 We have told Cuban eddies that we want to create a pod. 60 00:04:03,740 --> 00:04:06,440 We want its name to be posts inside that pod. 61 00:04:06,440 --> 00:04:12,080 We want there to be exactly one container the containers name should be posts and we're going to build 62 00:04:12,080 --> 00:04:15,250 that container using the image of that right there. 63 00:04:15,260 --> 00:04:20,270 So let's figure out how we can use the cube TTL command line tool to actually make use of this config 64 00:04:20,270 --> 00:04:22,410 file. 65 00:04:22,430 --> 00:04:28,070 Next we're going to tell Cuban cities to use this config file to create a new object but to do so we're 66 00:04:28,070 --> 00:04:31,240 gonna go back over to our terminal back at my terminal. 67 00:04:31,240 --> 00:04:33,650 I'm still inside of my posts project directory. 68 00:04:33,730 --> 00:04:37,120 I want to change into that case folder that we just made a second ago. 69 00:04:37,190 --> 00:04:44,380 They'll go up one directory I'll change into infra and then Kate's and then inside there I should see 70 00:04:44,380 --> 00:04:49,000 the post yellow file to tell Cuban notice that we wanted to use this config file. 71 00:04:49,000 --> 00:04:56,770 We will write out cube CTO apply dash F and then the name of the file which in this case is post yellow 72 00:04:58,580 --> 00:05:02,420 I'll go ahead and run that and then we should see something like this right here. 73 00:05:02,420 --> 00:05:07,310 If you immediately see an error when you run that command again I can guarantee you that you've got 74 00:05:07,340 --> 00:05:12,500 a typo somewhere inside this file you will only ever see errors coming out of this command. 75 00:05:12,500 --> 00:05:16,850 If there is a typo there's just about no other scenario unless you're not running the Cuban 80s cluster 76 00:05:16,850 --> 00:05:17,250 at all. 77 00:05:17,270 --> 00:05:21,380 That's only two scenarios other Cuban entities is not running on your machine or there's a typo inside 78 00:05:21,380 --> 00:05:24,860 the file which says that this thing was created. 79 00:05:24,870 --> 00:05:26,010 But what does that really mean. 80 00:05:27,020 --> 00:05:32,000 To inspect the state or to figure out exactly what is going on inside of our cluster there is a variety 81 00:05:32,000 --> 00:05:34,510 of different commands we're going to run with QCT El. 82 00:05:34,820 --> 00:05:39,470 In this case we want to take a look at all the different pods that are running inside of our cluster. 83 00:05:39,500 --> 00:05:44,210 There should be exactly one right now so to inspect and get a list of all the different pods that are 84 00:05:44,210 --> 00:05:45,010 running inside of here. 85 00:05:45,020 --> 00:05:54,340 We can run cube Seitel yet odds and then we'll see that there is exactly one pod with the name of posts. 86 00:05:54,440 --> 00:06:00,410 There's one copy of it that is being tried to be executed and one copy is successfully running this 87 00:06:00,410 --> 00:06:05,860 pod status is running it has never been restarted and it was created 50 seconds ago. 88 00:06:05,990 --> 00:06:06,410 That's it. 89 00:06:06,410 --> 00:06:12,010 That's how we create an object in Cuban edits just about everything else we do with Cuba daddies is 90 00:06:12,020 --> 00:06:17,060 going to be kind of variations of this config file normally the config files we're gonna write out are 91 00:06:17,060 --> 00:06:19,330 gonna be way longer than what you see right here. 92 00:06:19,400 --> 00:06:24,380 Usually closer to say 40 lines or so but this creates just one simple little object. 93 00:06:24,380 --> 00:06:29,000 We then applied it to Cuban entities and Cuban natives use this config to decide exactly what to do 94 00:06:29,000 --> 00:06:30,470 inside the cluster. 95 00:06:30,470 --> 00:06:33,800 Now there's a lot of configuration even though it's only a couple lines that's kind of stuff inside 96 00:06:33,800 --> 00:06:34,200 of here. 97 00:06:34,250 --> 00:06:38,330 So I wanna give you a couple of quick notes about what's going on here in a couple of quick notes about 98 00:06:38,330 --> 00:06:40,850 the cube CTF command line tool in just a moment.