1 00:00:02,520 --> 00:00:05,549 ‫The advantage of you learning Docker, then Compose, 2 00:00:05,550 --> 00:00:08,579 ‫and then Swarm is that you have so much of the basic 3 00:00:08,580 --> 00:00:11,240 ‫knowledge here that I don't have to start from scratch when 4 00:00:11,370 --> 00:00:12,370 ‫I'm teaching you Kubernetes. 5 00:00:12,840 --> 00:00:15,419 ‫Some of the terminologies, especially when we talk about 6 00:00:15,420 --> 00:00:18,750 ‫the objects inside of Kubernetes that you control and use, 7 00:00:19,080 --> 00:00:21,479 ‫the terms can be a little bit confusing because some are 8 00:00:21,480 --> 00:00:23,420 ‫conflicting and some are just new. 9 00:00:23,790 --> 00:00:26,339 ‫By far the number one thing you're going to keep hearing, 10 00:00:26,340 --> 00:00:29,369 ‫if you've ever looked up anything in Kubernetesland, is the 11 00:00:29,370 --> 00:00:32,520 ‫pod. The pod is the basic unit of deployment. 12 00:00:32,820 --> 00:00:35,639 ‫We don't technically deploy containers directly 13 00:00:36,060 --> 00:00:37,089 ‫inside of Kubernetes. 14 00:00:37,472 --> 00:00:39,334 ‫We only deploy pods, and we use things 15 00:00:40,590 --> 00:00:43,740 ‫on top of that known as controllers 16 00:00:43,800 --> 00:00:45,119 ‫to control those pods. 17 00:00:45,390 --> 00:00:48,990 ‫Technically, you can deploy a pod directly, 18 00:00:49,380 --> 00:00:51,060 ‫but you're not really going to want to do that. 19 00:00:51,480 --> 00:00:54,659 ‫Almost always you'll create a controller that 20 00:00:54,660 --> 00:00:57,600 ‫is an object that continually sits there and 21 00:00:57,690 --> 00:01:00,659 ‫validates whether or not what's going on inside 22 00:01:00,660 --> 00:01:02,759 ‫of Kubernetes is what you've asked it to do. 23 00:01:03,180 --> 00:01:06,030 ‫It's a differencing engine that has different types. 24 00:01:06,090 --> 00:01:08,981 ‫You start out with Deployments and ReplicaSets which you'll 25 00:01:09,150 --> 00:01:10,770 ‫be using almost exclusively. 26 00:01:11,040 --> 00:01:13,882 ‫Deployments are very similar to the way we did services in 27 00:01:13,920 --> 00:01:17,340 ‫Swarm and that controls your pods 28 00:01:17,430 --> 00:01:20,489 ‫at lower levels. Then, you can change up and do 29 00:01:20,490 --> 00:01:23,283 ‫different types of controllers, even third-party types of 30 00:01:23,340 --> 00:01:26,327 ‫controllers including StatefulSets, and DaemonSets, 31 00:01:27,090 --> 00:01:29,579 ‫and Jobs, and CronJobs and so much more. 32 00:01:29,760 --> 00:01:32,270 ‫That's part of the flexibility of Kubernetes 33 00:01:32,850 --> 00:01:35,741 ‫is that it gives us this basic unit of pods and then allows 34 00:01:36,120 --> 00:01:38,879 ‫us to control that with controllers in different ways, 35 00:01:39,180 --> 00:01:42,209 ‫and allows us to get really creative with how we deploy our 36 00:01:42,210 --> 00:01:43,210 ‫systems. 37 00:01:43,920 --> 00:01:46,589 ‫The service is a little bit different in Kubernetes than 38 00:01:46,590 --> 00:01:47,640 ‫you were used to in Swarm. 39 00:01:48,000 --> 00:01:50,819 ‫The service really doesn't have anything to do with 40 00:01:51,120 --> 00:01:53,299 ‫deploying applications like you would in Swarm. 41 00:01:53,310 --> 00:01:56,700 ‫The services, specifically the endpoint that you give 42 00:01:57,000 --> 00:02:00,120 ‫to a set of pods, often when you use 43 00:02:00,150 --> 00:02:02,649 ‫a controller like a deployment controller to deploy 44 00:02:03,120 --> 00:02:04,884 ‫out a set of replica pods, you would 45 00:02:06,180 --> 00:02:08,610 ‫then set a service on that. 46 00:02:08,870 --> 00:02:12,209 ‫The service just means you're giving it a persistent 47 00:02:12,280 --> 00:02:13,554 ‫endpoint in the cluster so 48 00:02:15,300 --> 00:02:17,799 ‫that everything else can access that set of pods at 49 00:02:18,270 --> 00:02:20,610 ‫a specific DNS name and port. 50 00:02:21,060 --> 00:02:22,739 ‫Next up, real quick, is a namespace. 51 00:02:22,950 --> 00:02:26,129 ‫We won't really use namespaces much in Docker 52 00:02:26,130 --> 00:02:29,219 ‫Mastery itself because it's an optional, advanced feature, 53 00:02:29,250 --> 00:02:31,349 ‫but you will hear it mentioned if you're looking in 54 00:02:31,350 --> 00:02:34,240 ‫documentation or reading blogs and whatnot. 55 00:02:34,530 --> 00:02:38,189 ‫The namespace is really just a filter 56 00:02:38,460 --> 00:02:40,169 ‫on your view at the command line. 57 00:02:40,410 --> 00:02:42,809 ‫That's really all it is. It's not a security feature. 58 00:02:43,050 --> 00:02:45,569 ‫If you're familiar with some of the internals of Docker, 59 00:02:45,810 --> 00:02:47,361 ‫you hear about namespaces in Docker. 60 00:02:48,060 --> 00:02:49,500 ‫This is in no way the same thing. 61 00:02:49,710 --> 00:02:51,229 ‫This is simply a way for you to 62 00:02:52,830 --> 00:02:56,189 ‫filter your views when you're using the kubectrl command 63 00:02:56,190 --> 00:02:58,769 ‫line so that you only see the things you care about at the 64 00:02:58,770 --> 00:03:01,460 ‫moment. A good example might be when using Docker Desktop, 65 00:03:01,461 --> 00:03:04,590 ‫it defaults to the default 66 00:03:04,680 --> 00:03:07,979 ‫namespace and filters out all of the system containers 67 00:03:07,980 --> 00:03:09,539 ‫running Kubernetes in the background. 68 00:03:09,780 --> 00:03:12,239 ‫Because normally, you don't want to see those when you're 69 00:03:12,240 --> 00:03:13,800 ‫running the kubectrl command lines. 70 00:03:14,070 --> 00:03:17,129 ‫Then you can change the namespace to see those 71 00:03:17,160 --> 00:03:19,589 ‫if you want to see the different views. 72 00:03:19,710 --> 00:03:22,110 ‫Just think of it as a filter, not a security feature. 73 00:03:22,410 --> 00:03:24,749 ‫Of course, there's so much more to Kubernetes that will get 74 00:03:24,750 --> 00:03:26,580 ‫into eventually. There's Secrets. 75 00:03:26,790 --> 00:03:29,550 ‫There's ConfigMaps. There's a bunch of third-party stuff. 76 00:03:30,120 --> 00:03:32,913 ‫But enough with the concepts. Let's type commands and see 77 00:03:33,060 --> 00:03:35,459 ‫results at the command line and then we're going to 78 00:03:35,460 --> 00:03:37,289 ‫visualize it on the drawing board.