1 00:00:01,000 --> 00:00:05,350 We've built our image and pushed it off to Docker Hub again only required if you're running Docker on 2 00:00:05,350 --> 00:00:06,180 your local machine. 3 00:00:06,190 --> 00:00:09,970 Not if you're running Docker or communities on Google Cloud. 4 00:00:09,970 --> 00:00:10,570 Let's move on. 5 00:00:10,570 --> 00:00:15,990 We're gonna start to write out our Cuban net filed for the deployment and service to run our test service. 6 00:00:16,420 --> 00:00:23,080 Back inside my editor I'm gonna find my infra directory inside the K AIDS folder I'll make a new file 7 00:00:23,080 --> 00:00:31,810 called tickets dash double yellow now inside of here we're gonna write out a very familiar looking deployment 8 00:00:31,840 --> 00:00:33,110 and service config. 9 00:00:33,160 --> 00:00:38,380 So once again rather than doing all this from scratch let's just do a copy paste from our off deployment. 10 00:00:38,380 --> 00:00:42,580 It really is going to be completely identical except wherever we have the word off we're gonna replace 11 00:00:42,580 --> 00:00:46,480 it with the word tickets so I will open up the off deployment file. 12 00:00:46,510 --> 00:00:51,950 I'm going to copy the contents I'll then go over to the newly created tickets depot file. 13 00:00:52,100 --> 00:00:57,240 I'm going to pass this in and I'll go through here every single place I see. 14 00:00:57,370 --> 00:00:59,140 I will replace it with tickets. 15 00:00:59,220 --> 00:01:06,460 I'm going to do one two three or 16 00:01:10,430 --> 00:01:11,920 so five in the deployment section. 17 00:01:11,920 --> 00:01:14,170 Make sure you have updated all those as well. 18 00:01:14,200 --> 00:01:19,180 You'll notice that inside of here we've still got a reference to that environment variable of JWT key. 19 00:01:19,180 --> 00:01:21,130 Do we need this for the ticket service. 20 00:01:21,130 --> 00:01:22,690 Yes absolutely. 21 00:01:22,690 --> 00:01:27,120 Because our ticket service remember it's going to try to handle authentication by itself. 22 00:01:27,220 --> 00:01:31,140 That ticket service is going to need to decide whether or not a request includes a valid Jason Webb 23 00:01:31,210 --> 00:01:36,400 token and we can only validate a token if we have the original key that we create the token with our 24 00:01:36,400 --> 00:01:37,120 ticket service. 25 00:01:37,150 --> 00:01:40,570 Definitely needs the Jason Webb token key. 26 00:01:40,710 --> 00:01:44,250 Now that we've done those five updates up here let's go down to the service itself. 27 00:01:44,550 --> 00:01:50,780 So here's the cluster I.P. service and we will update 1 2 28 00:01:54,890 --> 00:01:56,000 once I've got that all done. 29 00:01:56,000 --> 00:01:59,080 I'll save this file. 30 00:01:59,160 --> 00:01:59,590 All right. 31 00:01:59,620 --> 00:02:00,990 That's pretty much it. 32 00:02:01,060 --> 00:02:04,990 We are done with writing out that Cuban Eddie's deployment file we're now going to move on to updating 33 00:02:05,020 --> 00:02:06,410 our scaffold Yama file. 34 00:02:06,490 --> 00:02:14,830 Again this is all about setting up that file sinking I'll find the scaffold yeah we'll file I'm going 35 00:02:14,830 --> 00:02:21,320 to go down to the bottom let's find how about the auto section right here really off is our template 36 00:02:21,330 --> 00:02:27,510 to be honest if you are gonna copy that and then paste it down at the very bottom. 37 00:02:27,860 --> 00:02:29,210 I'll fix up some indentation 38 00:02:32,890 --> 00:02:35,350 and then I'm going to update off over two tickets 39 00:02:42,440 --> 00:02:46,670 it looks like the source right here can stay the same because we still want to sink everything inside 40 00:02:46,670 --> 00:02:48,500 that s our city directory. 41 00:02:48,500 --> 00:02:51,710 So that should pretty much be it for the scaffold the angel file. 42 00:02:51,710 --> 00:02:54,330 I will save this. 43 00:02:54,520 --> 00:02:58,790 Now the very last thing we have to do let's make sure that we write out the Cuban I.D. file where the 44 00:02:58,790 --> 00:03:02,920 Mongo DB deployment and the cluster I.P. service fought as well. 45 00:03:03,050 --> 00:03:07,850 And guess what do you think we're going to be able to copy the authentication Mongo deployment. 46 00:03:07,850 --> 00:03:09,380 Yes absolutely we can. 47 00:03:09,710 --> 00:03:11,290 It's gonna be 100 percent identical. 48 00:03:12,470 --> 00:03:20,850 So inside the Cade's directory I'll make a new file called tickets Mongo double dot ammo I will open 49 00:03:20,910 --> 00:03:26,130 up the off Mongo deployment file I gonna copy everything inside of here then go back over to the tickets 50 00:03:26,160 --> 00:03:31,680 Mongo deployment file we just created I'll paste everything inside and once again anywhere we see the 51 00:03:31,680 --> 00:03:39,470 word off we'll replace it with tickets so I will do one to three 52 00:03:43,940 --> 00:03:50,850 make sure you've got four updates I'll then go down to my cluster I.P. service and I'm going to do update 53 00:03:51,330 --> 00:03:57,120 1 and 2. 54 00:03:57,880 --> 00:03:59,790 Let's save this and close it out. 55 00:04:00,780 --> 00:04:01,530 Well that is it. 56 00:04:01,530 --> 00:04:03,500 That is how we would normally create a new service. 57 00:04:03,730 --> 00:04:05,760 Well almost exactly how we do it. 58 00:04:05,760 --> 00:04:11,160 Obviously we might not want to do that copy paste of another service because who knows what dependencies 59 00:04:11,160 --> 00:04:16,070 we might be pulling over that we don't actually want or some config or who knows what else. 60 00:04:16,200 --> 00:04:17,520 But at least inside this course. 61 00:04:17,550 --> 00:04:19,270 That's how we're gonna create new service. 62 00:04:19,290 --> 00:04:23,580 The last thing I'm going to do is make sure that I can get scaffold up and running successfully so I 63 00:04:23,580 --> 00:04:27,380 can go back over to my terminal I can find the terminal window running scaffolds. 64 00:04:27,420 --> 00:04:34,500 I would recommend you shut scaffold down entirely and then after closing it do a cube TTL get pods and 65 00:04:34,500 --> 00:04:37,770 make sure that all the different pods actually do get terminated. 66 00:04:37,770 --> 00:04:43,800 It might take a moment or two so we can run the command a couple of times and eventually there we go. 67 00:04:43,800 --> 00:04:45,240 They're all dead. 68 00:04:45,250 --> 00:04:49,010 So then start my scaffold back up with scaffold Dev. 69 00:04:49,030 --> 00:04:52,520 That quick note you might see an air start to appear. 70 00:04:52,530 --> 00:04:58,070 It might be a big red air might say something like it cannot pull image or can't find image your dock 71 00:04:58,060 --> 00:04:59,560 or I.D. slash tickets. 72 00:04:59,700 --> 00:05:02,820 If you see an error like that here's what you should do. 73 00:05:02,880 --> 00:05:09,850 Go back over to your tickets directory rebuild the image manually so inside of tickets rerun that docker 74 00:05:10,330 --> 00:05:18,650 build dash t your Docker I.D. slash tickets dot run that do another doctor push 75 00:05:23,160 --> 00:05:28,620 and then after the push is complete restart scaffold again and hopefully after that the air should be 76 00:05:28,650 --> 00:05:29,830 going away. 77 00:05:29,830 --> 00:05:30,740 So go ahead give that a shot. 78 00:05:30,750 --> 00:05:35,220 Hopefully everything gets up and running and at some point inside a slog there's a lot of information 79 00:05:35,220 --> 00:05:35,550 side of it. 80 00:05:35,550 --> 00:05:40,360 Now we should see something and says tickets depot connected to mongo DB and listening on port three 81 00:05:40,350 --> 00:05:47,050 thousand well looks good for me I do want you to recall we are connecting to mongo DV inside of here. 82 00:05:47,050 --> 00:05:52,550 But remember right now we are connecting to the wrong instance of Mongo DV inside of tickets. 83 00:05:52,580 --> 00:05:59,900 We go back over to our editor find tickets index not to us remember wrong you are L right there. 84 00:05:59,940 --> 00:06:03,200 So we need to make sure that we fix that thing up quick pause right here. 85 00:06:03,210 --> 00:06:04,580 Let's continue in just a moment.