We have now created a ingress controller through ingress and connects inside of our cluster.
Now we need to teach the thing a couple of routing rules and tell it how to take incoming requests and
send them off to some appropriate pods.
We're going to do that by writing a config file that's going to contain some router rules.
We will then be that into our cluster where it will be automatically discovered by the ingress controller.
The ingress controllers then going to update its own internal set of routing rules to match the ones
we just gave it.
So let's create this config file back inside my editor.
I'm going to find my k aides directory and inside there I'll make a new file called Ingress dash SRB
that e-mail inside of here we're going to write out some more config similar nature to a lot of the
config we've already put together.
I'm going to first start off with an API version once again.
This one is very different than the API versions we've used previously.
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
have some metadata I'm going to give this thing a name of ingress SRB and then this next one is really
important.
We're gonna put in annotations and inside their Cuban net is that Io flash ingress dot class of engine
X this entire annotation section is what's going to help the ingress controller understand that we are
trying to feed it some routing rules so the ingress controller is going to continuously scan all the
different objects or all the different config files so we're throwing into our cluster and it's going
to try to find one that has this exact annotation right here when it finds this the ingress controller
is gonna say oh this must thing how this thing must have some routing rules for me really quickly make
sure you've got the correct spelling on annotations and Cuban Eddie's lot of easy places to make typos
inside of your.
Next up we're going to put our spec together inside a spec we'll have rules rules is going to have all
the different routing rules that we want to apply to teach the ingress controller how to take incoming
traffic and root them up to our different pots rules is going to be an array and as we've seen many
times to designate an array entry in Yemen we'll put in a single dash like so well then write in a host
of hosts dot com that is to make any sense just yet totally fine.
Just bear with me for a moment we're then going to write an H GDP that's another array entries so a
dash right there and the first routing rule that we're gonna set up is going to take incoming traffic
and send it off to our postal service.
So as a quick reminder if we open up our post micro service right here and take a look at the index
dot J.S. file we expect to get traffic on the incoming routes of slash posts.
So we're going to make sure that if any request is coming into our application with a path of slash
post we're going to send it off to our post micros service to do so.
We're not going to send it directly to the post pod or anything like that.
Instead we're gonna send it to the post cluster IP service because remember these cluster IP services
are how we communicate between different things inside of our cluster.
So to implement all that we're going to write out path of flash posts then backend service name is post
cluster IP a service or SRB and then the ports on that service.
So service port of four thousand and remember it is four thousand because that's what we had designated
back inside our post double right here or out of 4000 okay.
So that is our first routing rule.
Now we even really discuss what is going on with this post dot com thing right there.
But right now let's just save this and then go back over to our terminal and we're going to apply that
config file between the last video on this one already change back into my k aides directory make sure
you do the same.
And then we will apply the ingress SRB file though cube Seitel apply a dash f ingress SRB dot yellow
for me it says unchanged because I did a quick test right before this video for you hopefully you will
see something it says created if you see any errors right now chances are that something went wrong
during the initial setup process in the last video or most likely you might it made a typo inside this
file OK so we've now applied this config file and in theory we have updated configuration of this ingress
controller.
But how do we actually test this out.
Well a lot of this comes back to this post property right here.
Let's take a quick pause right here and tell you a little bit more about this property and what it's
really doing for us.