1 00:00:01,860 --> 00:00:05,370 We've now created a cluster IP service for the event bus and for posts. 2 00:00:05,430 --> 00:00:07,770 Now it's time for us to wire it all up. 3 00:00:07,950 --> 00:00:10,350 But what do I really mean by that step right there. 4 00:00:10,350 --> 00:00:14,670 Well let's go back to our code editor I want to open up our post project once again and I just want 5 00:00:14,670 --> 00:00:17,810 to give you a quick reminder about some code we wrote inside there. 6 00:00:18,000 --> 00:00:23,670 So back inside my editor I will find the post project and the index dot ust file inside and then going 7 00:00:23,670 --> 00:00:29,070 to scroll down a little bit to where we were creating a new post right after we created a post we then 8 00:00:29,070 --> 00:00:35,970 made a request out to our event bus and remember to access our event bus we had to use a U R L of local 9 00:00:35,970 --> 00:00:41,880 host four thousand five this exact you were all right here only worked correctly when we were running 10 00:00:41,940 --> 00:00:47,500 the event bus on our local machine and not inside of say Cuban Eddy's communities right now technically 11 00:00:47,520 --> 00:00:52,590 is on our local machine but you know what I mean we can no longer reach out to local host four thousand 12 00:00:52,590 --> 00:00:58,920 five to get at our event bus we have to replace this URL with some new URL so what is that new you're 13 00:00:58,920 --> 00:01:00,190 all going to be. 14 00:01:00,190 --> 00:01:04,080 Well let's take a look at a diagram that's just going to give you a quick reminder on what our current 15 00:01:04,080 --> 00:01:04,990 setup looks like. 16 00:01:05,580 --> 00:01:06,930 So this is what we are doing right now. 17 00:01:06,930 --> 00:01:12,360 We've got our pod propose pottery pottery bus and we've got a cluster I.P. service for each. 18 00:01:12,360 --> 00:01:18,750 So we need to figure out how we're going to reach over and make a request to this cluster I.P. service 19 00:01:18,990 --> 00:01:24,390 and hopefully that thing will forward the requests on to the event bus that we want to make a request 20 00:01:24,390 --> 00:01:26,580 over to that cluster I.P. service. 21 00:01:26,640 --> 00:01:32,280 What is the URL we are going to type in the URL that we're going to type in is going to be equal to 22 00:01:32,340 --> 00:01:39,760 the name of that cluster I.P. service the exact name of that cluster IP service we can retrieve by going 23 00:01:39,760 --> 00:01:44,040 back over to our terminal and do in a cube Seitel it services. 24 00:01:44,170 --> 00:01:52,890 So the exact name is event butts SRB so if we want to reach out to the event bus SRB service we are 25 00:01:52,890 --> 00:02:00,520 going to make a request to H TTP event bus s RV and that's it. 26 00:02:01,320 --> 00:02:04,770 That's how we reach out from one pod to another service. 27 00:02:04,920 --> 00:02:11,740 We just put in HDP than the exact name of the service we want to reach out to naturally if we are trying 28 00:02:11,740 --> 00:02:13,410 to make a request to a very specific port. 29 00:02:13,420 --> 00:02:15,090 We will add that on as well. 30 00:02:15,160 --> 00:02:18,820 So our event bus service is listening for traffic on port four thousand five. 31 00:02:18,940 --> 00:02:22,720 So we've put on colon four thousand five on the very end as well 32 00:02:27,120 --> 00:02:31,830 the same exact thing is true if our event bus is trying to reach out to the cluster I.P. service that 33 00:02:31,830 --> 00:02:33,760 is pointing at all of our postal pod. 34 00:02:34,380 --> 00:02:42,910 So our service that's governing all those postal pods is post cluster IP SRB but this is both cluster 35 00:02:43,060 --> 00:02:50,300 IP so if you want our event plus to reach out to that service it would make a request to 36 00:02:53,360 --> 00:03:01,470 us cluster IP SRB and then the appropriate port which in this case is four thousand and so that would 37 00:03:01,470 --> 00:03:12,310 be going from over here down to that service that's pretty much it so the takeaway here is that any 38 00:03:12,310 --> 00:03:17,230 time they want to have some communication between pods we're always going to create a cluster IP service 39 00:03:17,230 --> 00:03:22,810 for the pod we're trying to reach out to once we have created that cluster IP service to make a request 40 00:03:22,810 --> 00:03:31,060 to it we're going to write in a URL of each GDP and add the name of the service to back on this diagram 41 00:03:31,060 --> 00:03:35,710 when I said wire it all up I pretty much just mean we need to go around inside of our index dot j ust 42 00:03:35,710 --> 00:03:40,420 file in the post project and any time we tried to reach out to our event bus we need to replace local 43 00:03:40,420 --> 00:03:47,080 host with the name of the service or the event bus and the same is true of our event plus as well if 44 00:03:47,080 --> 00:03:52,390 we open up our event bus indexed dot J.S. file remember inside of here we are trying to make requests 45 00:03:52,510 --> 00:03:57,160 to local host 4000 so rather than putting local host right there we'll put the name of the service that 46 00:03:57,160 --> 00:04:03,440 we are trying to reach out to look let's start making these changes in the next video after we make 47 00:04:03,440 --> 00:04:08,540 these changes will then rebuild our images and update our deployments so that they are running this 48 00:04:08,540 --> 00:04:09,110 new code.