I have now installed dependencies and built an image out of this start to the order service.
I'm not going to create a Cuban 80s deployment file so back inside my editor I will find my infra directory
inside of that often case and then I'll make a new file inside there are called orders dash double dot
ammo just about everything inside of here is going to be identical in nature to our ticket's deployment
so I going to go over to the ticket's deployment file I'm going to copy everything inside of here go
over to the New Order supplement file and paste everything in I'm now inside of orders deployment we're
going to go through here and update tickets over two orders instead I'll put in orders orders orders
orders on the image name right here I'll change that to my doctor I d slash orders and as a reminder
if you are running your cluster on Google Cloud you are not going to put in an image right here with
this format.
Instead you'll put in that GC R dot Io slash your project ideas slash orders make sure you get the correct
thing inside there we then are listing out a couple of environment variables.
So these are all going to stay the same.
We definitely want to have the same kind of source for our Nat's clan I.D. the same that's your l the
same cluster I.D. We want to have the same J somewhat token key however we do not want our order service
to connect to the Mongo DB instance it was intended for the ticket service so we do need to eventually
make sure we create a new Mongo DB instance for our order stuff we have not created that yet we will
in just a moment but right now let's just go ahead and update the URL right here assuming that we eventually
will have a order service specific Mongo TB instance.
So I'm going to update the model you or I to mongo DV orders Mongo served slash orders at the end
guy that looks good I'll then go down to the very bottom to file I'm going to find tickets on here listed
three times and I'll update all three those over two orders so at this point I should be able to do
a find inside of this file search for tickets and not see the word tickets anywhere inside of here once
I've got that all put together I'm going to save this file then inside of case I'm going to create another
new file called orders dash Mongo dash step all not yellow.
So this is where we're we'll create our Mongo DB instance specifically for the order service going to
once again open up the tickets Mongo deployment file the year tickets Mongo deployment I'm going to
copy everything inside of here go over to the brand new orders Mongo Mongo deployment file and paste
everything in now once again we will go through here.
UPDATE The word tickets over two orders so I will find once twice three times four times I can make
sure that I see orders four times inside of the deployment config I'll then go down to the bottom and
down here.
I'm going to update this to orders and orders.
Now once again inside of here I should be to do a find for the word tickets and get no results whatsoever
once I've confirmed that I'll go ahead and say this file and that should be it.
So we now go back over to a terminal window running scaffold after saving those two files.
I should see some information site here about creating the orders Mongo deployment about creating the
orders Mongo service and I should probably somewhere inside of here also see something about creating
the order supplement and the order service.
Now if you see any errors inside of you're right now around creating orders or running the container
or anything like that or if you do not see any console logs or anything from the orders service as I
do and definitely do not write here I don't see anything inside of here about building or running the
order service.
That is tell you OK after we go through all the setup we're going to restart scaffold and make sure
that everything comes up online successfully.
So if you getting any air some scaffold right now just don't sweat it.
That's the Bakari here.
We're not gonna make sure we set up some files sync stuff inside of our scaffold the ammo file and we'll
go ahead and take care of those routing rules.
Let's take care of that scaffold the ammo file first.
So back inside my editor inside my route project directory here a scaffold Dudamel
I'm going to scroll down to the very end of this list I'm going to take the last entry which was where
our ticket service once again just go ahead and copy paste it picks up the indentation so I've now got
the original ticket service block and then the new one right here we're going to update the image name
to orders and the context orders and once again remember if you were running on Google Cloud this image
name right here should be the GC R dot Io slash project D slash orders and we can leave everything else
inside here except in the context the same.
So we should have an image of orders context of orders and then the docker section and sync sections
should remain the same can't sell looks pretty good.
I'll save this now let's go ahead and finally tried to restart scaffolds and after this hopefully we
can see something start up.
I am definitely going to expect there to be a in air once the pod starts up because inside the order
service once again we've got a lot of stuff inside of here with some broken import statements for example
inside the orders app.
Yes there are still import statements for some root handlers that do not exist.
So I will expect to eventually see an error when the pod starts to run but I do not want to see an error
around just plain starting up the container or building that pod or something like that I'll go back
over my terminal I'm going to stop everything with the control see
I'll then restart all of it with a scaffold dev and you might want to wait or the get pods command to
show everything emptying out.
So when I print everything out looks like everything has already been terminated so I should now be
able to do a scaffold
and there we go.
All right.
So I'm getting a lot of logs right here.
I did successfully see something about the order service starting up very good but then very shortly
after that I got an error around finding a module inside the error order service.
So if you see this area here that is good we want to see this because this is truly a broken import
statement that we need to fix.
If you see something that says I don't have it inside my log anymore but if you see something it says
cannot build image or cannot find the image or something like that.
That means that there is probably a little issue if you see something that says cannot build this orders
image or cannot retrieve it cannot find it then the best thing to do is to try to rebuild the image
and then restart scaffold once again.
All right.
So let's take a pause right here.
When we come back the next video we're going to discuss in the different routing rules that we're going
to want to add to our ingress service file and then after that we can start to work on the order service
in earnest.