1 00:00:01,360 --> 00:00:05,840 We are all complete with our config file scenario are going to apply this to our cluster. 2 00:00:05,920 --> 00:00:10,520 To do so I'm going to go back over to my terminal and sign my Cade's directory. 3 00:00:10,630 --> 00:00:21,110 I will do a cube Seitel apply dash f we're going to apply post dash SRB normal once I run that I should 4 00:00:21,110 --> 00:00:26,420 see that the service was created I can then attempt to list out all the different services list running 5 00:00:26,420 --> 00:00:32,860 inside my cluster with keeps TTL get services and that's gonna print out a default service of Cuban 6 00:00:32,940 --> 00:00:38,210 is right there we can ignore that for right now and post stash SRB so that is a service that we just 7 00:00:38,220 --> 00:00:43,610 created you'll notice that its type is not port and at the very end over here you'll notice that there 8 00:00:43,610 --> 00:00:44,320 is a port. 9 00:00:44,330 --> 00:00:50,050 Column 1 Port says four thousand and the other are just on the other side that colon. 10 00:00:50,120 --> 00:00:55,850 Can be something like a thirty thousand port so you might have anything from a thirty thousand to thirty 11 00:00:55,850 --> 00:00:58,220 one thousand or thirty two thousand. 12 00:00:58,310 --> 00:01:03,470 This is going to be a randomly assigned port and that port is how are we going to actually access your 13 00:01:03,470 --> 00:01:04,620 service. 14 00:01:04,820 --> 00:01:10,030 Let me show you a quick diagram OK so really count that's just a moment ago. 15 00:01:10,270 --> 00:01:15,010 So we had said that there is a target port that we used to access our container running inside the pod 16 00:01:15,670 --> 00:01:19,690 there is a port that gets assigned to the node port service itself. 17 00:01:19,690 --> 00:01:23,930 And finally there is a third thing here called a Node port. 18 00:01:23,980 --> 00:01:30,950 Now the word node port is meant to designate a kind of port as opposed to the node ports service whatever. 19 00:01:30,970 --> 00:01:32,830 We basically just call it node port. 20 00:01:32,830 --> 00:01:38,530 This is a randomly assigned port that we use to actually get access to that service from outside of 21 00:01:38,530 --> 00:01:44,200 our cluster so it's almost always going to start with thirty thousand or thirty one or thirty two but 22 00:01:44,200 --> 00:01:48,890 it is going to be randomly assigned we can get that port by doing that. 23 00:01:48,980 --> 00:01:53,160 Keeps Seitel get services and you're gonna see it listed right there. 24 00:01:53,270 --> 00:02:00,500 We can also run a describe command on the postal service very similar to the cube Seitel describe deployments 25 00:02:00,590 --> 00:02:10,540 and pods so we've seen previously so I could do a cube Seitel describe service host dash SRB if I run 26 00:02:10,540 --> 00:02:16,570 that I will see node port right there and that is the note port that is assigned and again that is how 27 00:02:16,570 --> 00:02:22,210 I'm going to actually access the service inside my browser so me show you one more diagram that's going 28 00:02:22,210 --> 00:02:26,170 to kind of summarize all this stuff because there's really just so much stuff going on here I know this 29 00:02:26,170 --> 00:02:33,670 is some nasty stuff so to actually access our post odd really comes down to whether you are using Docker 30 00:02:33,670 --> 00:02:41,340 for Mac or Windows or you're using mini Q If you're using mini Q to access the service we just created 31 00:02:41,400 --> 00:02:46,860 you are going to run a mini cube IP at your terminal that is going to print out an IP address. 32 00:02:46,860 --> 00:02:51,010 You're then going to take that IP you're going to write it out essentially right here. 33 00:02:51,060 --> 00:02:55,800 So maybe a something like 1 9 2 whatever whatever. 34 00:02:55,860 --> 00:03:00,830 And then a colon and then the full port that you just saw back at the terminal. 35 00:03:00,930 --> 00:03:03,390 This node port listed right there. 36 00:03:03,540 --> 00:03:07,750 So it's probably not going to be 34 0 2 for you it's going to be probably something else. 37 00:03:07,860 --> 00:03:13,200 So you would do something like 30 for 0 2 and then flash posts and that should get all the different 38 00:03:13,200 --> 00:03:19,270 posts that are stored inside of our post application if you are on Docker from macro windows a little 39 00:03:19,270 --> 00:03:19,870 bit easier. 40 00:03:19,870 --> 00:03:23,560 It would be just a local host then a colon and then that note port. 41 00:03:23,560 --> 00:03:27,920 So for me it'll be at thirty four O to flash posts now. 42 00:03:27,930 --> 00:03:33,330 Quick reminder this entire node port thing is all about development or just for development purposes. 43 00:03:33,390 --> 00:03:38,220 So this does not mean that your users are going to actually access your application at Port thirty four 44 00:03:38,220 --> 00:03:38,940 or two. 45 00:03:38,940 --> 00:03:42,490 Again this is just for development purposes all right. 46 00:03:42,580 --> 00:03:49,270 So I can open up a new browser tab because I am running Docker for Mac and I just saw right there a 47 00:03:49,270 --> 00:03:51,590 node port of 30 for 0 2. 48 00:03:51,590 --> 00:03:59,950 I'm going to enter in local post thirty or two slash posts and then I will see an empty object right 49 00:03:59,950 --> 00:04:00,390 there. 50 00:04:00,820 --> 00:04:02,170 You'll see something very similar. 51 00:04:02,290 --> 00:04:08,080 Remember anytime we make a get request for a post and point our actual post application is going to 52 00:04:08,080 --> 00:04:10,400 send back all the posts have been created. 53 00:04:10,510 --> 00:04:15,430 So because this is an empty object that is just saying no posts have been created yet. 54 00:04:15,450 --> 00:04:18,600 Well I'd say creating the service was a little bit of a nightmare. 55 00:04:18,600 --> 00:04:21,000 And actually getting this you are all put together was a nightmare. 56 00:04:21,000 --> 00:04:27,060 But at least we now know how to run something or a container inside of our cluster and how to in some 57 00:04:27,060 --> 00:04:31,170 way access it by visiting some address inside of our browser. 58 00:04:31,170 --> 00:04:32,810 So this is a good step forward. 59 00:04:32,970 --> 00:04:40,320 What we still have to figure out how to create that whereas it was my diagram right here how to create 60 00:04:40,320 --> 00:04:44,210 a load balancer which is the better way of acts accessing stuff the node port. 61 00:04:44,630 --> 00:04:49,710 And we also need to ultimately start to create some of these other pods or our other services. 62 00:04:49,830 --> 00:04:54,720 And when I use the term services I'm talking about the comment service and our event bus and so on and 63 00:04:54,720 --> 00:04:59,830 then get connections between all these different things using cluster IP services as well. 64 00:04:59,850 --> 00:05:04,590 There's still a little bit of work to do but this is almost at the very end of the tunnel or end of 65 00:05:04,590 --> 00:05:07,240 this phase of learning about this Cuban Nettie stuff. 66 00:05:07,240 --> 00:05:09,690 So let's take a quick pause right here and continue in just a minute.