1 00:00:01,070 --> 00:00:03,280 This first config file is pretty straightforward in nature. 2 00:00:03,320 --> 00:00:07,040 Well let's go to the thing line by line and just make sure that the purpose of every line is really 3 00:00:07,040 --> 00:00:08,160 crystal clear. 4 00:00:08,190 --> 00:00:13,340 So quick diagram on the left hand side I've got every line that config file and on the right hand side 5 00:00:13,340 --> 00:00:14,960 I've got a couple of notes. 6 00:00:14,960 --> 00:00:17,700 The first thing he wrote was API version B 1. 7 00:00:17,780 --> 00:00:22,610 It turns out that Cuban 80s is actually a really extensible when you install Cuban 80s on your local 8 00:00:22,610 --> 00:00:23,020 machine. 9 00:00:23,030 --> 00:00:29,090 It comes with a preset list of different objects we can create so we can create things like pods deployment 10 00:00:29,090 --> 00:00:30,750 services and so on. 11 00:00:30,860 --> 00:00:35,320 We can also tell Cuban editors about custom objects that we want to create as well. 12 00:00:35,330 --> 00:00:40,340 The goal of the API version right here is to tell Cuban cities about the pool of objects that we want 13 00:00:40,340 --> 00:00:41,500 to draw from. 14 00:00:41,510 --> 00:00:45,180 So in this case we are telling Cuban cities look at the default V1. 15 00:00:45,230 --> 00:00:50,800 Cuban editors list of objects that we can create then on the right next line right. 16 00:00:50,810 --> 00:00:55,330 After that we specify the exact type of object that we want to create from that pool. 17 00:00:55,340 --> 00:01:01,370 So in this case you want to create an object of type pod and remember a pod is going to wrap up a container 18 00:01:01,550 --> 00:01:06,890 and for our definition or our purposes a pod is more or less like a container. 19 00:01:06,890 --> 00:01:10,930 Next up was metadata metadata is going to include some different options. 20 00:01:10,940 --> 00:01:16,280 So we want to apply to the object we're about to create by far the most common option that we're going 21 00:01:16,280 --> 00:01:18,500 to apply is the name property. 22 00:01:19,040 --> 00:01:24,110 So by providing a name right here we are saying that when this pod is created we want the pod to be 23 00:01:24,110 --> 00:01:25,880 given a name of. 24 00:01:26,620 --> 00:01:32,630 When we were back at our terminal a moment ago and we ran that command K get pods we saw the name print 25 00:01:32,630 --> 00:01:34,040 up right here of posts. 26 00:01:34,040 --> 00:01:37,200 Yeah that is the metadata Name property right there. 27 00:01:37,250 --> 00:01:44,120 So if we had changed post to something else like my odd with posts and then tried to create this thing 28 00:01:44,120 --> 00:01:52,490 again it would instead have a name of my pod with post after that we have the spec the spec or specification 29 00:01:52,580 --> 00:01:56,950 is going to have a list of configuration options or the pod that we're about to create. 30 00:01:56,990 --> 00:02:02,120 This is a very precise definition that controls exactly what should be going on inside this pod and 31 00:02:02,120 --> 00:02:04,590 how the pod should behave. 32 00:02:04,660 --> 00:02:08,230 The only required property we have to throw in here is containers. 33 00:02:08,230 --> 00:02:10,250 Containers is going to be an array. 34 00:02:10,300 --> 00:02:13,450 That's what the little dash right there meant inside of our yellow file. 35 00:02:13,640 --> 00:02:19,930 The dash means that we want to add in a array entity right here so we could technically have many containers 36 00:02:19,930 --> 00:02:22,200 inside this one pod but our case we have just one. 37 00:02:22,240 --> 00:02:23,590 So one array entry 38 00:02:27,320 --> 00:02:31,680 or that one array entry we're going to provide some configuration for this one container that's going 39 00:02:31,680 --> 00:02:36,420 to be create inside the pod the container that's going to be created will be given a name of post as 40 00:02:36,420 --> 00:02:37,460 well. 41 00:02:37,470 --> 00:02:41,580 Now one thing not to mention really quickly is that the name properties here don't really have a lot 42 00:02:41,580 --> 00:02:42,610 of big importance. 43 00:02:42,630 --> 00:02:45,120 You can provide a name of whatever makes sense to you. 44 00:02:45,120 --> 00:02:49,200 In this case I gave the pod and the container inside of it an identical name. 45 00:02:49,290 --> 00:02:50,550 Is that bad practice. 46 00:02:50,730 --> 00:02:52,230 Well not really. 47 00:02:52,230 --> 00:02:56,850 Because again our pod is only going to be running one container that's gonna be okay to have the pod 48 00:02:56,850 --> 00:03:03,100 and container have the exact same name the only real purpose of a name for us in this context in the 49 00:03:03,100 --> 00:03:08,380 course is to help us with debugging and help us understand exactly what part we're looking at or what 50 00:03:08,380 --> 00:03:10,930 container we are working with. 51 00:03:10,950 --> 00:03:17,270 We also provide the image property and this is going to be the exact tag applied to some image. 52 00:03:17,290 --> 00:03:20,940 One thing that you might note here is that I put on a version number here at the very end. 53 00:03:21,520 --> 00:03:26,380 You might recall from your background in Docker that if we do not provide a version at the very end 54 00:03:27,160 --> 00:03:31,500 then Docker will default to putting on latest in all scenarios. 55 00:03:31,810 --> 00:03:37,300 If you ever apply or tried to create a pod that has latest on the end right there or doesn't have anything 56 00:03:37,360 --> 00:03:43,690 which implies latest Vancouver 90s default behavior is to try to reach out to Docker Hub and find this 57 00:03:43,840 --> 00:03:46,300 image listed on Docker Hub. 58 00:03:46,330 --> 00:03:48,040 We have not pushed this image Docker Hub. 59 00:03:48,160 --> 00:03:54,740 So if we had done that we would have resulted in an air by putting on an exact version humanity says 60 00:03:55,040 --> 00:04:00,890 oh OK well I'm going to assume that if this image is located on the computer that I'm running on. 61 00:04:00,890 --> 00:04:04,520 So essentially you're computer right now is just gonna go ahead and use that image directly. 62 00:04:04,550 --> 00:04:11,060 So in other words when its latest or an implicit latest which would mean that we just don't have anything 63 00:04:11,060 --> 00:04:11,540 at all. 64 00:04:11,580 --> 00:04:16,370 Humanities assumes that it needs to go out to Docker Hub and try to find the latest image as opposed 65 00:04:16,370 --> 00:04:18,580 to using the image that is already on your computer. 66 00:04:18,590 --> 00:04:23,180 So by putting on that version we're just saying hey if you find that version on the local computer just 67 00:04:23,180 --> 00:04:26,590 use it don't try to reach out to Docker Hub now functionally. 68 00:04:26,590 --> 00:04:30,700 You don't really have to worry about that distinction in practice and the words just don't sweat this 69 00:04:30,700 --> 00:04:31,270 too much. 70 00:04:31,270 --> 00:04:32,570 Don't read too much into it. 71 00:04:32,590 --> 00:04:37,060 We only really put this on here to avoid any errors coming up on this first pod that we are creating 72 00:04:37,060 --> 00:04:40,960 because obviously we'd been kind of nasty to have a air up appear immediately. 73 00:04:40,960 --> 00:04:45,220 So usually when we write out a pod spec or a deployment spec we're usually just going to specify the 74 00:04:45,220 --> 00:04:50,420 image in the form you see right here and not read too much about it again. 75 00:04:50,470 --> 00:04:52,400 So that's it for our config file now. 76 00:04:52,450 --> 00:04:56,350 We also ran a commander to the last video we ran can get pods. 77 00:04:56,500 --> 00:05:00,910 Let's do a quick pause right here and I would expand on the earth not get pods but cubes TTL. 78 00:05:00,970 --> 00:05:03,790 I'll tell you about what that K is right there in just a moment. 79 00:05:03,790 --> 00:05:05,830 You're probably wondering why I was able to run that. 80 00:05:05,860 --> 00:05:08,400 I'll tell you about that in just a moment just a little shortcut. 81 00:05:08,470 --> 00:05:10,300 So when we run cubes you tell to get pods. 82 00:05:10,300 --> 00:05:12,250 There's a variety of other commands you need to know. 83 00:05:12,280 --> 00:05:15,340 So I'll take a quick pause right here and expand on some these commands in just a moment.