1 00:00:00,760 --> 00:00:05,970 We have now created a ingress controller through ingress and connects inside of our cluster. 2 00:00:05,980 --> 00:00:10,660 Now we need to teach the thing a couple of routing rules and tell it how to take incoming requests and 3 00:00:10,660 --> 00:00:13,030 send them off to some appropriate pods. 4 00:00:13,030 --> 00:00:17,520 We're going to do that by writing a config file that's going to contain some router rules. 5 00:00:17,550 --> 00:00:22,420 We will then be that into our cluster where it will be automatically discovered by the ingress controller. 6 00:00:22,420 --> 00:00:27,010 The ingress controllers then going to update its own internal set of routing rules to match the ones 7 00:00:27,010 --> 00:00:28,160 we just gave it. 8 00:00:28,210 --> 00:00:32,420 So let's create this config file back inside my editor. 9 00:00:32,710 --> 00:00:38,280 I'm going to find my k aides directory and inside there I'll make a new file called Ingress dash SRB 10 00:00:38,550 --> 00:00:44,770 that e-mail inside of here we're going to write out some more config similar nature to a lot of the 11 00:00:44,770 --> 00:00:46,540 config we've already put together. 12 00:00:46,650 --> 00:00:49,930 I'm going to first start off with an API version once again. 13 00:00:49,930 --> 00:00:53,670 This one is very different than the API versions we've used previously. 14 00:00:53,680 --> 00:01:04,550 I'm gonna put in networking that Kate's Io flash V1 Beta 1 I'll then put in a kind of ingress we'll 15 00:01:04,550 --> 00:01:12,800 have some metadata I'm going to give this thing a name of ingress SRB and then this next one is really 16 00:01:12,800 --> 00:01:13,330 important. 17 00:01:13,330 --> 00:01:24,040 We're gonna put in annotations and inside their Cuban net is that Io flash ingress dot class of engine 18 00:01:24,040 --> 00:01:30,130 X this entire annotation section is what's going to help the ingress controller understand that we are 19 00:01:30,130 --> 00:01:35,890 trying to feed it some routing rules so the ingress controller is going to continuously scan all the 20 00:01:35,890 --> 00:01:40,150 different objects or all the different config files so we're throwing into our cluster and it's going 21 00:01:40,150 --> 00:01:45,580 to try to find one that has this exact annotation right here when it finds this the ingress controller 22 00:01:45,580 --> 00:01:51,250 is gonna say oh this must thing how this thing must have some routing rules for me really quickly make 23 00:01:51,250 --> 00:01:56,440 sure you've got the correct spelling on annotations and Cuban Eddie's lot of easy places to make typos 24 00:01:56,470 --> 00:01:58,650 inside of your. 25 00:01:58,830 --> 00:02:04,790 Next up we're going to put our spec together inside a spec we'll have rules rules is going to have all 26 00:02:04,790 --> 00:02:10,040 the different routing rules that we want to apply to teach the ingress controller how to take incoming 27 00:02:10,040 --> 00:02:16,350 traffic and root them up to our different pots rules is going to be an array and as we've seen many 28 00:02:16,350 --> 00:02:22,780 times to designate an array entry in Yemen we'll put in a single dash like so well then write in a host 29 00:02:22,870 --> 00:02:27,400 of hosts dot com that is to make any sense just yet totally fine. 30 00:02:27,400 --> 00:02:34,720 Just bear with me for a moment we're then going to write an H GDP that's another array entries so a 31 00:02:34,720 --> 00:02:40,120 dash right there and the first routing rule that we're gonna set up is going to take incoming traffic 32 00:02:40,330 --> 00:02:42,910 and send it off to our postal service. 33 00:02:43,120 --> 00:02:47,400 So as a quick reminder if we open up our post micro service right here and take a look at the index 34 00:02:47,400 --> 00:02:53,100 dot J.S. file we expect to get traffic on the incoming routes of slash posts. 35 00:02:53,590 --> 00:02:58,330 So we're going to make sure that if any request is coming into our application with a path of slash 36 00:02:58,330 --> 00:03:03,390 post we're going to send it off to our post micros service to do so. 37 00:03:03,400 --> 00:03:06,220 We're not going to send it directly to the post pod or anything like that. 38 00:03:06,220 --> 00:03:12,370 Instead we're gonna send it to the post cluster IP service because remember these cluster IP services 39 00:03:12,370 --> 00:03:16,330 are how we communicate between different things inside of our cluster. 40 00:03:16,330 --> 00:03:26,720 So to implement all that we're going to write out path of flash posts then backend service name is post 41 00:03:26,780 --> 00:03:32,450 cluster IP a service or SRB and then the ports on that service. 42 00:03:32,540 --> 00:03:38,180 So service port of four thousand and remember it is four thousand because that's what we had designated 43 00:03:38,450 --> 00:03:45,630 back inside our post double right here or out of 4000 okay. 44 00:03:45,650 --> 00:03:47,450 So that is our first routing rule. 45 00:03:47,540 --> 00:03:50,980 Now we even really discuss what is going on with this post dot com thing right there. 46 00:03:51,050 --> 00:03:56,680 But right now let's just save this and then go back over to our terminal and we're going to apply that 47 00:03:56,680 --> 00:04:01,690 config file between the last video on this one already change back into my k aides directory make sure 48 00:04:01,690 --> 00:04:02,690 you do the same. 49 00:04:02,980 --> 00:04:10,540 And then we will apply the ingress SRB file though cube Seitel apply a dash f ingress SRB dot yellow 50 00:04:12,400 --> 00:04:16,870 for me it says unchanged because I did a quick test right before this video for you hopefully you will 51 00:04:16,870 --> 00:04:22,870 see something it says created if you see any errors right now chances are that something went wrong 52 00:04:22,930 --> 00:04:28,120 during the initial setup process in the last video or most likely you might it made a typo inside this 53 00:04:28,120 --> 00:04:35,120 file OK so we've now applied this config file and in theory we have updated configuration of this ingress 54 00:04:35,120 --> 00:04:36,050 controller. 55 00:04:36,050 --> 00:04:38,060 But how do we actually test this out. 56 00:04:38,060 --> 00:04:42,020 Well a lot of this comes back to this post property right here. 57 00:04:42,020 --> 00:04:46,070 Let's take a quick pause right here and tell you a little bit more about this property and what it's 58 00:04:46,070 --> 00:04:47,080 really doing for us.