1 00:00:01,040 --> 00:00:04,220 Hopefully you now have Cuba that is up and running on your local machine. 2 00:00:04,220 --> 00:00:08,450 The first thing we're going to do is just run one simple command to make sure that it is running successfully 3 00:00:09,170 --> 00:00:09,950 to run this command. 4 00:00:09,950 --> 00:00:12,010 We're going to open up a new terminal window. 5 00:00:12,080 --> 00:00:12,800 That's really important. 6 00:00:12,800 --> 00:00:16,780 Please make sure you open up a new terminal window even if you already have an open. 7 00:00:16,940 --> 00:00:25,550 And in this new window we will run cube CCL version so I'll go ahead run that and we should see something 8 00:00:25,550 --> 00:00:28,570 print out for a client version and server version. 9 00:00:28,580 --> 00:00:32,280 Now if you're running a newer version than I am that is totally fine. 10 00:00:32,420 --> 00:00:38,460 Newer versions of Cuban 80s add in some pretty exotic features that we are very unlikely to use anytime 11 00:00:38,480 --> 00:00:39,860 inside this course. 12 00:00:39,860 --> 00:00:45,290 So really we could be using a much earlier version of Cuban 80s than what even I'm using right now and 13 00:00:45,290 --> 00:00:47,870 everything inside this course is still going to work just fine. 14 00:00:47,870 --> 00:00:52,610 Remember Cuban editors to some degree is about stability because we're using it to manage a tremendous 15 00:00:52,610 --> 00:00:56,960 aspect of our application now that we've got Cuban editors up and running. 16 00:00:57,040 --> 00:01:01,690 We're going to take a look at a quick couple of diagrams here really just one big diagram and get a 17 00:01:01,690 --> 00:01:04,340 quick tour of what communities is really all about. 18 00:01:04,580 --> 00:01:09,640 So I'm gonna walk you through the workflow of how we're really going to use Cuban eddies quick note 19 00:01:09,640 --> 00:01:12,250 here but I'm gonna show you is really in debt. 20 00:01:12,300 --> 00:01:14,450 There's gonna be a lot of terminology floating around. 21 00:01:14,560 --> 00:01:18,220 I do not expect you to memorize anything all this. 22 00:01:18,220 --> 00:01:18,790 Any of this. 23 00:01:18,790 --> 00:01:20,570 You don't have to memorize any of it. 24 00:01:20,590 --> 00:01:25,010 I just want to throw some terms out there and start exposing you to a couple of these ideas. 25 00:01:25,060 --> 00:01:28,700 We are going to actually implement the entire workflow that we're about to discuss in just a moment. 26 00:01:28,790 --> 00:01:33,240 So you'll see a much more in-depth version of all the stuff in the coming videos. 27 00:01:33,250 --> 00:01:34,420 All right so let's get to it. 28 00:01:34,480 --> 00:01:35,370 Here's our diagram. 29 00:01:35,380 --> 00:01:39,430 I'm going to zoom in on a part of it and I'm going to work this thing step by step. 30 00:01:39,430 --> 00:01:43,180 The first part we're gonna take a look at is over here on the left hand side 31 00:01:46,090 --> 00:01:49,180 so this little workflow right here should look really familiar. 32 00:01:49,180 --> 00:01:53,910 We've got some post files or essentially our post service source code. 33 00:01:53,950 --> 00:01:58,750 We took all those files and a docker file and we fed them more or less into Docker. 34 00:01:58,750 --> 00:02:01,740 And now with that came an image for our post service. 35 00:02:01,810 --> 00:02:06,930 We can now create as many instances of this image or containers as we call them as you wish. 36 00:02:07,120 --> 00:02:11,900 The image is really the blueprint for how to create a post container. 37 00:02:11,900 --> 00:02:16,250 Now of course at some point time we're going to want to actually create an instance of this post image 38 00:02:16,340 --> 00:02:18,440 or again a container. 39 00:02:18,650 --> 00:02:24,860 So to do so again zoom out here for just a moment. 40 00:02:24,930 --> 00:02:26,720 This is jumping around just a little bit. 41 00:02:26,730 --> 00:02:30,410 There we go so we've got our image all created. 42 00:02:30,450 --> 00:02:32,220 That's kind of the prerequisite here. 43 00:02:32,450 --> 00:02:37,140 Whenever we want to use cabinets we have to have a set of images that are already ready to go. 44 00:02:37,140 --> 00:02:40,530 So of course we're going to want to actually create a container of this thing at some point in time 45 00:02:40,720 --> 00:02:44,130 and we're going to want to deploy it into our Cuban cities cluster. 46 00:02:44,170 --> 00:02:49,620 Now in the cluster I have kind of drawn out or diagram right here I'm showing three separate notes. 47 00:02:49,770 --> 00:02:52,360 And remember a node is a virtual machine. 48 00:02:52,470 --> 00:02:56,690 It is essentially a computer that's going to run some number of containers for us. 49 00:02:56,730 --> 00:03:00,030 We are currently running Cuban eddies on our own personal computers. 50 00:03:00,080 --> 00:03:05,330 If you're running Cuban ads on your own computer it's extremely likely that you are only running one 51 00:03:05,330 --> 00:03:06,440 node by default. 52 00:03:06,440 --> 00:03:08,380 So you have one virtual machine. 53 00:03:08,630 --> 00:03:13,480 It's only once we start deploying to some cloud provider that we're going to have multiple nodes regardless. 54 00:03:13,550 --> 00:03:19,820 Everything we're about to discuss works identical whether we have one node or 1000 notes it's all the 55 00:03:19,820 --> 00:03:25,080 same I am going to show three nodes on here just to give old more clarity on what is going on behind 56 00:03:25,080 --> 00:03:27,690 the scenes all right. 57 00:03:27,720 --> 00:03:32,970 So to create a container out of image or something out of the post image we are going to first create 58 00:03:33,000 --> 00:03:38,220 a configuration file in this configuration file we're going to list out some very explicit directions 59 00:03:38,220 --> 00:03:44,400 for Cuban net is going to say please create two copies of the poster image for us make containers and 60 00:03:44,400 --> 00:03:48,510 host them somewhere on these notes inside that config file. 61 00:03:48,530 --> 00:03:52,830 We are also going to say please allow these copies of posts to be accessible. 62 00:03:52,880 --> 00:03:57,560 So in other words set up some networking on the on these things allow other containers to get created 63 00:03:57,770 --> 00:04:03,960 among these nodes to access these post services that we're about to create so we're gonna feed that 64 00:04:03,960 --> 00:04:06,520 thing into Cuban net. 65 00:04:06,690 --> 00:04:11,220 We're gonna get that config file into Cuban 80s using that command line tool. 66 00:04:11,220 --> 00:04:13,760 We just wrote out a second ago cube CTO. 67 00:04:13,800 --> 00:04:19,790 That's how we interact with our communities cluster the Cuban 80s cluster is going to read this config 68 00:04:19,790 --> 00:04:22,190 file read over and say OK. 69 00:04:22,220 --> 00:04:28,430 Well I guess I got to create two containers adipose so Cuban eddies is going to look out among the world 70 00:04:28,520 --> 00:04:31,840 and try to find a copy of this post image. 71 00:04:32,020 --> 00:04:37,480 It's going to first take a look at the docker Damon or the docker server running on your personal computer. 72 00:04:37,540 --> 00:04:41,120 So on your computer we have built up that post image already. 73 00:04:41,330 --> 00:04:45,920 So Cuban 80s is going to look at your local machine and see if there is a copy of that image already 74 00:04:45,920 --> 00:04:51,560 available if it is not available then it will default to looking out at Docker Hub and try to find a 75 00:04:51,560 --> 00:04:53,740 copy of that image there instead. 76 00:04:53,780 --> 00:04:59,180 Either way Cuban 80s is going to try to find that image once it finds that image that's going to create 77 00:04:59,240 --> 00:05:05,940 two containers because we asked for two and randomly distributes more or less randomly. 78 00:05:05,940 --> 00:05:11,700 Again there's some science to this distribute those two containers that create get created among these 79 00:05:11,710 --> 00:05:12,150 nodes 80 00:05:15,700 --> 00:05:21,110 so we get to containers like so each container that is created is going to be hosted or essentially 81 00:05:21,110 --> 00:05:26,780 created inside of something called a port for the purposes of this course. 82 00:05:26,780 --> 00:05:29,360 This is really important for the purposes of this course. 83 00:05:29,420 --> 00:05:35,600 You and I are going to be pretty much using the terms pod and container interchangeably pods and containers 84 00:05:35,600 --> 00:05:41,600 and reality are not the same thing but in the context this course it is good enough and I feel pretty 85 00:05:41,600 --> 00:05:42,830 strongly about this. 86 00:05:42,860 --> 00:05:47,270 Now they're not technically the same thing but I feel pretty strongly that we can safely say a pod in 87 00:05:47,270 --> 00:05:50,470 a container is more or less the same thing a pod. 88 00:05:50,480 --> 00:05:54,750 Technically it wraps up a container and technically a pod can have multiple containers inside of it. 89 00:05:54,890 --> 00:05:59,180 But again for the fourth time for the purposes of this course we're going to say a pod and a container 90 00:05:59,210 --> 00:06:04,020 are basically the same thing so we asked for two copies of the post service. 91 00:06:04,210 --> 00:06:09,440 So Cuban Eddie's is going to create two pods each of them is going to have a copy of The Post container 92 00:06:09,470 --> 00:06:10,370 running inside of it 93 00:06:13,240 --> 00:06:18,460 in order to manage these two pods communities is also going to create something called a deployment 94 00:06:19,840 --> 00:06:25,810 this deployment is going to read in this configuration file over here and it's going to say oh OK they 95 00:06:25,810 --> 00:06:28,780 wanted two copies of The Post's image. 96 00:06:28,780 --> 00:06:34,600 So this deployment is going to be in charge of managing both these pots if anything ever goes wrong 97 00:06:34,600 --> 00:06:35,430 with these pods. 98 00:06:35,440 --> 00:06:41,110 So if it crashes for some reason or if it just stops running or whatever else might possibly happen. 99 00:06:41,320 --> 00:06:47,580 This deployment right here is going to make sure that that pod automatically gets recreate it for us. 100 00:06:47,770 --> 00:06:52,330 So the deployment is in charge of making sure that we've always got the right number of pods and that 101 00:06:52,360 --> 00:06:57,460 these pods are running successfully. 102 00:06:57,570 --> 00:07:04,000 It's now second step here in this config file we had also said Please allow us to access these services 103 00:07:04,270 --> 00:07:11,010 from other pods or essentially containers inside of our communities cluster to do so communities is 104 00:07:11,010 --> 00:07:13,800 going to create something else called a service. 105 00:07:13,800 --> 00:07:18,930 Now this is where life starts to get a little bit confusing because hey we are in a course you're talking 106 00:07:18,930 --> 00:07:22,500 about micro services and now we're introducing this thing called a service. 107 00:07:23,340 --> 00:07:28,740 So the term service in the world of Cuban 80s is not like the way that we've been using the word service 108 00:07:28,740 --> 00:07:29,790 throughout this course. 109 00:07:29,790 --> 00:07:32,400 It is not necessarily a running program. 110 00:07:32,430 --> 00:07:36,750 It's not necessarily a running server or a running application server or anything like that. 111 00:07:37,140 --> 00:07:44,820 Instead a server is something that gives us access to running ads or running containers inside of our 112 00:07:44,820 --> 00:07:47,610 cluster. 113 00:07:47,760 --> 00:07:52,820 I'm going to zoom in on this a little bit more right now because we can see it a lot more easily so 114 00:07:52,820 --> 00:07:57,680 the service is what is in charge of kind of abstracting away all of those difficulties we spoke about 115 00:07:57,710 --> 00:08:02,210 a little bit ago in handling networking among different micro services. 116 00:08:02,210 --> 00:08:07,290 You might recall a little bit ago we looked at a diagram right here like this one more or less. 117 00:08:07,370 --> 00:08:08,170 And we said Oh yeah. 118 00:08:08,180 --> 00:08:12,230 You know what this event plus is kind of challenging for us to have the event plus always know how to 119 00:08:12,230 --> 00:08:16,940 reach out to all these different copies of comments that exist and how to know what port to reach out 120 00:08:16,940 --> 00:08:18,570 to as well. 121 00:08:18,590 --> 00:08:23,280 So when we started talking about Cuban cities we introduced this thing down here where we said Oh yeah. 122 00:08:23,300 --> 00:08:27,310 Just send me a request and I will afford it on to the appropriate service. 123 00:08:27,330 --> 00:08:30,130 So that's what person in the appropriate will say container here. 124 00:08:30,140 --> 00:08:32,860 I don't want to overuse the term service moving forward. 125 00:08:32,860 --> 00:08:37,040 And so that's what this service thing is in abstracts away all the difficulties of trying to figure 126 00:08:37,040 --> 00:08:41,700 out what IP or what port some given program is running on. 127 00:08:41,750 --> 00:08:48,800 So if at some point in time in the future we create another pod running say our event bus over here 128 00:08:49,630 --> 00:08:54,440 the event bus to reach out to oppose either of these things right here rather than trying to reach out 129 00:08:54,770 --> 00:08:56,360 to that container directly. 130 00:08:56,420 --> 00:09:01,310 It's going to instead just reach out to this service which will be available at a very easy to know 131 00:09:01,310 --> 00:09:03,550 or easy to understand U.R.L.. 132 00:09:03,710 --> 00:09:08,710 It won't be like local host four thousand five which is of course really challenging to remember. 133 00:09:08,720 --> 00:09:15,050 Instead it will be a very well understood or else something like post serve or postal service something 134 00:09:15,050 --> 00:09:19,880 just very simple very straightforward doesn't really require a lot of difficult memorization. 135 00:09:19,880 --> 00:09:25,640 And so this service thing is going to make it much more easy for us to get from our event bus and reach 136 00:09:25,640 --> 00:09:29,960 on out to our running pods. 137 00:09:30,010 --> 00:09:33,150 So that is our big overview of Cuban cities. 138 00:09:33,260 --> 00:09:36,490 Now at this point this video is running a little bit long so we're can take a quick pause right here. 139 00:09:36,490 --> 00:09:40,870 We'll come back the next video and I just want to kind of highlight a couple of really impedes important 140 00:09:40,870 --> 00:09:42,110 pieces of terminology. 141 00:09:42,190 --> 00:09:45,250 And then as I mentioned we're going to start to implement this exact workflow.