In the last video we made a change to our host file and we put in here whenever we tried to go to post
dot com on our local machine.
Don't go to the real postcard out there on the Internet instead just connect to the local machine.
I just want to throw a quick note out there a quick clarification.
There is nothing special about post dot com being used there or in the host file right here.
We don't have to say post on com just because we are trying to go to a path of posts or a service of
posts or anything like that.
I just thought the domain name post dot com made sense for the application we were building.
This could have just as easily been a host of my dash app dot org if we did that.
We just need to make sure that we update the host file to my app dot org.
Like so the only requirement here is that we've got something consistent inside the host file and inside
of our ingress service config file as well.
The other thing I want to mention is that what we're doing here modifying that post file is really just
appropriate for a development environment.
Once we start to deploy this thing out online we don't have to make any actual changes to any host file
on remote server or anything like that because we will be connecting to the real post dot com which
would hopefully connect us over to our Cuban ease cluster so just a little bit of clarification there.
All right.
Now that we got that out of the way let's continue moving forward on our application.
The next thing we're going to do is start to setup that react app dev server pod.
We need to make sure that inside of that racked up server our actual real code is going to make requests
now to post dot com because that's where in theory our Cuban cities cluster is located.
If we make a request to post dot com or react app is going to attempt to connect to that ingress engine
X let's go into our ReACT app code we're gonna make sure that anytime we made a request to local host
we will change it to be post dot com instead
so inside of my client directory I can open up the source folder and we'll just go through every file
inside of here.
Let's make sure that any time we make a request we make the request to post dot com.
So here's inside of comment create.
I see a post request being made right now to look close to port four thousand one not what we want.
Instead we want post dot com.
So again that's not going to go to the actual post dot com on the Internet.
It's going to be to our local machine.
I think that's it for this file.
I'll move on to comment list.
I don't think we are making any requests inside of comment list so close that file I'll go into index
dot J.S. no requests inside of here I'll go to post create.
Yep looks like we're making a request right here so I would replace local host Colin 4000 with hosts
dot com instead no other requests inside of here.
And so we'll go on to a post list.
Looks like we've got a request right here as well.
We'll change that to post dot com as well.
And no other requests.
So it looks good so now all the code inside very act application is going to try to go to post dot com
again when we're running this react application on our local machine.
Whenever we make that request our local operating system is going to take that post dot com and redirect
the request to our local machine instead where it will be handled by Cuban is now that our ReACT application
is all updated.
We need to create an image out of this thing.
We're going to create the image and then we'll write out a can pick file to make a deployment so we
can actually host this inside of our Cuban cities cluster.
We need to not only make it deployment we need to make sure make a cluster IP as well so that the ingress
engine ex controller can eventually direct traffic to this pod so we can serve out the HCM LC SS and
JavaScript out of it.
OK so let's go back over George terminal.
We're going to change into that client directory and build an image out of the react application so
I'll go back over to client I'll do a docker build dash t my Docker I.D. and I'll call this image client
and then don't forget the dot at the very end.
So there's the image I'll push it up to Docker Hub so Docker push by Docker I.D..
Client
and there we go tonight.
I've pushed that image up.
We're not going to go back over to our.
Ed we're going to start to write out another config file to create a deployment to host this image that
we just put together and a cluster I.P. service to go along with it.
So back inside my info directory I'll find Kate's inside there I'll make a new file called client dash
double dot e-mail the deployment that we're gonna create inside of here is going to be just about identical
to all the other deployments where we put together rather than write all this stuff out from scratch
I'm going to go to the comments depot file I'm going to copy everything inside of there and then paste
it into client
I'll then go through all the copy pasted stuff and I'll update comments to client instead so I will
do five updates right there I'll then go down to the service at the bottom and I'll update three times
I'm an overdue client and then finally remember a create react app application is hosted on port three
thousand I can update those ports like so OK.
Now last step we'll go ahead and apply this thing to our current HD cluster I'm going to change back
over to my infra K AIDS directory and I'll do a cube Seitel apply dash f client dash double dot demo
OK.
That should be at it's now that our ReACT application is running inside of here.
Last thing we have to do this really is the last thing we need to setup all those routing rules we need
to make sure that any time we get an incoming request to that ingress controller it understands where
to route the request off to.
So let's start to write out all those writing rules in the next video.