1 00:00:00,860 --> 00:00:04,990 The last video we discussed how we're going to add in this new event bus pod and then a cluster I.P. 2 00:00:05,000 --> 00:00:07,770 service or both posts and event bus. 3 00:00:07,790 --> 00:00:12,020 I know a lot of this stuff probably seems pretty crazy right now but I got some good news for you as 4 00:00:12,020 --> 00:00:13,040 soon as we get through this. 5 00:00:13,050 --> 00:00:17,510 The one last hurdle we're going to start to take a look at a tool that is going to automate wiring up 6 00:00:17,570 --> 00:00:18,770 a lot of the stuff for us. 7 00:00:19,090 --> 00:00:21,230 So it's gonna make life a lot easier. 8 00:00:21,230 --> 00:00:25,070 You do have to go through all the stuff at least once by hand out just so you really understand what 9 00:00:25,070 --> 00:00:27,360 is going on behind the scenes. 10 00:00:27,380 --> 00:00:27,830 All right. 11 00:00:28,010 --> 00:00:29,920 So we have to go through a couple of different steps. 12 00:00:29,920 --> 00:00:34,310 And so just to make sure that everything is crystal clear put together a quick diagram to understand 13 00:00:34,340 --> 00:00:39,690 the steps are about to go through to get the event plus and post working together that the first thing 14 00:00:39,690 --> 00:00:47,200 we'll do is create an image for the event bus will then push that image up to Docker Hub will then create 15 00:00:47,230 --> 00:00:53,410 a deployment or the event plus that deployment is going to create one pod for us automatically. 16 00:00:53,410 --> 00:00:59,780 And that pod is going to be this thing right here after that pod comes into it exists existence. 17 00:01:00,020 --> 00:01:04,520 We will then create a cluster I.P. service for the event bus and for posts. 18 00:01:04,710 --> 00:01:06,900 And so that's going to be that thing and that thing. 19 00:01:06,900 --> 00:01:12,150 And again these cluster IP services are going to teach these pods how to access each other inside the 20 00:01:12,150 --> 00:01:18,760 cluster after that we're gonna do just one last additional little step to wire this stuff up altogether 21 00:01:19,920 --> 00:01:21,970 so let's get started with step number one right now. 22 00:01:21,990 --> 00:01:27,120 We're going to build an image for the event bus to get started going to flip back over to my terminal 23 00:01:28,850 --> 00:01:34,110 I'm going to change into my event bus directory and inside there I'll build a new image. 24 00:01:34,230 --> 00:01:42,070 So we'll do a docker build dash t even greater event dash bus and then don't forget the dot at the very 25 00:01:42,070 --> 00:01:47,210 end that indicates we want to use the current working directory where all the source code inside the 26 00:01:47,210 --> 00:01:49,600 image so we'll run that. 27 00:01:49,650 --> 00:01:54,440 And as you'll see that image gets built very very quickly okay. 28 00:01:54,480 --> 00:01:57,230 That's step number one step number two. 29 00:01:57,240 --> 00:02:01,410 We're going to push that image off to Docker Hub so that the deployment can very easily pull down that 30 00:02:01,440 --> 00:02:07,180 image when it decides that it's time to create the pod to back inside the event plus directory. 31 00:02:07,190 --> 00:02:15,940 We'll do a docker push your Docker I.D. slash event dash bus that's going to take the image that we 32 00:02:15,940 --> 00:02:19,790 just built and throw it up to Docker Hub. 33 00:02:19,830 --> 00:02:20,770 It's a pretty small image. 34 00:02:20,790 --> 00:02:24,420 So it'll just take a little minute or two. 35 00:02:24,660 --> 00:02:26,360 All right after that's all done. 36 00:02:26,420 --> 00:02:31,070 We're then going to create a deployment for the event plus the deployment that we're going to create 37 00:02:31,160 --> 00:02:35,390 is gonna be just about identical in nature to the post deployment that we already put together. 38 00:02:35,440 --> 00:02:39,590 So really just going to copy paste all that configuration we already wrote out here is going to change 39 00:02:39,590 --> 00:02:45,550 one or two names to refer to event bus as opposed to post to create the deployment itself. 40 00:02:45,550 --> 00:02:51,630 Don't forget we're always going to create a config file to back inside my editor. 41 00:02:51,780 --> 00:02:54,120 I'm going to find that in Fred directory. 42 00:02:54,120 --> 00:02:57,230 Inside there is chaos inside of chaos. 43 00:02:57,240 --> 00:03:02,340 I'll make a new directory called event dash bus dash devil not yellow 44 00:03:05,300 --> 00:03:09,150 0 then open up the post deployment file because I'm not kidding. 45 00:03:09,150 --> 00:03:13,900 We're really just going to copy paste all this stuff inside of the post deployment file I'm going to 46 00:03:13,900 --> 00:03:22,660 copy everything go back over to the event plus deployment file and paste I'm not going to go through 47 00:03:22,780 --> 00:03:28,640 and everywhere that I see the word posts I'm going to replace it with event bus so here's number one 48 00:03:28,640 --> 00:03:29,280 right here. 49 00:03:31,790 --> 00:03:35,910 Here's to here's three 50 00:03:38,600 --> 00:03:41,730 or and five. 51 00:03:43,790 --> 00:03:49,980 Inside of the event bus deployment file I should now be able to do a find I'll look for posts and I 52 00:03:49,980 --> 00:03:51,800 should have zero results. 53 00:03:51,960 --> 00:04:00,450 So make sure you replaced every instance of posts with event plus instead of then save the file and 54 00:04:00,510 --> 00:04:07,700 we'll go ahead and apply this configuration file to Cuban net is using cubes TTL so back at my terminal 55 00:04:08,980 --> 00:04:11,430 it looks like I've finished pushing up the event plus image. 56 00:04:11,440 --> 00:04:12,970 That's great. 57 00:04:13,080 --> 00:04:20,520 I'm going to change back over to my key aides directory and inside there I've got my event plus deployment 58 00:04:20,520 --> 00:04:22,140 file that we just created. 59 00:04:22,140 --> 00:04:24,430 So we'll do a cube TTL. 60 00:04:24,540 --> 00:04:34,410 Apply dash f event plus double dot demo. 61 00:04:34,520 --> 00:04:39,550 So looks like we've got the deployment created and that should automatically create the pod for us. 62 00:04:39,680 --> 00:04:43,340 Let's just list out all of our different pods and make sure that it actually was created. 63 00:04:43,340 --> 00:04:44,310 I'll do a cube GTL. 64 00:04:44,330 --> 00:04:49,430 Get pods and sure enough there's my event bus board right there. 65 00:04:49,430 --> 00:04:51,270 So looks like it is up and running. 66 00:04:52,800 --> 00:04:55,230 It's all the look that looks great right now. 67 00:04:55,230 --> 00:05:00,720 We have no effective way to really have any communication between this event plus pod and the Post pod 68 00:05:01,250 --> 00:05:06,120 and so that is why we need to come back and add in these cluster IP services. 69 00:05:06,270 --> 00:05:11,760 Again they technically can communicate but the IP address assigned to these pods is variable and we 70 00:05:11,760 --> 00:05:14,110 can't really predict it ahead of time. 71 00:05:14,190 --> 00:05:17,120 The cluster IP services are going to give us a well known. 72 00:05:17,130 --> 00:05:18,810 Very easy to predict. 73 00:05:18,840 --> 00:05:23,790 You are all that we can type in anytime we want to have our event bus communicate over the posts or 74 00:05:23,790 --> 00:05:28,710 anytime we want post to communicate over to event bus let's take a quick pause right here. 75 00:05:28,730 --> 00:05:33,620 When we come back the next video we're going to create a cluster IP service for posts and one for event 76 00:05:33,620 --> 00:05:34,400 plus as well.