1 00:00:02,070 --> 00:00:04,799 ‫All right. These last couple of lectures you've started to 2 00:00:04,800 --> 00:00:07,201 ‫see all the different areas of Kubernetes that is 3 00:00:08,580 --> 00:00:10,529 ‫expanding, right. If you sort of think of it as like this 4 00:00:10,530 --> 00:00:13,919 ‫center little globe of 5 00:00:13,920 --> 00:00:15,530 ‫just the binaries and the base infrastructure of 6 00:00:15,570 --> 00:00:18,809 ‫Kubernetes, the rings keep 7 00:00:18,810 --> 00:00:20,259 ‫getting bigger and bigger, right. With Ingress, and 8 00:00:20,260 --> 00:00:23,120 ‫Operator pattern, and custom resource definitions. 9 00:00:23,300 --> 00:00:25,013 ‫It just keeps getting bigger. 10 00:00:26,000 --> 00:00:28,646 ‫Now, I want to talk to you about how it's getting even 11 00:00:29,910 --> 00:00:33,689 ‫larger. In fact, this is probably the one area where it's a 12 00:00:33,690 --> 00:00:34,690 ‫little crazy. 13 00:00:35,010 --> 00:00:36,872 ‫That is in the area of opinions around 14 00:00:38,310 --> 00:00:40,321 ‫how to deploy the YAML for these resources, right. 15 00:00:40,620 --> 00:00:42,171 ‫So far, you've seen the kubectl apply. 16 00:00:42,570 --> 00:00:45,190 ‫Well, that's going to get you started and that'll probably 17 00:00:45,191 --> 00:00:47,249 ‫get you through your first deployment of a 18 00:00:48,630 --> 00:00:50,232 ‫container orchestrator, right. You'll...whether you're 19 00:00:50,233 --> 00:00:52,781 ‫using Swarm or Kubernetes, you'll get that YAML, and 20 00:00:53,290 --> 00:00:56,132 ‫you'll have a repo, and you'll be storing it in there, and 21 00:00:56,460 --> 00:00:57,460 ‫that'll make sense. 22 00:00:58,470 --> 00:01:01,109 ‫Once you start to expand this out, and you have teams, and 23 00:01:01,110 --> 00:01:02,489 ‫you have permissions, and different types of permissions, 24 00:01:02,490 --> 00:01:04,499 ‫and people that have to govern or approve 25 00:01:05,489 --> 00:01:08,272 ‫things, everything gets more complicated. 26 00:01:08,560 --> 00:01:10,128 ‫What's happened in this world of 27 00:01:11,730 --> 00:01:12,978 ‫how to deploy your apps on Kubernetes, and that's 28 00:01:14,700 --> 00:01:17,399 ‫basically what this is about. We're going to talk about the 29 00:01:17,400 --> 00:01:20,020 ‫fact that there's now over 60, well really, there's like 30 00:01:20,021 --> 00:01:22,569 ‫80, but a lot of them are no longer real projects or 31 00:01:22,832 --> 00:01:23,970 ‫they're dead or archived. 32 00:01:24,400 --> 00:01:25,919 ‫But there's at least 60 ways to 33 00:01:27,660 --> 00:01:29,590 ‫add tools on top of Kubernetes simply 34 00:01:31,290 --> 00:01:33,470 ‫for deploying your applications on Kubernetes. 35 00:01:34,510 --> 00:01:35,510 ‫There's lots of opinions, right. 36 00:01:36,480 --> 00:01:38,390 ‫This is where the opinions start to come out about 37 00:01:40,020 --> 00:01:42,449 ‫how you should be doing this. Everything from Jenkins X to 38 00:01:42,450 --> 00:01:43,720 ‫Helm and beyond. There's 39 00:01:45,420 --> 00:01:46,882 ‫all these different things and opinions on, well, 40 00:01:48,050 --> 00:01:50,341 ‫Kubernetes isn't an opinionated infrastructure so we need 41 00:01:50,342 --> 00:01:51,532 ‫opinions to guide people 42 00:01:53,400 --> 00:01:54,870 ‫through the process of deploying and updating their apps. 43 00:01:56,000 --> 00:01:57,661 ‫So, everyone's got one. If you've read anything 44 00:01:59,220 --> 00:02:00,871 ‫about how to do this in Kubernetes, you've probably heard 45 00:02:00,872 --> 00:02:03,620 ‫of Helm. Helm to Kubernetes is Kubernetes 46 00:02:03,980 --> 00:02:07,079 ‫to containers essentially. Helm is the de facto 47 00:02:07,080 --> 00:02:08,354 ‫way that everyone looks to 48 00:02:10,259 --> 00:02:12,660 ‫create templates and use templating standards for 49 00:02:13,500 --> 00:02:15,705 ‫deploying either third-party apps or creating 50 00:02:16,740 --> 00:02:18,020 ‫their own custom Helm charts. 51 00:02:18,440 --> 00:02:19,560 ‫That's what they're called is charts. 52 00:02:20,320 --> 00:02:23,214 ‫It's essentially a templated YAML, but it allows Helm 53 00:02:24,380 --> 00:02:26,341 ‫to create or spit out the 54 00:02:27,570 --> 00:02:30,265 ‫YAML that will then go into your Kubernetes cluster for 55 00:02:30,301 --> 00:02:32,400 ‫you. But, it's not the only opinion, right. 56 00:02:32,730 --> 00:02:34,699 ‫I said there's over 60 at least last time I look. 57 00:02:35,100 --> 00:02:37,991 ‫There's actually a Google Sheet that I put in the reference 58 00:02:38,250 --> 00:02:40,440 ‫links. It's a little outdated, but it's the 59 00:02:42,480 --> 00:02:43,739 ‫last known list of all the places you could find these 60 00:02:43,740 --> 00:02:45,847 ‫different ways to deploy. Docker themselves 61 00:02:47,010 --> 00:02:48,480 ‫have their own opinion that is very interesting, especially 62 00:02:50,520 --> 00:02:51,801 ‫if you're wanting to be tight into the Docker ecosystem. That 63 00:02:52,990 --> 00:02:53,990 ‫is Compose on Kubernetes. 64 00:02:54,470 --> 00:02:56,185 ‫If you have Docker Desktop, you can 65 00:02:57,780 --> 00:03:00,584 ‫today enable Kubernetes, which you probably already have 66 00:03:00,736 --> 00:03:04,139 ‫done for this part of the course. You can use docker 67 00:03:04,140 --> 00:03:07,569 ‫stack deploy and instead of it going 68 00:03:07,570 --> 00:03:09,162 ‫to Swarm, you can send it to Kubernetes. 69 00:03:10,380 --> 00:03:12,570 ‫If you go look at the docker stack deploy command and look 70 00:03:12,571 --> 00:03:14,631 ‫at the help for that, you will see that there's an option 71 00:03:14,830 --> 00:03:16,692 ‫there to specify the orchestrator that 72 00:03:17,940 --> 00:03:20,039 ‫you want to use. In fact, in the settings of Docker 73 00:03:20,040 --> 00:03:22,919 ‫Desktop, you can tell it to prefer or default to 74 00:03:23,070 --> 00:03:25,030 ‫Kubernetes for the stack deploy commands. 75 00:03:26,090 --> 00:03:29,069 ‫That's pretty interesting because I thought that Compose 76 00:03:29,070 --> 00:03:30,426 ‫YAML was different than Kubernetes YAML. 77 00:03:31,610 --> 00:03:34,080 ‫Well, that's what Compose on Kubernetes now does. 78 00:03:34,460 --> 00:03:36,443 ‫It's a third-party tool essentially. 79 00:03:36,520 --> 00:03:40,199 ‫It's an opinionated way, from Docker, how 80 00:03:40,200 --> 00:03:43,349 ‫to deploy, or interpret, or technically 81 00:03:43,350 --> 00:03:46,094 ‫translate, the YAML of Compose, the Compose format, into 82 00:03:47,280 --> 00:03:48,850 ‫the YAML of Kubernetes format. 83 00:03:49,890 --> 00:03:52,349 ‫So, I've put a link in here for you to go check that out if 84 00:03:52,350 --> 00:03:55,094 ‫you're someone who's going to consider Docker Enterprise 85 00:03:55,530 --> 00:03:58,250 ‫as your enterprise tooling for Kubernetes 86 00:03:58,510 --> 00:03:59,940 ‫and Swarm and Docker in general. 87 00:03:59,941 --> 00:04:03,629 ‫Then,you should definitely check this out because that 88 00:04:03,630 --> 00:04:05,555 ‫comes out-of-the-box. One of the nice things about that 89 00:04:05,556 --> 00:04:07,516 ‫feature is that the workflow stays super 90 00:04:08,850 --> 00:04:10,730 ‫simple. Basically, you're using your Compose YAML 91 00:04:12,200 --> 00:04:14,909 ‫throughout the entire pipeline, and you can use it in Ops 92 00:04:14,930 --> 00:04:17,086 ‫and Dev. It doesn't force you to say, OK for 93 00:04:18,329 --> 00:04:20,510 ‫developers, you've got to have YAML for Compose and for 94 00:04:20,511 --> 00:04:23,120 ‫production and servers, you have to have this Kubernetes 95 00:04:23,130 --> 00:04:24,892 ‫YAML, and they are not compatible, right. 96 00:04:25,890 --> 00:04:27,990 ‫The idea with Docker was they thought this is too 97 00:04:27,991 --> 00:04:29,061 ‫complicated. Let's simplify it. 98 00:04:29,260 --> 00:04:31,955 ‫Let's just use one YAML standard for the entire control 99 00:04:32,400 --> 00:04:33,400 ‫pipeline. 100 00:04:33,670 --> 00:04:35,532 ‫And, I like it. The problem with it is 101 00:04:36,720 --> 00:04:38,402 ‫it doesn't support everything under the sun that Kubernetes 102 00:04:39,030 --> 00:04:41,339 ‫can do, right. I mean obviously, we have a single page in 103 00:04:41,340 --> 00:04:44,073 ‫the Docker Docs to list out all the features of a Compose 104 00:04:44,100 --> 00:04:46,821 ‫file. But, the Kubernetes YAML 105 00:04:47,490 --> 00:04:50,283 ‫is so complex that we have to dig into multiple commands, 106 00:04:50,370 --> 00:04:52,222 ‫and API references and all that, right. 107 00:04:52,650 --> 00:04:54,950 ‫So clearly, it can't possibly do it all. 108 00:04:55,730 --> 00:04:58,297 ‫The nice thing is on the Compose for Kubernetes website, 109 00:04:58,640 --> 00:05:01,384 ‫they talk about in GitHub the different features that it 110 00:05:01,391 --> 00:05:02,391 ‫does support. 111 00:05:02,760 --> 00:05:04,290 ‫It's the 80/20 rule there. 112 00:05:04,650 --> 00:05:07,439 ‫In other words, it supports the 20 percent of 113 00:05:07,800 --> 00:05:10,740 ‫Kubernetes features that 80 percent of us probably need. 114 00:05:11,340 --> 00:05:13,859 ‫So, you can get started with that and see if that workflow 115 00:05:13,860 --> 00:05:16,261 ‫would work for you. Another nice thing is in late 116 00:05:16,890 --> 00:05:19,680 ‫2018, they open source that Compose on 117 00:05:19,980 --> 00:05:23,190 ‫Kubernetes so you can now deploy it on any 118 00:05:23,850 --> 00:05:26,594 ‫Kubernetes infrastructure you have, and it just works as 119 00:05:26,730 --> 00:05:29,699 ‫sort of interpreter. It translates anytime you use 120 00:05:30,030 --> 00:05:33,240 ‫the Compose file from Docker and using Docker commands, 121 00:05:33,540 --> 00:05:36,449 ‫it will connect your Kubernetes cluster for you, translate 122 00:05:36,450 --> 00:05:39,282 ‫that automatically into Kubernetes 123 00:05:39,630 --> 00:05:41,910 ‫YAML and away you go. You can actually, at that point, 124 00:05:41,940 --> 00:05:45,000 ‫ignore a lot of the Kubernetes YAML for 125 00:05:45,030 --> 00:05:47,391 ‫your applications. You know, maybe you use Kubernetes YAML 126 00:05:48,090 --> 00:05:50,549 ‫for infrastructure stuff that you aren't deploying every 127 00:05:50,550 --> 00:05:53,343 ‫day. But, maybe for your developers to make it easier for 128 00:05:53,550 --> 00:05:56,540 ‫them to write Compose YAML and to get things into 129 00:05:56,550 --> 00:05:59,639 ‫production faster, you choose to use the Compose on 130 00:05:59,640 --> 00:06:01,559 ‫Kubernetes as the workflow. 131 00:06:01,740 --> 00:06:04,109 ‫Then, maybe you use Helm charts, which is kind of a 132 00:06:04,110 --> 00:06:07,079 ‫competing standard for your major 133 00:06:07,080 --> 00:06:09,569 ‫infrastructure. Because the thing about Helm is that it 134 00:06:09,570 --> 00:06:12,461 ‫comes out-of-the-box with a lot of these chart templates so 135 00:06:12,510 --> 00:06:14,999 ‫that you can maybe deploy Prometheus or 136 00:06:15,600 --> 00:06:18,570 ‫Elasticsearch logging with ELK, or something like that. 137 00:06:18,880 --> 00:06:20,759 ‫It'll come with those templates right out-of-the-box that 138 00:06:20,790 --> 00:06:22,350 ‫allows you to get started faster. 139 00:06:22,740 --> 00:06:25,430 ‫Also, just remember that these are all optional, right. 140 00:06:25,500 --> 00:06:27,959 ‫You can do Kubernetes with the standard YAML that you've 141 00:06:27,960 --> 00:06:30,059 ‫been playing with so far, and that's fine. 142 00:06:30,150 --> 00:06:32,160 ‫It doesn't require these other things. 143 00:06:32,190 --> 00:06:33,990 ‫They're just optional third-party tools. 144 00:06:34,620 --> 00:06:37,319 ‫Traditionally, as the team grows, when you get 145 00:06:37,590 --> 00:06:40,290 ‫multiple production Kubernetes clusters 146 00:06:40,590 --> 00:06:43,383 ‫and there's multiple teams involved, then everything gets 147 00:06:43,470 --> 00:06:46,067 ‫harder, and you'll probably end up with more than one 148 00:06:46,140 --> 00:06:48,630 ‫solution. You might end up with Helm on certain clusters. 149 00:06:48,960 --> 00:06:51,419 ‫You might end up with Compose on Kubernetes for your 150 00:06:51,420 --> 00:06:52,680 ‫developers, or something like that. 151 00:06:52,980 --> 00:06:55,769 ‫Or, one of these other 60 plus tools 152 00:06:55,980 --> 00:06:56,980 ‫in the ecosystem. 153 00:06:57,270 --> 00:07:00,509 ‫The last point is that since Helm is really the leader 154 00:07:00,510 --> 00:07:02,274 ‫in this space right now, that almost 155 00:07:03,720 --> 00:07:06,513 ‫every distribution uses it, or supports it, or even comes 156 00:07:06,720 --> 00:07:09,029 ‫with it out-of-the-box. Just consider that when you're 157 00:07:09,030 --> 00:07:11,940 ‫looking at these tools that you probably 158 00:07:12,090 --> 00:07:14,050 ‫can't avoid Helm in a large environment. 159 00:07:14,730 --> 00:07:15,990 ‫You're just going to have to use it. 160 00:07:16,440 --> 00:07:19,650 ‫The nice thing is nowadays is it's on 3.0 161 00:07:19,860 --> 00:07:22,829 ‫and that there's a lot simpler 162 00:07:22,890 --> 00:07:25,889 ‫deployment options for it in the 3.0 versus the 1.0 and 163 00:07:25,890 --> 00:07:28,585 ‫2.0. So, things are getting better and easier with that 164 00:07:28,950 --> 00:07:31,589 ‫all the time. A lot of these deployment tools are really 165 00:07:31,590 --> 00:07:34,769 ‫just helping you template your YAML in various 166 00:07:34,770 --> 00:07:36,240 ‫ways. Kubernetes itself didn't 167 00:07:37,890 --> 00:07:39,720 ‫really have anything for the longest time. 168 00:07:40,110 --> 00:07:42,419 ‫In the recent releases, it's now come out with something 169 00:07:42,420 --> 00:07:44,249 ‫called Kustomize with a K. 170 00:07:44,640 --> 00:07:47,090 ‫When you start seeing that word with a K, you know 171 00:07:47,700 --> 00:07:48,922 ‫that it's a special feature. 172 00:07:49,530 --> 00:07:52,589 ‫It allows you to do things 173 00:07:52,590 --> 00:07:55,110 ‫similar to Helm and these other deployment solutions, 174 00:07:55,650 --> 00:07:57,022 ‫but it's not really quite as 175 00:07:58,800 --> 00:07:59,990 ‫powerful as Helm, right. 176 00:08:00,090 --> 00:08:01,319 ‫So, Helm's still the leader. 177 00:08:01,710 --> 00:08:04,679 ‫Kustomize is sort of the new kid on the block, but it comes 178 00:08:05,010 --> 00:08:07,040 ‫out-of-the-box with everything you do in Kubernetes. 179 00:08:07,440 --> 00:08:08,949 ‫The kubectl command supports it. 180 00:08:09,330 --> 00:08:11,639 ‫Really what it is is it's just taking, instead of a 181 00:08:11,640 --> 00:08:14,850 ‫templated YAML, it's just taking YAML you already have 182 00:08:15,210 --> 00:08:18,240 ‫that is standard Kubernetes YAML, and you can 183 00:08:18,480 --> 00:08:21,273 ‫then take that file and then run something else on top of 184 00:08:21,390 --> 00:08:24,209 ‫it and change it with an override of sorts. 185 00:08:24,570 --> 00:08:26,099 ‫Kind of similar to how we do in Swarm. 186 00:08:26,100 --> 00:08:28,795 ‫We actually have in Swarm and Compose, we have override 187 00:08:29,220 --> 00:08:31,020 ‫files and stuff like that. 188 00:08:31,050 --> 00:08:33,245 ‫They now have this built out-of-the-box. 189 00:08:33,570 --> 00:08:34,950 ‫It's got a lot of features to it. 190 00:08:35,250 --> 00:08:38,459 ‫I think, in more or less, it's not quite there 191 00:08:38,460 --> 00:08:40,861 ‫in terms of the feature set of what Helm has, but 192 00:08:41,549 --> 00:08:42,549 ‫at least it comes out-of-the-box. 193 00:08:43,200 --> 00:08:46,290 ‫Remember, if you have Docker, the latest release, 194 00:08:46,320 --> 00:08:49,499 ‫19.03 or newer of Docker, now 195 00:08:49,500 --> 00:08:52,769 ‫has the docker app sub command, which 196 00:08:52,830 --> 00:08:55,165 ‫does its own templating of Compose YAML 197 00:08:56,280 --> 00:08:59,369 ‫and really is very comparable to this customized option 198 00:08:59,370 --> 00:09:01,529 ‫for Kubernetes. Again, if you're going to stick with the 199 00:09:01,530 --> 00:09:03,809 ‫Docker track and you're going to consider Docker Enterprise 200 00:09:03,810 --> 00:09:06,989 ‫or you just really like how Docker focuses on 201 00:09:06,990 --> 00:09:09,146 ‫the developer workflow, look into the docker 202 00:09:10,320 --> 00:09:13,409 ‫app sub command and also the docker app repo, 203 00:09:13,440 --> 00:09:14,810 ‫which I'll put in the resources here. 204 00:09:14,811 --> 00:09:17,457 ‫Because they have documentation about how you can take 205 00:09:17,730 --> 00:09:21,149 ‫Compose YAML, extract things like environment variables 206 00:09:21,300 --> 00:09:24,419 ‫and other stuff. Package it all up into a single image 207 00:09:24,900 --> 00:09:27,779 ‫and then ship your YAML as an image. 208 00:09:27,990 --> 00:09:30,538 ‫Which means you can now version your YAML and deploy 209 00:09:30,960 --> 00:09:33,330 ‫it with a single line without having to do like 210 00:09:34,470 --> 00:09:37,500 ‫pulling down of the YAML and then typing out long commands. 211 00:09:37,830 --> 00:09:39,450 ‫It's a pretty interesting way to do it. 212 00:09:39,750 --> 00:09:42,555 ‫It's using something new called the CNAB 213 00:09:43,050 --> 00:09:45,119 ‫standard, which we're not going to get into here, but 214 00:09:45,120 --> 00:09:46,342 ‫that's C N A B. 215 00:09:46,860 --> 00:09:49,529 ‫It was an announcement that Docker and Microsoft made in 216 00:09:49,530 --> 00:09:50,530 ‫2018. 217 00:09:50,820 --> 00:09:53,279 ‫You can check all that out on the Docker app website in the 218 00:09:53,280 --> 00:09:56,370 ‫resources. Again, all this stuff is about 219 00:09:57,120 --> 00:10:00,539 ‫optional third-party ways to customize 220 00:10:00,660 --> 00:10:04,049 ‫and extend the default YAML to make it easier 221 00:10:04,050 --> 00:10:05,220 ‫for your team as you grow.