1 00:00:01,280 --> 00:00:04,010 We've been playing around with pods and deployments for quite a while. 2 00:00:04,070 --> 00:00:09,110 And at this point in time if we do a cube GTL get pods we'll see that we still have one pod running 3 00:00:09,110 --> 00:00:10,310 from our deployment. 4 00:00:10,370 --> 00:00:15,920 So in theory this thing right here at this pod inside of it is running a container and it's inside that 5 00:00:15,920 --> 00:00:18,770 container is our post application. 6 00:00:18,800 --> 00:00:19,670 So at this point. 7 00:00:19,670 --> 00:00:20,560 Quick question for you. 8 00:00:20,600 --> 00:00:27,180 How do we actually make a request to that application somewhere hidden in all these crazy layers. 9 00:00:27,260 --> 00:00:28,780 Is our original node server. 10 00:00:28,790 --> 00:00:30,710 How do we actually make use of that thing. 11 00:00:30,710 --> 00:00:33,020 Well that's we're gonna figure out in this video. 12 00:00:33,020 --> 00:00:35,540 So we're going to be discussing services. 13 00:00:35,540 --> 00:00:39,150 Remember a service is another kind of object in Cuban settings. 14 00:00:39,170 --> 00:00:40,690 It's an object very similar to our. 15 00:00:40,700 --> 00:00:44,090 A pod is an object or a deployment is an object. 16 00:00:44,240 --> 00:00:47,720 We create services using config files just as we do. 17 00:00:47,750 --> 00:00:54,140 Pods and deployments we are going to make use of services to set up some communication between all of 18 00:00:54,140 --> 00:00:59,350 our different pods or to get access to a pod from the outside of our cluster. 19 00:00:59,390 --> 00:01:05,150 So any time we need to have some communication or networking between our pods which is the case with 20 00:01:05,150 --> 00:01:12,290 our event boss trying to send events over to our those images or the post pods or any time that we need 21 00:01:12,290 --> 00:01:18,170 to somehow access a pod from outside of the cluster we are always going to be making use of a service. 22 00:01:18,200 --> 00:01:24,800 So anytime we think of networking or communication in any way shape or form we are always thinking about 23 00:01:24,800 --> 00:01:28,770 services just about every single pod that we ever create. 24 00:01:28,770 --> 00:01:31,240 We're going to want to communicate with in some fashion. 25 00:01:31,410 --> 00:01:35,250 So just about every pod or every deployment we create is always going to have some kind of matching 26 00:01:35,250 --> 00:01:36,810 service along with it. 27 00:01:37,550 --> 00:01:40,790 Behind the scenes there are actually several different kinds of services. 28 00:01:40,820 --> 00:01:44,410 So let's go over these different types really quickly. 29 00:01:44,430 --> 00:01:48,780 There are four different types of services that we need to be aware of but effectively there's only 30 00:01:48,780 --> 00:01:56,020 two cluster HP and load balancer that we're going to be using on a very daily basis luster IP. 31 00:01:56,020 --> 00:02:01,220 Services are used anytime that we want to set up communication between different pods inside of our 32 00:02:01,220 --> 00:02:09,350 cluster node ports are used anytime they want to access a pod from outside of our cluster but we only 33 00:02:09,350 --> 00:02:16,640 usually only use a node port for development purposes load balancers are the right way to access a pod 34 00:02:16,640 --> 00:02:17,900 from outside the cluster. 35 00:02:17,990 --> 00:02:21,860 You can think of a node port and load balancer as being very similar but the way that they actually 36 00:02:21,860 --> 00:02:23,320 work are very different. 37 00:02:23,330 --> 00:02:28,290 I'll be sure to tell you exactly how they're different over time so node port and load balancer are 38 00:02:28,290 --> 00:02:31,440 both going to expose a port to the outside world. 39 00:02:31,520 --> 00:02:33,650 We expose a pod to the outside world. 40 00:02:34,020 --> 00:02:35,730 And then finally external name services. 41 00:02:35,760 --> 00:02:40,050 I only put it in this diagram so that you are aware that this exists and it is another type of service 42 00:02:40,320 --> 00:02:42,420 but it's not something that we are going to use. 43 00:02:42,420 --> 00:02:47,570 It's a very advanced very kind of corner case thing that we're not really going to worry about so quick 44 00:02:47,570 --> 00:02:53,720 question for you out of these three different types of services what would be the most appropriate type 45 00:02:53,720 --> 00:02:58,820 of service to use if we want to setup some kind of communication between these different pods. 46 00:02:58,820 --> 00:03:03,160 Well in this case we are trying to set up communication between pods inside of a cluster. 47 00:03:03,290 --> 00:03:09,500 So that would be most appropriate for a cluster IP type service because it only exposes pods to other 48 00:03:09,500 --> 00:03:11,470 pods inside the cluster. 49 00:03:11,630 --> 00:03:18,100 So we would want this right here to be a cluster IP service about the other scenario scenario in which 50 00:03:18,100 --> 00:03:23,200 we want to access a pod from the outside world like maybe a browser running are on our computer or a 51 00:03:23,200 --> 00:03:27,060 browser running on some user's machine in this scenario. 52 00:03:27,080 --> 00:03:33,440 We are trying to access a pod from the outside world so we could use either a node port or a load balancer 53 00:03:34,410 --> 00:03:39,090 if we are in a development environment and we just want to do one little quick one off test or something 54 00:03:39,090 --> 00:03:39,470 like that. 55 00:03:39,480 --> 00:03:44,400 We would use a node port but in just about every other scenario we are going to use a load balancer 56 00:03:44,460 --> 00:03:46,040 type service. 57 00:03:46,110 --> 00:03:49,320 So in this case we would make this either a load balancer 58 00:03:51,960 --> 00:03:53,750 and I'll say sorry about that. 59 00:03:53,750 --> 00:04:02,330 We would all on here at the very end or possibly a node port so those are some the different types of 60 00:04:02,330 --> 00:04:04,210 services that we're going to make use up. 61 00:04:04,250 --> 00:04:09,590 Again we're going to be mostly focused on cluster IP and load balancer but we will sometimes make use 62 00:04:09,590 --> 00:04:10,750 of no port. 63 00:04:10,910 --> 00:04:12,540 So let's take a quick pause right here. 64 00:04:12,560 --> 00:04:15,440 We're gonna come back the next video and we're gonna start to create our first service.