1 00:00:00,920 --> 00:00:04,090 We've got a good start to our exploration service now in this video. 2 00:00:04,100 --> 00:00:07,210 We're going to create a Docker image out of this project. 3 00:00:07,280 --> 00:00:11,750 We're going to push that image off to a Docker Hub will then create a couple of different Trinity's 4 00:00:11,780 --> 00:00:16,880 config files to make sure we load this thing up as a deployment into our cluster and also create an 5 00:00:16,880 --> 00:00:20,270 instance of the readies in memory database as well. 6 00:00:20,270 --> 00:00:21,720 That's a lot of fancy terminology. 7 00:00:21,740 --> 00:00:23,180 So let's just start writing some code. 8 00:00:23,960 --> 00:00:24,250 All right. 9 00:00:24,260 --> 00:00:27,060 So back to my terminal again inside of exploration. 10 00:00:27,190 --> 00:00:30,340 Well first build a Docker image with docker build. 11 00:00:30,420 --> 00:00:35,170 I'm going to target with mock my Docker I.D. slash expiration. 12 00:00:35,180 --> 00:00:41,290 And then don't forget the dot on the variant that will take just a moment or two. 13 00:00:41,300 --> 00:00:44,930 So I'm just gonna let it do this thing and then once that is all complete once again we're gonna make 14 00:00:44,930 --> 00:00:50,740 sure we push this off to Docker Hub image build is all complete. 15 00:00:51,050 --> 00:00:59,040 So after that is all done I'll do a docker push my Docker I.D. flash expiration that's going to take 16 00:00:59,040 --> 00:01:00,300 a moment or two to push off. 17 00:01:00,300 --> 00:01:03,480 So while that's occurring I can go back over to my editor. 18 00:01:03,570 --> 00:01:07,760 We're going to find our infra directory inside there is chaos. 19 00:01:07,770 --> 00:01:13,920 And once again we're going to create a config file or expiration and create a separate one for our reddest 20 00:01:14,010 --> 00:01:15,390 instance as well. 21 00:01:15,390 --> 00:01:17,470 We'll start off with the reddest instance. 22 00:01:17,820 --> 00:01:19,500 Now all the setup for this red is stuff. 23 00:01:19,530 --> 00:01:23,790 Even if you're not familiar threats it really is going to be just about identical to what we did for 24 00:01:23,790 --> 00:01:25,710 the Mongo deployments. 25 00:01:25,710 --> 00:01:32,940 So inside of Kate's I'm gonna make a new file of expiration dash reddest dash devil dot emo 26 00:01:35,990 --> 00:01:41,040 and then going to go into any of the different Mongo DB deployment files. 27 00:01:41,060 --> 00:01:46,300 It's gonna copy everything inside their and take it over to the new readies deployment file that we 28 00:01:46,300 --> 00:01:49,650 just created will then go through this thing. 29 00:01:49,660 --> 00:01:55,350 So inside of expiration reddest Ash devil and we'll change a couple of different properties first we'll 30 00:01:55,350 --> 00:02:02,790 change the name so instead of off Mongo deployment we're gonna change that once twice three times four 31 00:02:02,790 --> 00:02:06,250 times over to expiration Dash. 32 00:02:06,280 --> 00:02:14,430 Red is to make sure you now see four times in a row expiration dash Rectus inside of our listing of 33 00:02:14,430 --> 00:02:15,560 containers. 34 00:02:15,580 --> 00:02:18,300 Naturally we do not want to run a mongo DB. 35 00:02:18,300 --> 00:02:22,490 Instead we want to run a copy of Red as well just replace it with the image. 36 00:02:22,510 --> 00:02:25,840 Red is this is an actual name of an image. 37 00:02:25,850 --> 00:02:30,410 And if you wanted to you could hop over to Docker Hub let's just do it for fun really quickly though 38 00:02:30,500 --> 00:02:30,710 hub. 39 00:02:30,730 --> 00:02:38,680 Dot dot dot dot com and we can do a quick search or read this and that is the image that we are specifying 40 00:02:42,170 --> 00:02:43,760 now to connect to that redis instance. 41 00:02:43,760 --> 00:02:46,370 We do still need to have a cluster IP service. 42 00:02:46,370 --> 00:02:52,160 So we'll go down just a little bit and we'll change the name of this service from off Mongo service 43 00:02:52,190 --> 00:02:54,540 over to expiration. 44 00:02:54,550 --> 00:02:59,830 Dash readies SRB and we'll update that selector as well to expiration. 45 00:02:59,840 --> 00:03:00,350 Read us 46 00:03:05,150 --> 00:03:11,030 well then update the port to port twenty seven 0 1 7 as a port used by Mongo DV reticent steady uses 47 00:03:11,030 --> 00:03:22,280 by default port 6 3 7 9 so we'll update both these 2 6 3 7 9 and 6 3 7 9 OK so that is it for our readies 48 00:03:22,300 --> 00:03:23,100 deployment file. 49 00:03:23,130 --> 00:03:23,360 Yep. 50 00:03:23,380 --> 00:03:24,570 Not the worst thing in the world. 51 00:03:24,630 --> 00:03:27,750 Naturally this is a very simplistic deployment of red. 52 00:03:27,790 --> 00:03:30,190 There's definitely many more options we could throw in here. 53 00:03:30,280 --> 00:03:34,690 But right now as we're just getting started with this expiration service this is good enough. 54 00:03:34,770 --> 00:03:44,210 It's going to save this post about and will create a second config file and we'll name this one expiration 55 00:03:45,340 --> 00:03:51,540 dash devil dot demo and as you could guess we're gonna throw our deployment for the actual image inside 56 00:03:51,540 --> 00:03:55,970 of here once again just about everything is going to be identical to the ticket's deployment. 57 00:03:56,070 --> 00:04:02,100 So we'll do another little copy paste to find the ticket's deployment file copy everything inside there. 58 00:04:02,110 --> 00:04:07,290 Paste it inside of the expiration depot file that we just created and we'll go through it and update 59 00:04:07,350 --> 00:04:13,100 a couple of different properties so once again I'm going to do a little multi select. 60 00:04:13,140 --> 00:04:21,450 I'm gonna change tickets once twice three or five five times. 61 00:04:22,640 --> 00:04:26,900 Over to expiration. 62 00:04:27,010 --> 00:04:33,310 Well then take a look at the environment section still want to have our next client I.D. still want 63 00:04:33,310 --> 00:04:38,760 to Nancy where l still want a cluster I.D. but we do not need a mongo you or I. 64 00:04:38,760 --> 00:04:43,580 And we also do not need a Jason Webb token key either. 65 00:04:43,650 --> 00:04:47,820 We are going to add in however one additional environment variable we're going to add in something that's 66 00:04:47,820 --> 00:04:52,410 going to tell our expiration deployment how to connect to red. 67 00:04:52,720 --> 00:04:59,950 They're gonna put in a new enviroment variable here with the name of readies underscore hosts and then 68 00:04:59,950 --> 00:05:06,450 a value of the host name for the right a server that we want to connect to to connect to read as well. 69 00:05:06,490 --> 00:05:10,950 We're just gonna specify the service name that we had just written out inside of the expiration readies 70 00:05:10,990 --> 00:05:12,140 deployment file. 71 00:05:12,550 --> 00:05:17,750 So the hostname or the service name that we want to connect to is expiration reddest SRB. 72 00:05:17,750 --> 00:05:22,750 So inside of our expiration deployment file for the environment variable named read as host we'll put 73 00:05:22,750 --> 00:05:29,350 in expiration readies SRB. 74 00:05:29,410 --> 00:05:33,700 So that's it for the actual deployment will then go down to the cluster I.P. service. 75 00:05:33,700 --> 00:05:37,680 And once again we'll update this thing just a little bit. 76 00:05:37,740 --> 00:05:45,400 We're gonna change this to a name of expiration SRB a selector of expiration. 77 00:05:45,400 --> 00:05:47,480 And then what ports do we care about here. 78 00:05:47,500 --> 00:05:50,590 Oh wait a minute we don't care about any ports whatsoever. 79 00:05:50,590 --> 00:05:55,690 Turns out that this service is not going to be contacted by any other part of our application directly 80 00:05:55,690 --> 00:05:56,320 anyways. 81 00:05:56,650 --> 00:06:00,310 We're also not going to have any network requests going directly to the expiration service or anything 82 00:06:00,310 --> 00:06:01,350 like that. 83 00:06:01,360 --> 00:06:06,940 So in this scenario we actually do not need a cluster IP service or expiration at all. 84 00:06:07,000 --> 00:06:13,370 So we can delete this entire section and a three little dashes right above it all we really care about 85 00:06:13,380 --> 00:06:18,560 in this case is creating the expiration pod that's gonna be running the expiration container and that 86 00:06:18,570 --> 00:06:24,070 thing is going to communicate with everything else asynchronously through Nat streaming server so in 87 00:06:24,070 --> 00:06:29,910 this case just a deployment nothing else that's going to save this blows it out. 88 00:06:29,910 --> 00:06:34,200 And then finally let's go back over to our terminal and take a look at scaffold and see how it is doing 89 00:06:37,330 --> 00:06:38,790 to back over at scaffold. 90 00:06:38,790 --> 00:06:43,590 It looks like my deployment was just created and if I look a little bit above that it looks like the 91 00:06:43,640 --> 00:06:49,320 red is deployment and the expiration read a service was created as well. 92 00:06:49,320 --> 00:06:54,100 I don't really see any feedback from anything inside of your that could be scaffold is just kind of 93 00:06:54,100 --> 00:06:58,960 stalled out so I could always restart scaffold manually but first I was going to do a quick cube TTL 94 00:06:59,020 --> 00:07:04,060 get pods and see if I can see my expiration stuff running. 95 00:07:04,400 --> 00:07:08,280 So when I do I get pods I see the deployment running right there. 96 00:07:08,330 --> 00:07:11,370 I also see the red is server running as well. 97 00:07:11,390 --> 00:07:16,930 So looks like for me everything is good to go now at this time incredibly possible that some pod is 98 00:07:16,930 --> 00:07:17,350 stuck. 99 00:07:17,710 --> 00:07:23,260 Without a doubt in particular if you just saved the expiration deployment file before you had finished 100 00:07:23,290 --> 00:07:28,720 pushing your Docker image up to Docker Hub you might be seeing an error saying something like air image 101 00:07:28,720 --> 00:07:30,150 pull or something like that. 102 00:07:30,400 --> 00:07:32,960 If you see any errors like that whatsoever no problem. 103 00:07:33,010 --> 00:07:35,170 I would encourage you to just restart scaffold. 104 00:07:35,170 --> 00:07:38,430 That's pretty much it once you've got everything up and running. 105 00:07:38,440 --> 00:07:43,030 We'll take a quick pause come back and then start working on our actual expiration service in just a 106 00:07:43,030 --> 00:07:43,320 moment.