1 00:00:00,860 --> 00:00:05,000 We just put together our first ingress config file but inside of here was a kind of mysterious rule 2 00:00:05,000 --> 00:00:07,230 that said host of post icon. 3 00:00:07,310 --> 00:00:12,070 Let me tell you a little bit more about what is going on inside of here so when we make use of Cuban 4 00:00:12,070 --> 00:00:17,150 eddies we can absolutely just host one single application at one single domain. 5 00:00:17,530 --> 00:00:21,030 But with Cuban eddies Well we can host a ton of infrastructure. 6 00:00:21,030 --> 00:00:24,970 We're not necessarily limited to just hosting one singular application. 7 00:00:24,970 --> 00:00:29,930 So in other words we could host many different apps at many different domains inside of a single Cuban 8 00:00:29,930 --> 00:00:30,690 cities cluster. 9 00:00:30,790 --> 00:00:33,720 We could have some app tied to my outcome. 10 00:00:33,940 --> 00:00:39,430 Another totally different app at post tracker AECOM and yet another at blog app dot com. 11 00:00:39,430 --> 00:00:43,810 The infrastructure for all these different applications that these different domains can be hosted inside 12 00:00:43,810 --> 00:00:50,540 of one single Cuban cities cluster ingress engine X is setup assuming that you might be hosting many 13 00:00:50,540 --> 00:00:52,640 different apps at different domains. 14 00:00:52,640 --> 00:00:55,100 So that's what this host property right here is all about. 15 00:00:55,100 --> 00:01:00,110 We are saying that the config that we're about to write in this little section right here is all tied 16 00:01:00,110 --> 00:01:03,840 to an app posted at post dot com. 17 00:01:03,850 --> 00:01:09,310 Now there's kind of a good side and bad side to this the bad side is that in the development environment 18 00:01:09,640 --> 00:01:14,670 we are used to accessing all of our different running servers at local host. 19 00:01:14,680 --> 00:01:20,260 So how does this kind of routing rule or this idea of having some specific domain really stack up with 20 00:01:20,320 --> 00:01:21,950 ingress engine x. 21 00:01:21,970 --> 00:01:27,310 Well in a development environment what we have to do is trick our local machine into thinking that post 22 00:01:27,310 --> 00:01:30,780 dot com is equivalent to local host. 23 00:01:30,820 --> 00:01:35,320 So in other words whenever we tried to connect to post dot com we're going to trick our computer to 24 00:01:35,320 --> 00:01:40,930 connecting to our local machine rather than the real post dot com that I'm sure exists out there somewhere 25 00:01:40,930 --> 00:01:41,500 online. 26 00:01:42,520 --> 00:01:48,070 To trick our local machine into connecting to local host whenever we go to post dot com we're going 27 00:01:48,070 --> 00:01:55,560 to make a little configuration change on your computer to your host file your host file which is available 28 00:01:55,560 --> 00:02:01,170 on Windows and Mac OS or Linux is where we can set up a series of additional little routing rules and 29 00:02:01,170 --> 00:02:06,530 we can say anytime they tried to go to post dot com instead just connect to our local machine. 30 00:02:06,720 --> 00:02:12,840 Again this is going to somehow trick or make ingress engine X think that we are coming to it from post 31 00:02:12,840 --> 00:02:17,730 dot com and it's going to apply all the routing rules that are shown in this section right here. 32 00:02:17,730 --> 00:02:23,370 Long story short we just tapped out in one line of config to this file different file location depending 33 00:02:23,370 --> 00:02:24,750 upon your operating system. 34 00:02:24,750 --> 00:02:26,150 That's the long and short of it. 35 00:02:26,250 --> 00:02:32,160 So let's get to it now naturally I'm on MAKO s so I'm going to open up my etsy slash hosts file. 36 00:02:32,160 --> 00:02:34,490 That is not a directory that's a file inside my code. 37 00:02:34,490 --> 00:02:40,740 Ed if you're on Windows you will open up that file instead it's going to do that right now. 38 00:02:43,100 --> 00:02:44,840 And here's my host file. 39 00:02:44,840 --> 00:02:46,610 Yours will probably look very similar to this. 40 00:02:46,610 --> 00:02:50,780 Maybe I'll have a couple extra lines in here at the very bottom of this file. 41 00:02:50,810 --> 00:02:56,180 I'm going to add in 1 2 7 0 0 1 and then post scum. 42 00:02:56,180 --> 00:02:58,310 Notice there is a space in between. 43 00:02:58,310 --> 00:03:03,620 Very important if you are on many cube if you're making use a mini cube you are not going to write in 44 00:03:03,680 --> 00:03:05,720 1 2 7 0 0 1 right here. 45 00:03:05,750 --> 00:03:10,550 Instead you will write in whatever the result of many cube IP is. 46 00:03:10,550 --> 00:03:15,110 So if you're on many cube or making use of it run this command take the IP that gets printed up right 47 00:03:15,110 --> 00:03:20,100 there and put it right there instead of 1 2 7 0 0 1. 48 00:03:20,110 --> 00:03:26,380 So now whenever we tried to connect to post dot com your operating system is going to say oh rather 49 00:03:26,380 --> 00:03:30,760 than going to the real post dot com somewhere out on the Internet I'm going to instead connect to the 50 00:03:30,820 --> 00:03:36,410 local machine me right here at 1 2 7 0 0 1 OK. 51 00:03:36,490 --> 00:03:38,470 After making that change I can save the file. 52 00:03:38,470 --> 00:03:42,790 Chances are you're going to see some kind of permission warning if you're on Windows you're probably 53 00:03:42,790 --> 00:03:48,670 going to need to open up your code editor again in administration mode if you're on Mac OS you can make 54 00:03:48,680 --> 00:03:51,650 use of visual studio code you can just hit that little button right there. 55 00:03:51,830 --> 00:03:52,790 Putting your password. 56 00:03:52,780 --> 00:03:53,580 Andrew good to go. 57 00:03:53,590 --> 00:03:57,020 File saved OK. 58 00:03:57,230 --> 00:04:03,590 So now inside of our browser or postman whatever else if we go to post dot com we are going to be actually 59 00:04:03,590 --> 00:04:06,320 make a request to 1 2 7 0 0 1. 60 00:04:06,350 --> 00:04:13,170 That request is going to go into ingress serve it's going ingress engine X is going to think that we 61 00:04:13,170 --> 00:04:14,940 are trying to visit post dot com. 62 00:04:15,120 --> 00:04:20,010 And so it's going to apply the routing rules you see right here. 63 00:04:20,010 --> 00:04:24,180 All right so let's go back over to our browser and we're going to test this out inside of a new browser 64 00:04:24,180 --> 00:04:29,830 tab we are going to navigate to post dot com slash posts that should. 65 00:04:30,060 --> 00:04:36,420 Behind the scenes make a request to our post cluster I.P. service which actually makes requests to our 66 00:04:36,420 --> 00:04:42,630 post pod and you and I know if by going into our post indexed such as file if we make a get request 67 00:04:42,630 --> 00:04:47,580 to slash posts that should send us back all the different posts we have created inside the service. 68 00:04:47,670 --> 00:04:49,580 So let's try navigating to that right now. 69 00:04:49,680 --> 00:04:50,790 And there we go. 70 00:04:50,790 --> 00:04:57,050 I've got my list of posts yay this is great. 71 00:04:57,050 --> 00:04:59,210 We've now got our list of posts right here. 72 00:04:59,210 --> 00:05:05,570 We are able to access some pod and most importantly we didn't have to reach out directly to this part 73 00:05:05,620 --> 00:05:10,430 in the words I didn't have to type in some you l that says go to my post pod instead I put in just a 74 00:05:10,430 --> 00:05:15,650 very normal your l and behind the scenes ingress engine X is going to take this request and route it 75 00:05:15,710 --> 00:05:21,730 off to the appropriate service and that service in turn is going to read it off to the appropriate pod. 76 00:05:21,870 --> 00:05:23,520 So hopefully everything's working for you. 77 00:05:23,880 --> 00:05:28,470 There's definitely many locations throughout all this stuff where things can go wrong if you're running 78 00:05:28,470 --> 00:05:29,030 into trouble. 79 00:05:29,040 --> 00:05:31,470 Remember try doing a little bit troubleshooting on your own. 80 00:05:31,530 --> 00:05:34,050 Google is a great tool great friend to have around. 81 00:05:34,530 --> 00:05:38,490 But if you still can't get it always feel free to hop over to the Q A Discussion Board and I'll do my 82 00:05:38,490 --> 00:05:39,200 best to help you out. 83 00:05:39,230 --> 00:05:42,360 But do remember if you have a problem I really need to see your code. 84 00:05:42,390 --> 00:05:49,530 So do toss your code on it hub first Well we've now proven that we can get access to a pod. 85 00:05:49,690 --> 00:05:56,810 So now we have to go back through all of our different services whereas our diagram here we go. 86 00:05:56,810 --> 00:05:59,870 We need to go back through all of our different services all these different pods. 87 00:05:59,870 --> 00:06:04,220 We need to add in some routing rules to that ingress engine next config file. 88 00:06:04,400 --> 00:06:08,990 And we also need to make sure that at some point time we also create a deployment for a react app as 89 00:06:08,990 --> 00:06:09,710 well. 90 00:06:09,740 --> 00:06:13,560 But still just a little bit left but we are definitely almost at the end here. 91 00:06:13,590 --> 00:06:15,590 It's a quick pause and we'll continue in just a minute.