WEBVTT

1
00:00:00.080 --> 00:00:04.160
<v Speaker 1>Okay, imagine this scenario. You launch your amazing new application

2
00:00:04.400 --> 00:00:07.960
<v Speaker 1>and boom, overnight, it just goes completely viral. The dream, right,

3
00:00:08.000 --> 00:00:11.800
<v Speaker 1>absolutely every developer's dream. But then that little bit of

4
00:00:11.800 --> 00:00:15.160
<v Speaker 1>panic starts creeping in. Is your system actually ready? Can

5
00:00:15.199 --> 00:00:18.239
<v Speaker 1>it handle say, one hundred x traffic spike without just

6
00:00:18.320 --> 00:00:18.879
<v Speaker 1>falling over?

7
00:00:19.280 --> 00:00:21.679
<v Speaker 2>Yeah, that's the kind of challenge that definitely keeps people

8
00:00:21.760 --> 00:00:23.160
<v Speaker 2>up at night exactly.

9
00:00:23.600 --> 00:00:26.039
<v Speaker 1>So this deep dive, this is your shortcut really to

10
00:00:26.199 --> 00:00:31.879
<v Speaker 1>understanding how Kubernetes and containers can turn that potential nightmare

11
00:00:31.920 --> 00:00:36.320
<v Speaker 1>scenario into a well, a robust, scalable reality.

12
00:00:36.359 --> 00:00:38.560
<v Speaker 2>We're basically going to pull apart the key ideas from

13
00:00:38.560 --> 00:00:42.359
<v Speaker 2>a really great resource, William Dennis's Kubernetes for Developers.

14
00:00:42.439 --> 00:00:45.359
<v Speaker 1>Yeah, we'll unpack the essentials, starting from the real basics

15
00:00:45.399 --> 00:00:46.840
<v Speaker 1>like why you even use containers in.

16
00:00:46.799 --> 00:00:48.240
<v Speaker 2>The first place, all the way up to the more

17
00:00:48.280 --> 00:00:51.000
<v Speaker 2>advanced stuff you know, strategies for running your applications in

18
00:00:51.039 --> 00:00:53.159
<v Speaker 2>a proper professional production environment.

19
00:00:53.320 --> 00:00:55.799
<v Speaker 1>Our mission here is simple. We want to equip you

20
00:00:55.840 --> 00:00:59.359
<v Speaker 1>with the knowledge you need to confidently, deploy, manage, and

21
00:00:59.479 --> 00:01:03.320
<v Speaker 1>crucially scale your applications.

22
00:01:02.240 --> 00:01:05.480
<v Speaker 2>Making you feel well informed and hopefully ready for pretty

23
00:01:05.519 --> 00:01:06.040
<v Speaker 2>much anything.

24
00:01:06.120 --> 00:01:08.159
<v Speaker 1>Okay, so let's dive right in. Let's start right at

25
00:01:08.200 --> 00:01:12.719
<v Speaker 1>the beginning. Why why are containers and kubernetes suddenly such

26
00:01:12.719 --> 00:01:16.079
<v Speaker 1>a huge deal? What problem were they actually designed to solve?

27
00:01:16.920 --> 00:01:18.879
<v Speaker 2>Well, it's really been an evolution, hasn't it. I mean

28
00:01:18.959 --> 00:01:21.760
<v Speaker 2>you think back. We went from just throwing multiple apps

29
00:01:21.799 --> 00:01:22.840
<v Speaker 2>onto a single server.

30
00:01:23.000 --> 00:01:24.920
<v Speaker 1>Oh yeah, the bad old days totally.

31
00:01:25.040 --> 00:01:30.159
<v Speaker 2>Then we moved to isolating them in these heavyweight virtual machines,

32
00:01:30.719 --> 00:01:34.319
<v Speaker 2>and now finally we've landed on containers.

33
00:01:34.000 --> 00:01:35.200
<v Speaker 1>And the key differences.

34
00:01:35.439 --> 00:01:39.040
<v Speaker 2>It's all about that lightweight isolation. See a VM, it

35
00:01:39.200 --> 00:01:43.239
<v Speaker 2>duplicates an entire operating system, kernel and all super heavy, right,

36
00:01:43.560 --> 00:01:46.719
<v Speaker 2>But a container it just packages your application and only

37
00:01:46.760 --> 00:01:48.599
<v Speaker 2>its direct dependencies, nothing else.

38
00:01:48.920 --> 00:01:51.439
<v Speaker 1>Okay, So the benefits there are huge benefits.

39
00:01:52.040 --> 00:01:55.319
<v Speaker 2>Language flexibility. For one, you can run like different versions

40
00:01:55.359 --> 00:01:57.920
<v Speaker 2>of Java or Python on the very same host machine

41
00:01:57.959 --> 00:01:58.760
<v Speaker 2>without them clashing.

42
00:01:58.879 --> 00:01:59.959
<v Speaker 1>That alone is pretty big.

43
00:02:00.079 --> 00:02:03.560
<v Speaker 2>Yeah it is, and maybe even bigger is true reproducibility.

44
00:02:04.239 --> 00:02:07.000
<v Speaker 2>The docker file that's like the recipe for your container.

45
00:02:07.120 --> 00:02:12.000
<v Speaker 2>It records every single step needed to create that exact environment.

46
00:02:11.599 --> 00:02:14.199
<v Speaker 1>So no more, Well it worked on my machine exactly.

47
00:02:14.240 --> 00:02:18.639
<v Speaker 2>That whole headache just goes away consistency every single time.

48
00:02:18.800 --> 00:02:23.000
<v Speaker 1>Okay, that reproducibility sounds like a lifesaver personally. So containers

49
00:02:23.039 --> 00:02:27.000
<v Speaker 1>give us this perfectly packaged portable app Where does Kubernetes

50
00:02:27.000 --> 00:02:29.159
<v Speaker 1>fit into this picture? What's its role?

51
00:02:29.520 --> 00:02:33.039
<v Speaker 2>So if containers are the perfectly packed boxes, Kubernetes is

52
00:02:33.080 --> 00:02:36.719
<v Speaker 2>kind of like the super smart automated warehouse management system

53
00:02:36.759 --> 00:02:37.800
<v Speaker 2>for all those boxes.

54
00:02:37.840 --> 00:02:38.680
<v Speaker 1>I like that analogy.

55
00:02:38.759 --> 00:02:41.840
<v Speaker 2>It orchestrates them, but at a workload level, it hits

56
00:02:41.919 --> 00:02:44.400
<v Speaker 2>this really nice sweet spot. You know, you're not drowning

57
00:02:44.400 --> 00:02:47.120
<v Speaker 2>in the details of every single machine, but you're also

58
00:02:47.199 --> 00:02:50.719
<v Speaker 2>not stuck in a really high level, sometimes limiting platform

59
00:02:50.759 --> 00:02:52.560
<v Speaker 2>as a service or pot environment.

60
00:02:52.680 --> 00:02:54.879
<v Speaker 1>So how does it do that? What are the components

61
00:02:55.240 --> 00:02:55.719
<v Speaker 1>it uses?

62
00:02:55.759 --> 00:03:00.680
<v Speaker 2>These really clever composable building blocks. You've got pods. They're

63
00:03:00.719 --> 00:03:03.599
<v Speaker 2>the smallest thing you can deploy, often just one container,

64
00:03:03.639 --> 00:03:06.159
<v Speaker 2>but could be a few tightly coupled ones working together.

65
00:03:06.680 --> 00:03:09.680
<v Speaker 2>Then you have deployments. They manage your stateless applications, the

66
00:03:09.719 --> 00:03:11.719
<v Speaker 2>ones that don't hold onto data long term. They make

67
00:03:11.800 --> 00:03:14.280
<v Speaker 2>sure you always have the right number of replicas running.

68
00:03:14.400 --> 00:03:16.719
<v Speaker 1>Got it? And how do they talk to each other?

69
00:03:16.759 --> 00:03:17.719
<v Speaker 1>Were they outside world?

70
00:03:18.039 --> 00:03:23.039
<v Speaker 2>Ah? That's services. Services expose your applications either internally or externally,

71
00:03:23.199 --> 00:03:25.919
<v Speaker 2>and they handle all the load balancing between your pods.

72
00:03:26.319 --> 00:03:28.599
<v Speaker 1>The real magic, though, sounds like the automation.

73
00:03:28.879 --> 00:03:31.840
<v Speaker 2>Oh absolutely, that's the core of it. It delivers automation.

74
00:03:32.080 --> 00:03:35.639
<v Speaker 2>You get self healing, so if a container crashes, Kupernettes

75
00:03:35.680 --> 00:03:39.120
<v Speaker 2>just restarts it nice. If a whole server a node

76
00:03:39.199 --> 00:03:42.479
<v Speaker 2>goes down, it reschedules your pods onto healthy nodes automatically.

77
00:03:42.560 --> 00:03:42.919
<v Speaker 1>Wow.

78
00:03:43.080 --> 00:03:46.520
<v Speaker 2>And massive scalability. I mean, think about projects like Niantic's

79
00:03:46.560 --> 00:03:49.680
<v Speaker 2>Pokemon Go that ran on tens of thousands of CPU cords,

80
00:03:49.719 --> 00:03:52.400
<v Speaker 2>scaling up and down like crazy. Kupernettes made that possible.

81
00:03:52.759 --> 00:03:56.919
<v Speaker 1>That self healing, that automatic rescheduling, that's a game changer

82
00:03:56.919 --> 00:03:57.800
<v Speaker 1>for reliability.

83
00:03:59.039 --> 00:04:01.560
<v Speaker 2>It makes you think about those traditional PAWS platforms. Though

84
00:04:01.599 --> 00:04:03.159
<v Speaker 2>people often say they're quicker to start with.

85
00:04:03.360 --> 00:04:05.599
<v Speaker 1>They can be, yeah, initially.

86
00:04:05.240 --> 00:04:08.199
<v Speaker 2>So what's the fundamental difference. What does Kupernetes offer that

87
00:04:08.280 --> 00:04:11.400
<v Speaker 2>makes it worth Maybe a steeper initial learning curve.

88
00:04:11.680 --> 00:04:14.719
<v Speaker 1>That's a great question. With a traditional pass you can

89
00:04:14.719 --> 00:04:17.279
<v Speaker 1>get going fast, sure, but a lot of teams they

90
00:04:17.319 --> 00:04:20.680
<v Speaker 1>eventually hit this well people call the clone of despair.

91
00:04:20.959 --> 00:04:25.160
<v Speaker 1>Huh Okay, seriously, their needs just outgrow what the pass

92
00:04:25.199 --> 00:04:28.560
<v Speaker 1>can easily do, and then they're stuck facing a complete,

93
00:04:29.000 --> 00:04:33.920
<v Speaker 1>often really painful re architecture from scratch out. Yeah. Kuper Natties,

94
00:04:33.959 --> 00:04:36.279
<v Speaker 1>on the other hand, while maybe taking a bit longer

95
00:04:36.279 --> 00:04:39.879
<v Speaker 1>to learn upfront, gives you just expansive possibilities as you grow.

96
00:04:40.160 --> 00:04:43.439
<v Speaker 1>The key is flexibility. You get deep control, but without

97
00:04:43.480 --> 00:04:45.519
<v Speaker 1>sacrificing that automation we talked.

98
00:04:45.279 --> 00:04:48.360
<v Speaker 2>About, So you don't paint yourself into a corner exactly.

99
00:04:48.639 --> 00:04:50.920
<v Speaker 2>You won't need to just rip everything out and start

100
00:04:50.920 --> 00:04:53.839
<v Speaker 2>over if your application of all. So you can run simple,

101
00:04:53.959 --> 00:04:58.120
<v Speaker 2>stateless web apps, sure, but you can also migrate complex,

102
00:04:58.360 --> 00:05:01.519
<v Speaker 2>stateful legacy apps, or even run your own.

103
00:05:01.439 --> 00:05:03.800
<v Speaker 1>Databases, all on the same platform, all.

104
00:05:03.639 --> 00:05:07.959
<v Speaker 2>On the same unified platform. That initial investment in learning Kubernetes,

105
00:05:08.000 --> 00:05:10.800
<v Speaker 2>it really pays off long term as your system matures.

106
00:05:10.920 --> 00:05:13.879
<v Speaker 1>All right, I'm definitely sold on the why. This makes

107
00:05:13.920 --> 00:05:16.279
<v Speaker 1>a lot of sense. Now let's get practical. How do

108
00:05:16.319 --> 00:05:19.199
<v Speaker 1>you actually get an application ready for Kubernetes. What's the

109
00:05:19.319 --> 00:05:20.040
<v Speaker 1>very first step?

110
00:05:20.199 --> 00:05:23.680
<v Speaker 2>The essential first step is getting your app into a container.

111
00:05:23.720 --> 00:05:26.480
<v Speaker 2>We call it containerizing it, and the main tool for

112
00:05:26.519 --> 00:05:27.079
<v Speaker 2>that is the.

113
00:05:27.040 --> 00:05:29.000
<v Speaker 1>Docker file the recipe you mentioned earlier.

114
00:05:29.079 --> 00:05:31.279
<v Speaker 2>Exactly, it's just a text file with a set of

115
00:05:31.279 --> 00:05:33.920
<v Speaker 2>instructions step by step telling Docker how to build your

116
00:05:33.920 --> 00:05:36.680
<v Speaker 2>container image. You start with a base image like say

117
00:05:36.759 --> 00:05:40.199
<v Speaker 2>Python point three, instead of installing Python yourself on a boontu, right,

118
00:05:40.399 --> 00:05:45.079
<v Speaker 2>saves you that step totally. Then you add your application code, installers, dependencies,

119
00:05:45.199 --> 00:05:48.800
<v Speaker 2>configure things for apps that need compiling, like Java or Go.

120
00:05:49.120 --> 00:05:51.639
<v Speaker 2>There's a really neat trick called multi stage builds.

121
00:05:51.959 --> 00:05:53.800
<v Speaker 1>Oh yeah, how does that work?

122
00:05:53.959 --> 00:05:59.040
<v Speaker 2>You basically use one stage with all the heavy build tools, compilers, SDKs, whatever.

123
00:05:59.399 --> 00:06:03.279
<v Speaker 2>Then in a final stage, you copy only the compiled

124
00:06:03.319 --> 00:06:06.120
<v Speaker 2>application into a clean, minimal base image.

125
00:06:06.240 --> 00:06:08.480
<v Speaker 1>Ah, so you ditch all the build stuff exactly.

126
00:06:08.480 --> 00:06:11.519
<v Speaker 2>You end up with these tiny, production ready images that

127
00:06:11.600 --> 00:06:15.560
<v Speaker 2>only have what's strictly needed to run much smaller, more secure.

128
00:06:15.319 --> 00:06:18.439
<v Speaker 1>Makes sense. And for server applications, what else do we

129
00:06:18.480 --> 00:06:19.199
<v Speaker 1>need to keep in mind?

130
00:06:19.279 --> 00:06:21.920
<v Speaker 2>Well, the main thing is your container needs to keep running, right.

131
00:06:22.040 --> 00:06:24.240
<v Speaker 2>It's not just a script that finishes, it's.

132
00:06:24.079 --> 00:06:25.079
<v Speaker 1>A long running process.

133
00:06:25.199 --> 00:06:27.560
<v Speaker 2>Yeah, and you'll need to know how to map ports,

134
00:06:27.879 --> 00:06:30.560
<v Speaker 2>like tell Docker to connect port eighty eighty on your

135
00:06:30.600 --> 00:06:34.000
<v Speaker 2>local machine to port eighty inside the container. Using something

136
00:06:34.079 --> 00:06:36.800
<v Speaker 2>like the natch P eighty eighty point eighty eight zo flag.

137
00:06:36.879 --> 00:06:39.079
<v Speaker 1>Okay, standard stuff for web servers. So we've got our

138
00:06:39.079 --> 00:06:43.600
<v Speaker 1>container image built, but surely we test this locally before

139
00:06:43.759 --> 00:06:45.079
<v Speaker 1>throwing it onto a big cluster.

140
00:06:45.279 --> 00:06:48.240
<v Speaker 2>Oh absolutely, you have to, and for local testing and development.

141
00:06:48.319 --> 00:06:51.600
<v Speaker 2>Docker composed is just invaluable. It's really your secret weapon.

142
00:06:51.920 --> 00:06:55.360
<v Speaker 2>It lets you define and run multi container applications easily,

143
00:06:55.759 --> 00:06:57.759
<v Speaker 2>so you can spin up your app container, maybe a

144
00:06:57.839 --> 00:07:01.240
<v Speaker 2>database container or reddis container, all linked together just like

145
00:07:01.279 --> 00:07:03.319
<v Speaker 2>it would be in production, but on your laptop.

146
00:07:03.519 --> 00:07:03.839
<v Speaker 1>Nice.

147
00:07:03.959 --> 00:07:06.720
<v Speaker 2>It preserves all your run time settings, makes port mapping

148
00:07:06.759 --> 00:07:09.720
<v Speaker 2>easy and a really cool feature you can map local

149
00:07:09.720 --> 00:07:11.800
<v Speaker 2>folders directly into the container.

150
00:07:11.920 --> 00:07:14.639
<v Speaker 1>Oh so you can edit code locally and see the changes.

151
00:07:14.360 --> 00:07:18.079
<v Speaker 2>Live instantly, make a code change, refresh your browser. It's reflected,

152
00:07:18.240 --> 00:07:20.879
<v Speaker 2>super fast iteration. Plus you can even use it to

153
00:07:20.920 --> 00:07:24.560
<v Speaker 2>sort of fake external cloud services, like how say your

154
00:07:24.600 --> 00:07:29.160
<v Speaker 2>app needs to talk to AWSS three for object storage. Locally,

155
00:07:29.360 --> 00:07:32.399
<v Speaker 2>you can just spin up a minio container using Docker compose.

156
00:07:33.040 --> 00:07:35.959
<v Speaker 2>It behaves just like S three, so your app works

157
00:07:35.959 --> 00:07:39.759
<v Speaker 2>without needing real cloud credentials or connectivity during development.

158
00:07:39.920 --> 00:07:43.240
<v Speaker 1>That's incredibly useful for local dev loops. Okay, so we've

159
00:07:43.240 --> 00:07:47.319
<v Speaker 1>built the image, tested it locally with compose. Now the

160
00:07:47.360 --> 00:07:50.959
<v Speaker 1>moment of truth deploying to a real Kubernetes cluster. What

161
00:07:51.000 --> 00:07:52.079
<v Speaker 1>does that actually involve?

162
00:07:52.480 --> 00:07:55.199
<v Speaker 2>Right? Your main interaction point is going to be the

163
00:07:55.199 --> 00:07:59.040
<v Speaker 2>command line tool quebectl, and you tell Kubernetes what you

164
00:07:59.079 --> 00:08:01.879
<v Speaker 2>want by writing these declarative yamal configuration files.

165
00:08:02.120 --> 00:08:03.920
<v Speaker 1>Yamil got it Eeryone's favorite.

166
00:08:04.040 --> 00:08:07.279
<v Speaker 2>Huh Well, it gets the job done first, though you

167
00:08:07.360 --> 00:08:09.920
<v Speaker 2>need a cluster. A really great option, especially when you're

168
00:08:09.920 --> 00:08:14.319
<v Speaker 2>starting out, is a managed service think Google Kubernetes Engine GK,

169
00:08:15.240 --> 00:08:17.680
<v Speaker 2>aws eks Azure AKS.

170
00:08:17.839 --> 00:08:20.600
<v Speaker 1>Takes away some of the underlying management pain exactly.

171
00:08:21.000 --> 00:08:24.639
<v Speaker 2>Gk's autopilot mode is particularly neat because it handles the

172
00:08:24.680 --> 00:08:27.680
<v Speaker 2>node management for you. You just focus on your workloads.

173
00:08:27.720 --> 00:08:31.319
<v Speaker 1>Okay, so clusteretty quebectl is set up and authenticated. Then

174
00:08:31.360 --> 00:08:31.920
<v Speaker 1>what then?

175
00:08:32.000 --> 00:08:34.240
<v Speaker 2>You need to get your container image somewhere kubernets can

176
00:08:34.240 --> 00:08:36.919
<v Speaker 2>pull it from. That's a container registry like Docker Hub,

177
00:08:36.919 --> 00:08:40.759
<v Speaker 2>Google Container Registry, AWSCR, et cetera. You push your image there,

178
00:08:41.039 --> 00:08:44.480
<v Speaker 2>then you take your deployment yammo file, the one describing

179
00:08:44.480 --> 00:08:47.360
<v Speaker 2>your application how many replicas you want which image to use,

180
00:08:47.879 --> 00:08:50.039
<v Speaker 2>and you just run quebec to all apply dasheff your

181
00:08:50.080 --> 00:08:51.600
<v Speaker 2>dash appoyment dot YAMO.

182
00:08:51.360 --> 00:08:54.360
<v Speaker 1>And Kubernetes just makes that happen pretty much.

183
00:08:54.440 --> 00:08:56.679
<v Speaker 2>It reads your desired state from the YAML and then

184
00:08:56.840 --> 00:08:59.639
<v Speaker 2>works tirelessly in the background to make the cluster's actual

185
00:08:59.679 --> 00:09:01.919
<v Speaker 2>state match that. It's constantly reconciling.

186
00:09:02.080 --> 00:09:06.480
<v Speaker 1>Okay, but what if things go wrong? Because you know they.

187
00:09:06.320 --> 00:09:09.399
<v Speaker 2>Sometimes do, oh for sure, troubleshooting is key. You'll see

188
00:09:09.399 --> 00:09:12.240
<v Speaker 2>some common errors air image pull that usually means a

189
00:09:12.279 --> 00:09:15.639
<v Speaker 2>typo in the image name in your Yamel, or maybe

190
00:09:15.720 --> 00:09:18.919
<v Speaker 2>Kubernetes doesn't have permission to pull from your registry.

191
00:09:18.559 --> 00:09:20.039
<v Speaker 1>Right authentication exactly.

192
00:09:20.559 --> 00:09:24.000
<v Speaker 2>Or you might see stuck in pending that means Kubernetes

193
00:09:24.039 --> 00:09:26.519
<v Speaker 2>wants to schedule your POD, but it can't find a

194
00:09:26.559 --> 00:09:29.720
<v Speaker 2>node with enough resources cpu memory available.

195
00:09:29.320 --> 00:09:31.279
<v Speaker 1>For it AH capacity issue.

196
00:09:31.399 --> 00:09:34.519
<v Speaker 2>Yeah, and then there's the classic crash loop back off

197
00:09:34.720 --> 00:09:38.360
<v Speaker 2>that tells you your container is starting crashing, restarting, crashing.

198
00:09:38.120 --> 00:09:39.759
<v Speaker 1>Again, usually an application bug.

199
00:09:39.799 --> 00:09:43.240
<v Speaker 2>Then often yeah, or maybe it's missing a configuration or

200
00:09:43.320 --> 00:09:46.519
<v Speaker 2>can't connect to a database. It depends on something inside

201
00:09:46.519 --> 00:09:48.480
<v Speaker 2>the container is failing repeatedly.

202
00:09:48.679 --> 00:09:49.639
<v Speaker 1>So how do you debug that?

203
00:09:49.720 --> 00:09:52.759
<v Speaker 2>Peek inside YEP, quebec dol exec is your friend. There.

204
00:09:52.960 --> 00:09:55.440
<v Speaker 2>It lets you get a shell right inside the running containers.

205
00:09:55.480 --> 00:09:59.080
<v Speaker 2>You can poke around, check files, run commands okay.

206
00:09:58.840 --> 00:10:02.240
<v Speaker 1>And Quebeca logs FP is essential. It streams the logs

207
00:10:02.240 --> 00:10:04.720
<v Speaker 1>from your container in real time, so you can see

208
00:10:04.759 --> 00:10:08.240
<v Speaker 1>exactly what error messages your application is spitting out.

209
00:10:08.360 --> 00:10:12.399
<v Speaker 2>Got it? So we deploy, maybe debug a bit. How

210
00:10:12.399 --> 00:10:14.960
<v Speaker 2>do we actually make the application accessible? Like, give it

211
00:10:15.000 --> 00:10:15.799
<v Speaker 2>an IP address.

212
00:10:15.919 --> 00:10:18.399
<v Speaker 1>That's where the service object comes in. You create a

213
00:10:18.440 --> 00:10:21.440
<v Speaker 1>service yammal. If you want external access from the Internet,

214
00:10:21.559 --> 00:10:25.000
<v Speaker 1>you typically use a load balancer type service. The cloud

215
00:10:25.000 --> 00:10:27.919
<v Speaker 1>provider will automatically provision a load balancer and give you

216
00:10:28.000 --> 00:10:29.559
<v Speaker 1>an external IP okay.

217
00:10:29.600 --> 00:10:32.159
<v Speaker 2>And for internal stuff like micro service is talking to

218
00:10:32.200 --> 00:10:32.600
<v Speaker 2>each other.

219
00:10:32.799 --> 00:10:35.759
<v Speaker 1>For that, you'd use a cluster IP type service. It

220
00:10:35.759 --> 00:10:38.679
<v Speaker 1>gives you a stable internal IP address that other pods

221
00:10:38.679 --> 00:10:42.080
<v Speaker 1>within the cluster can use to reach your application. The

222
00:10:42.120 --> 00:10:45.200
<v Speaker 1>service uses labels, simple key value pairs you put on

223
00:10:45.240 --> 00:10:47.480
<v Speaker 1>your pods to know which pods to send traffic to.

224
00:10:47.759 --> 00:10:50.080
<v Speaker 2>Labels and selectors right exactly.

225
00:10:49.919 --> 00:10:53.320
<v Speaker 1>And the beauty of this declarative approach Updating your application

226
00:10:53.440 --> 00:10:55.960
<v Speaker 1>is super simple. How so you just update the image

227
00:10:55.960 --> 00:10:58.080
<v Speaker 1>tag in your deployment yammo file to point to your

228
00:10:58.120 --> 00:11:01.080
<v Speaker 1>new container image version. Then you run a quebecle apply

229
00:11:01.120 --> 00:11:04.159
<v Speaker 1>to f again with the updated file, and Kubernetes handles

230
00:11:04.159 --> 00:11:05.039
<v Speaker 1>the rollout yep.

231
00:11:05.320 --> 00:11:08.960
<v Speaker 2>It performs a rolling update by default, gradually replacing old

232
00:11:09.000 --> 00:11:11.759
<v Speaker 2>pods with new ones. You can even watch the progress

233
00:11:11.879 --> 00:11:16.679
<v Speaker 2>live using watchteled de quebectl get deployed. It's remarkably smooth.

234
00:11:17.000 --> 00:11:21.080
<v Speaker 1>That's incredibly powerful, that automated reconciliation and rollout, But just

235
00:11:21.080 --> 00:11:24.399
<v Speaker 1>getting it deployed isn't the whole story. How does Kubernetes

236
00:11:24.399 --> 00:11:27.360
<v Speaker 1>make sure our apps actually stay up and running even

237
00:11:27.399 --> 00:11:29.759
<v Speaker 1>if things go wrong or during those updates? Right?

238
00:11:29.840 --> 00:11:34.519
<v Speaker 2>This is where automated operations and health checks become really critical.

239
00:11:34.879 --> 00:11:37.639
<v Speaker 2>Kubernetes already gives you that basic self healing. We talked

240
00:11:37.639 --> 00:11:41.600
<v Speaker 2>about restarting crash containers, rescheduling pods from dead nodes yea.

241
00:11:41.799 --> 00:11:45.480
<v Speaker 2>But to be smarter than just basic restarts, Kubernetes needs

242
00:11:45.480 --> 00:11:48.840
<v Speaker 2>signals from your application about its actual health. And that's

243
00:11:48.840 --> 00:11:49.840
<v Speaker 2>where probes come in.

244
00:11:49.960 --> 00:11:51.440
<v Speaker 1>Probes Okay, what kinds are there?

245
00:11:51.519 --> 00:11:54.360
<v Speaker 2>There? Are two main types you'll use constantly, liveness probes

246
00:11:54.399 --> 00:11:55.320
<v Speaker 2>and readiness probes.

247
00:11:55.360 --> 00:11:57.000
<v Speaker 1>Liveness and readiness what's the difference.

248
00:11:57.200 --> 00:12:01.120
<v Speaker 2>Aliveness probe tells Kubernetes, is this app location still alive

249
00:12:01.200 --> 00:12:05.960
<v Speaker 2>and functioning? If the liveness probe fails, maybe your app

250
00:12:06.000 --> 00:12:09.600
<v Speaker 2>is deadlocked or hung. Kubernetes nose it needs to restart

251
00:12:09.679 --> 00:12:11.320
<v Speaker 2>that container to try and recover it.

252
00:12:11.440 --> 00:12:15.200
<v Speaker 1>Okay, so liveness restart if broken exactly now.

253
00:12:15.200 --> 00:12:18.240
<v Speaker 2>A readiness probe tells Kubernetes, is this application ready to

254
00:12:18.360 --> 00:12:20.080
<v Speaker 2>actually serve traffic right now?

255
00:12:20.559 --> 00:12:23.559
<v Speaker 1>Ah? So it might be alive but not quite ready,

256
00:12:23.600 --> 00:12:25.120
<v Speaker 1>like still starting up precisely.

257
00:12:25.559 --> 00:12:28.919
<v Speaker 2>Think about an application that needs to load data or

258
00:12:28.960 --> 00:12:31.919
<v Speaker 2>warm up caches when it starts. It might be running,

259
00:12:32.159 --> 00:12:34.799
<v Speaker 2>so the liveness probe passes, but it's not ready to

260
00:12:34.840 --> 00:12:37.480
<v Speaker 2>handle user requests yet, right okay. If the readiness probe

261
00:12:37.480 --> 00:12:40.639
<v Speaker 2>isn't passing, Kubernetes won't send any traffic to that pod.

262
00:12:41.120 --> 00:12:44.919
<v Speaker 2>This is absolutely crucial for achieving zero downtime updates.

263
00:12:44.559 --> 00:12:46.879
<v Speaker 1>Because it waits until the new pod is actually ready

264
00:12:46.879 --> 00:12:48.559
<v Speaker 1>before sending users to it.

265
00:12:48.639 --> 00:12:51.000
<v Speaker 2>You got it. No user ever hits an application that's

266
00:12:51.000 --> 00:12:53.279
<v Speaker 2>still in the middle of booting up. Get your readiness

267
00:12:53.320 --> 00:12:56.879
<v Speaker 2>probes right, and you unlock those seamless, zero downtime deployments.

268
00:12:56.919 --> 00:12:58.919
<v Speaker 2>It's a massive win for user experience.

269
00:12:59.159 --> 00:13:03.320
<v Speaker 1>That makes perfect sense. So assuming we've got those readiness

270
00:13:03.399 --> 00:13:05.960
<v Speaker 1>checks nailed, ensuring no one sees a half baked app,

271
00:13:06.480 --> 00:13:09.039
<v Speaker 1>what are the different ways we can actually roll out updates?

272
00:13:09.360 --> 00:13:11.600
<v Speaker 1>You mentioned rolling updates, but are there other strategies?

273
00:13:11.919 --> 00:13:14.440
<v Speaker 2>Yeah, there are a few main ones. Rolling update is

274
00:13:14.480 --> 00:13:17.240
<v Speaker 2>the default, like I said, and honestly it's the best

275
00:13:17.320 --> 00:13:19.919
<v Speaker 2>choice for most typical web services.

276
00:13:20.039 --> 00:13:20.879
<v Speaker 1>How does it work again?

277
00:13:21.480 --> 00:13:25.600
<v Speaker 2>It updates pods incrementally in batches. It ensures a certain

278
00:13:25.639 --> 00:13:28.440
<v Speaker 2>number always available, brings up new ones, waits for them

279
00:13:28.480 --> 00:13:32.279
<v Speaker 2>to be ready thanks to readiness probes, then terminates old ones.

280
00:13:33.080 --> 00:13:36.000
<v Speaker 2>It's smooth, continuous.

281
00:13:35.399 --> 00:13:37.200
<v Speaker 1>Okay, keeps the service up the whole time.

282
00:13:37.279 --> 00:13:40.080
<v Speaker 2>What else, Well, there's the blue green strategy. This is

283
00:13:40.159 --> 00:13:43.039
<v Speaker 2>quite different. You deploy the entire new version, the green

284
00:13:43.159 --> 00:13:46.480
<v Speaker 2>version completely separate from the currently running blue versions.

285
00:13:46.200 --> 00:13:47.759
<v Speaker 1>So both are running at the same time.

286
00:13:47.639 --> 00:13:50.559
<v Speaker 2>For a period. Yes, once you're happy the green version

287
00:13:50.600 --> 00:13:53.559
<v Speaker 2>is working perfectly, you just switch the load balancer or

288
00:13:53.559 --> 00:13:56.120
<v Speaker 2>a router to point all traffic from blue to green.

289
00:13:56.240 --> 00:13:59.279
<v Speaker 1>Instantly instant cutover zero downtime.

290
00:13:59.279 --> 00:14:03.320
<v Speaker 2>There too, presume YEP, zero downtime. The big advantage is

291
00:14:03.440 --> 00:14:06.320
<v Speaker 2>instant rollback. If Green has issues, just flip the switch

292
00:14:06.399 --> 00:14:10.559
<v Speaker 2>back to Blue. The downside you need roughly double the

293
00:14:10.600 --> 00:14:14.039
<v Speaker 2>infrastructure resources during the transition period, which can be costly.

294
00:14:14.320 --> 00:14:18.000
<v Speaker 1>Right, running two full copies makes sense any other options.

295
00:14:18.080 --> 00:14:21.639
<v Speaker 2>There's also the simpler recreate strategy. This one just well,

296
00:14:21.759 --> 00:14:23.720
<v Speaker 2>it kills all the old pods first and then it

297
00:14:23.759 --> 00:14:24.759
<v Speaker 2>creates all the new ones.

298
00:14:24.879 --> 00:14:26.639
<v Speaker 1>WHOA okay, so that definitely means.

299
00:14:26.399 --> 00:14:29.879
<v Speaker 2>Downtime guaranteed downtime, yes, okay, but it's simple, and sometimes

300
00:14:29.879 --> 00:14:32.919
<v Speaker 2>it's necessary if the old and new versions are incompatible

301
00:14:32.960 --> 00:14:36.600
<v Speaker 2>and can't run side by side for some reason. But generally,

302
00:14:36.840 --> 00:14:39.360
<v Speaker 2>rolling update is your go to workhoorse.

303
00:14:38.960 --> 00:14:44.039
<v Speaker 1>Fantastic breakdown Okay. Beyond keeping things running, another huge concern

304
00:14:44.200 --> 00:14:47.840
<v Speaker 1>is efficiency. How do we stop our apps from hogging resources,

305
00:14:47.919 --> 00:14:51.480
<v Speaker 1>wasting money, or maybe even impacting other applications running on

306
00:14:51.519 --> 00:14:52.240
<v Speaker 1>the same cluster.

307
00:14:52.519 --> 00:14:56.799
<v Speaker 2>Resource management absolutely fundamental in Kubernetes, and you can figure

308
00:14:56.799 --> 00:14:59.840
<v Speaker 2>this right in your pod specification using requests and limits

309
00:14:59.840 --> 00:15:01.559
<v Speaker 2>for CPU and memory.

310
00:15:01.360 --> 00:15:03.879
<v Speaker 1>Requests and limits, what do they each do think of.

311
00:15:03.879 --> 00:15:07.759
<v Speaker 2>Requests as telling the Kubernetes scheduler, Okay, to run reliably,

312
00:15:07.960 --> 00:15:10.399
<v Speaker 2>this pod needs at least this much CPU and this

313
00:15:10.559 --> 00:15:14.679
<v Speaker 2>much memory. It's a guarantee. The scheduler uses this info

314
00:15:14.799 --> 00:15:16.720
<v Speaker 2>to decide where to place your pod on a node

315
00:15:16.720 --> 00:15:19.080
<v Speaker 2>that actually has those resources available, so.

316
00:15:19.039 --> 00:15:21.759
<v Speaker 1>It ensures the pod gets what it needs to start exactly.

317
00:15:22.399 --> 00:15:26.399
<v Speaker 2>Limits, on the other hand, define the absolute maximum resources

318
00:15:26.440 --> 00:15:29.080
<v Speaker 2>a pod is allowed to consume. If a pod tries

319
00:15:29.120 --> 00:15:31.919
<v Speaker 2>to use more memory than its limit, Kubernetes will likely

320
00:15:32.000 --> 00:15:34.639
<v Speaker 2>kill it. Oh killed out of memory?

321
00:15:34.679 --> 00:15:37.080
<v Speaker 1>Killed, okay, hard stop for memory? What about CPU?

322
00:15:37.360 --> 00:15:40.600
<v Speaker 2>If it exceeds its CPU limit, it just gets throttled.

323
00:15:40.720 --> 00:15:43.039
<v Speaker 2>It won't be killed, but its performance will be capped.

324
00:15:43.039 --> 00:15:44.759
<v Speaker 1>So setting both gives you predictability.

325
00:15:44.799 --> 00:15:48.919
<v Speaker 2>Precisely, it defines a quality of service or QoS class

326
00:15:48.919 --> 00:15:52.759
<v Speaker 2>for your pod. Kubernetes uses these values constantly to manage

327
00:15:52.799 --> 00:15:56.000
<v Speaker 2>resource contention on the nodes. It might even evict lower

328
00:15:56.000 --> 00:15:58.960
<v Speaker 2>priority pods that are exceeding their request just to protect

329
00:15:59.039 --> 00:15:59.960
<v Speaker 2>higher priority one.

330
00:16:00.120 --> 00:16:02.120
<v Speaker 1>You can set priorities YEP, using something.

331
00:16:01.919 --> 00:16:04.960
<v Speaker 2>Called priority class. So how do you figure out the

332
00:16:05.039 --> 00:16:08.679
<v Speaker 2>right values? Best practices usually start a bit generous with

333
00:16:08.720 --> 00:16:10.240
<v Speaker 2>your requests and limits.

334
00:16:10.519 --> 00:16:14.679
<v Speaker 1>Okay, then use monitoring tools absolutely essential to observe how

335
00:16:14.759 --> 00:16:18.320
<v Speaker 1>much CPU and memory your application actually uses under load,

336
00:16:18.519 --> 00:16:22.120
<v Speaker 1>and then tune them down exactly. Fine tune those requests

337
00:16:22.120 --> 00:16:25.639
<v Speaker 1>and limits to match reality, avoiding waste but still giving

338
00:16:25.679 --> 00:16:28.399
<v Speaker 1>your app what it needs. Quick tip for web apps,

339
00:16:29.039 --> 00:16:31.399
<v Speaker 1>you can often set the CPU limit higher than the

340
00:16:31.399 --> 00:16:32.200
<v Speaker 1>CPU request.

341
00:16:32.399 --> 00:16:33.720
<v Speaker 2>Oh why is that?

342
00:16:33.840 --> 00:16:36.960
<v Speaker 1>It allows your app to burst to temporarily use more

343
00:16:37.039 --> 00:16:40.600
<v Speaker 1>CPU if the node has spare capacity available. Good for

344
00:16:40.639 --> 00:16:44.320
<v Speaker 1>handling short spikes and traffic without over provisioning the guaranteed

345
00:16:44.320 --> 00:16:45.200
<v Speaker 1>request all the time.

346
00:16:45.279 --> 00:16:49.600
<v Speaker 2>That's a really smart optimization balancing guarantees with burst potential. Okay,

347
00:16:49.600 --> 00:16:52.399
<v Speaker 2>speaking of capacity and spikes, how do we handle that

348
00:16:52.480 --> 00:16:57.039
<v Speaker 2>viral moment we talked about where traffic just explodes? Or conversely,

349
00:16:57.120 --> 00:16:59.360
<v Speaker 2>how do we save money when things are quiet? How

350
00:16:59.360 --> 00:17:01.200
<v Speaker 2>does Kubernety automate the scaling part?

351
00:17:01.440 --> 00:17:04.759
<v Speaker 1>Right? Automatic scaling? Kubernates gives you two main tools here

352
00:17:05.160 --> 00:17:08.559
<v Speaker 1>for scaling your application pods horizontally. There's the Horizontal Pod

353
00:17:08.799 --> 00:17:10.440
<v Speaker 1>Autoscaler or HPA.

354
00:17:10.720 --> 00:17:12.880
<v Speaker 2>HPA, what does it look at? The most common metric

355
00:17:12.960 --> 00:17:16.759
<v Speaker 2>is CPU utilization? You can say, okay, if the average

356
00:17:16.759 --> 00:17:19.880
<v Speaker 2>CPU across all my pods goes above sixty percent.

357
00:17:20.160 --> 00:17:22.160
<v Speaker 1>Add more pods, simple enough.

358
00:17:22.000 --> 00:17:24.559
<v Speaker 2>But it's way more flexible than just CPU. You can

359
00:17:24.559 --> 00:17:28.799
<v Speaker 2>configure HPAs to scale based on memory usage or even

360
00:17:28.880 --> 00:17:32.599
<v Speaker 2>custom metrics like request per second hitting your service, or

361
00:17:32.839 --> 00:17:35.119
<v Speaker 2>maybe the number of messages sitting in a queue that

362
00:17:35.160 --> 00:17:36.880
<v Speaker 2>your workers need to process, so.

363
00:17:36.799 --> 00:17:40.599
<v Speaker 1>You can tie scaling directly to your application's actual load drivers.

364
00:17:40.319 --> 00:17:44.279
<v Speaker 2>Exactly makes it much more responsive inefficient. Now that's scaling

365
00:17:44.319 --> 00:17:47.680
<v Speaker 2>your pods. What about the underlying machines, the nodes.

366
00:17:47.799 --> 00:17:49.599
<v Speaker 1>Yeah, if you add more pods, you might run at

367
00:17:49.640 --> 00:17:52.079
<v Speaker 1>a node capacity right back to that pending state.

368
00:17:52.200 --> 00:17:55.839
<v Speaker 2>Precisely, that's where the cluster autoscaler comes in. This is

369
00:17:55.920 --> 00:17:59.400
<v Speaker 2>usually component provided by your cloud provider or installed separately.

370
00:18:00.039 --> 00:18:02.200
<v Speaker 2>Watches for pods that are stuck and pending because of

371
00:18:02.240 --> 00:18:05.799
<v Speaker 2>resource constraints, and it automatically adds more nodes to the

372
00:18:05.799 --> 00:18:09.000
<v Speaker 2>cluster to accommodate them nice and just as importantly, if

373
00:18:09.079 --> 00:18:12.359
<v Speaker 2>nodes become underutilized for a while, it will consolidate the

374
00:18:12.359 --> 00:18:15.359
<v Speaker 2>pods onto fewer nodes and then terminate the unnecessary ones

375
00:18:15.359 --> 00:18:15.880
<v Speaker 2>to save.

376
00:18:15.759 --> 00:18:18.519
<v Speaker 1>Costs, So it scales the infrastructure up and down too,

377
00:18:18.960 --> 00:18:19.480
<v Speaker 1>very cool.

378
00:18:19.720 --> 00:18:23.279
<v Speaker 2>What about really fast scaling needs like almost instant?

379
00:18:23.480 --> 00:18:27.240
<v Speaker 1>Ah? Yeah, for super rapid scaling, there's a clever technique

380
00:18:27.319 --> 00:18:30.960
<v Speaker 1>using placeholder pods. You deploy these special pods with a

381
00:18:31.079 --> 00:18:35.160
<v Speaker 1>very low priority. They basically just sit there consuming resources

382
00:18:35.240 --> 00:18:39.160
<v Speaker 1>in occupying space. Okay. Why because when your real application

383
00:18:39.319 --> 00:18:41.839
<v Speaker 1>needs to scale up quickly due to a sudden spike,

384
00:18:42.240 --> 00:18:46.160
<v Speaker 1>its new higher priority pods can immediately preempt those low

385
00:18:46.160 --> 00:18:50.119
<v Speaker 1>priority placeholder pods they get kicked out, freeing up resources

386
00:18:50.160 --> 00:18:53.319
<v Speaker 1>instantly for your critical application. It gives you immediate headroom

387
00:18:53.480 --> 00:18:55.440
<v Speaker 1>without waiting for new nodes to spin up.

388
00:18:55.559 --> 00:18:58.400
<v Speaker 2>That's a neat trick. So underlying all this scaling tech,

389
00:18:58.480 --> 00:19:01.400
<v Speaker 2>what's the most important design pile for building an application

390
00:19:01.440 --> 00:19:02.599
<v Speaker 2>that can actually scale like this?

391
00:19:02.960 --> 00:19:05.920
<v Speaker 1>Oh? Hands down, the single most important thing is avoiding

392
00:19:05.960 --> 00:19:10.640
<v Speaker 1>local state. Your application replicas need to be stateless.

393
00:19:10.400 --> 00:19:14.720
<v Speaker 2>Meaning any replica can handle any incoming request without needing

394
00:19:14.759 --> 00:19:18.359
<v Speaker 2>specific data stored only on that particular instance or data

395
00:19:18.440 --> 00:19:22.039
<v Speaker 2>from another specific instance. All the necessary state should be

396
00:19:22.119 --> 00:19:26.200
<v Speaker 2>external in a database, a cache, object, storage, whatever.

397
00:19:26.319 --> 00:19:29.799
<v Speaker 1>Because if any replica can handle any request, Kubernetes can

398
00:19:29.839 --> 00:19:32.880
<v Speaker 1>just add or remove replicas without worrying about losing data

399
00:19:32.960 --> 00:19:34.559
<v Speaker 1>or breaking user sessions exactly.

400
00:19:34.559 --> 00:19:38.400
<v Speaker 2>It makes scaling effortless. Statelessness is foundational.

401
00:19:37.920 --> 00:19:41.680
<v Speaker 1>Okay, critical point, But as you said, many apps do

402
00:19:41.720 --> 00:19:45.759
<v Speaker 1>have state, especially databases. Any specific gotchas to watch out

403
00:19:45.799 --> 00:19:46.680
<v Speaker 1>for when scaling those?

404
00:19:46.680 --> 00:19:49.359
<v Speaker 2>Oh yeah, databases bring their own challenges at scale. Watch

405
00:19:49.400 --> 00:19:52.119
<v Speaker 2>out for things like the n plus one query problem.

406
00:19:52.119 --> 00:19:54.960
<v Speaker 2>That's where say, fetching a list of one hundred items

407
00:19:54.960 --> 00:19:57.720
<v Speaker 2>accidentally triggers under and one database queries instead of just

408
00:19:57.759 --> 00:20:01.440
<v Speaker 2>one or two kills performance seen that one before. Common

409
00:20:01.440 --> 00:20:05.279
<v Speaker 2>strategies are using database read replicas. Send all your select

410
00:20:05.319 --> 00:20:08.039
<v Speaker 2>queries your reads to replicas to take the load off

411
00:20:08.079 --> 00:20:13.359
<v Speaker 2>your primary right database. Also think about primary keys at

412
00:20:13.440 --> 00:20:17.759
<v Speaker 2>massive scale, simple auto incrementing integers can become a bottleneck

413
00:20:17.839 --> 00:20:21.680
<v Speaker 2>because every insert wants the next ID, causing lock contention.

414
00:20:22.000 --> 00:20:23.599
<v Speaker 1>So what's the alternative.

415
00:20:23.279 --> 00:20:27.720
<v Speaker 2>Using u abyss's universally unique identifiers. They're random, so inserts

416
00:20:27.759 --> 00:20:31.240
<v Speaker 2>are spread out, reducing contention. And while it's a bigger

417
00:20:31.319 --> 00:20:35.680
<v Speaker 2>architectural decision, splitting your application into smaller micro services can

418
00:20:35.720 --> 00:20:38.200
<v Speaker 2>sometimes help. How so it lets different parts of your

419
00:20:38.200 --> 00:20:42.039
<v Speaker 2>system scale independently. Maybe your user authentication service needs way

420
00:20:42.079 --> 00:20:44.640
<v Speaker 2>more replicas than your reporting service. Micro services allow that

421
00:20:44.640 --> 00:20:49.119
<v Speaker 2>plus independent development cycles, but it definitely adds complexity, especially

422
00:20:49.119 --> 00:20:52.119
<v Speaker 2>around debugging and interservice communication. It's a tradeoff.

423
00:20:52.319 --> 00:20:56.279
<v Speaker 1>Not a magic bullet makes sense. Okay, we've covered building scalable,

424
00:20:56.319 --> 00:21:00.000
<v Speaker 1>resilient apps. Let's shift gears a bit to more complex

425
00:21:00.160 --> 00:21:03.920
<v Speaker 1>setups like those micro services and then securing everything. How

426
00:21:03.960 --> 00:21:07.000
<v Speaker 1>does Kubernetes actually handle the networking between all these different

427
00:21:07.039 --> 00:21:10.400
<v Speaker 1>services inside the cluster and how do they find each other?

428
00:21:10.839 --> 00:21:15.680
<v Speaker 2>Good question. Kubernetes has really robust internal services and load balancing.

429
00:21:15.799 --> 00:21:19.480
<v Speaker 2>First off, every single pod gets its own unique IP

430
00:21:19.640 --> 00:21:23.240
<v Speaker 2>address within the cluster, and if a pod has multiple containers,

431
00:21:23.319 --> 00:21:26.000
<v Speaker 2>they all share that same pod IP address.

432
00:21:26.039 --> 00:21:28.720
<v Speaker 1>Okay, so pods have ips, how do they find the

433
00:21:28.799 --> 00:21:30.960
<v Speaker 1>right IP for the service they need to talk to,

434
00:21:31.240 --> 00:21:32.680
<v Speaker 1>especially since POD's coming go.

435
00:21:32.960 --> 00:21:35.279
<v Speaker 2>That's where the service object comes in again, specifically the

436
00:21:35.279 --> 00:21:38.440
<v Speaker 2>cluster IP type we mentioned for internal communication the service

437
00:21:38.480 --> 00:21:41.359
<v Speaker 2>it's a stable virtual IP address. When a POD sends

438
00:21:41.400 --> 00:21:44.839
<v Speaker 2>traffic to that service IP, Kubernetes automatically load balances it

439
00:21:44.880 --> 00:21:48.000
<v Speaker 2>across all the healthy pods backing that service, the ones

440
00:21:48.000 --> 00:21:49.119
<v Speaker 2>with the matching labels, so.

441
00:21:49.079 --> 00:21:51.160
<v Speaker 1>The service IP stays the same even if the pod

442
00:21:51.160 --> 00:21:53.000
<v Speaker 1>ips change underneath exactly.

443
00:21:53.000 --> 00:21:56.599
<v Speaker 2>It provides that stable endpoint for actually finding that service.

444
00:21:56.640 --> 00:22:00.519
<v Speaker 2>IP pods typically use Kubernetes built in DNS service. They

445
00:22:00.519 --> 00:22:03.880
<v Speaker 2>can just resolve a predictable name like my backendservice dot,

446
00:22:03.920 --> 00:22:07.480
<v Speaker 2>my namespace, dot SVC, dot cluster, dot local, and DNS

447
00:22:07.519 --> 00:22:10.759
<v Speaker 2>gives them the right cluster IP so DNAs.

448
00:22:10.400 --> 00:22:14.000
<v Speaker 1>For discovery yeh neat. And what about getting traffic into

449
00:22:14.039 --> 00:22:16.039
<v Speaker 1>the cluster from the outside world, especially if you have

450
00:22:16.119 --> 00:22:17.640
<v Speaker 1>multiple services you want to expose.

451
00:22:17.880 --> 00:22:20.640
<v Speaker 2>That's the job of ingress. Think of ingress as an

452
00:22:20.680 --> 00:22:25.799
<v Speaker 2>intelligent HTTP and HTTPS load balancer or reverse proxy sitting

453
00:22:25.839 --> 00:22:26.839
<v Speaker 2>at the edge of your cluster.

454
00:22:26.960 --> 00:22:28.880
<v Speaker 1>What makes it intelligent It allows you.

455
00:22:28.839 --> 00:22:33.440
<v Speaker 2>To expose multiple internal services through a single external IP address.

456
00:22:33.839 --> 00:22:36.079
<v Speaker 2>You can define rules to route traffic based on the

457
00:22:36.119 --> 00:22:38.519
<v Speaker 2>requested path like goes to your front end service as

458
00:22:38.559 --> 00:22:41.119
<v Speaker 2>EP goes to your back end API service, or you

459
00:22:41.160 --> 00:22:43.279
<v Speaker 2>can route based on the host name requested, so.

460
00:22:43.319 --> 00:22:46.359
<v Speaker 1>One load balance er IP can serve multiple applications or

461
00:22:46.359 --> 00:22:47.880
<v Speaker 1>parts of applications correct.

462
00:22:47.920 --> 00:22:51.720
<v Speaker 2>And a really significant benefit of using ingress is TLS termination.

463
00:22:51.559 --> 00:22:55.000
<v Speaker 1>Meaning it handles the HTTPS encryption exactly.

464
00:22:55.319 --> 00:22:58.720
<v Speaker 2>The Ingress controller handles the SSLTLS handshake with the client,

465
00:22:59.079 --> 00:23:02.559
<v Speaker 2>decrups the traffic, and then forwards PLANYHGTP traffic to your

466
00:23:02.599 --> 00:23:06.079
<v Speaker 2>internal services. If you want, this offloads that CPU intensive

467
00:23:06.119 --> 00:23:09.160
<v Speaker 2>encryption work from your application pods, letting them focus purely

468
00:23:09.200 --> 00:23:09.680
<v Speaker 2>on their job.

469
00:23:10.000 --> 00:23:14.039
<v Speaker 1>That's a huge win for efficiency in simplifying application code. Okay,

470
00:23:14.079 --> 00:23:16.559
<v Speaker 1>this routing is powerful, but what if you have different

471
00:23:16.640 --> 00:23:19.480
<v Speaker 1>kinds of nodes in your cluster. Maybe some have GPUs,

472
00:23:19.799 --> 00:23:23.240
<v Speaker 1>some have faster disks, some are arm architecture. How do

473
00:23:23.240 --> 00:23:25.640
<v Speaker 1>you make sure the right workloads land on the right hardware.

474
00:23:25.759 --> 00:23:29.400
<v Speaker 2>Yeah, that's super common. You use node feature selection. Kubernetes

475
00:23:29.480 --> 00:23:31.839
<v Speaker 2>nodes can have labels applied to them, just like pods.

476
00:23:32.240 --> 00:23:35.960
<v Speaker 2>These labels describe their characteristics, things like kubernetest ioor Dot

477
00:23:36.000 --> 00:23:38.680
<v Speaker 2>AMD sixty four or cloud dot, Google dot Com for

478
00:23:38.960 --> 00:23:42.319
<v Speaker 2>GKSH Accelerator, dot Vidia Dash, Tesla DASHT four.

479
00:23:42.400 --> 00:23:45.359
<v Speaker 1>The labels identify node capabilities. How do you use them?

480
00:23:45.680 --> 00:23:48.680
<v Speaker 2>You use node selectors or the more powerful node affinity

481
00:23:48.759 --> 00:23:52.000
<v Speaker 2>rules in your POD specification. A node selector is simple,

482
00:23:52.440 --> 00:23:55.000
<v Speaker 2>only schedule this pod on nodes with the labeled disc

483
00:23:55.039 --> 00:23:59.039
<v Speaker 2>type SSD. Node affinity is more expressive. You can say

484
00:23:59.039 --> 00:24:01.519
<v Speaker 2>things like, I prefer nodes with GPUs, but it's okay

485
00:24:01.519 --> 00:24:04.319
<v Speaker 2>if none are available, or I require a node that's

486
00:24:04.359 --> 00:24:06.480
<v Speaker 2>in availability zone A central one.

487
00:24:06.519 --> 00:24:09.680
<v Speaker 1>A gives you fine grained control over placement. What about

488
00:24:09.680 --> 00:24:12.880
<v Speaker 1>the opposite, keeping certain workloads off specific nodes.

489
00:24:13.160 --> 00:24:16.160
<v Speaker 2>For that, you use taints and tolerations. You apply a

490
00:24:16.200 --> 00:24:18.799
<v Speaker 2>taint to a node, for example, tainting all your GPU

491
00:24:18.880 --> 00:24:22.319
<v Speaker 2>nodes by default, No pods will be scheduled onto a

492
00:24:22.319 --> 00:24:25.559
<v Speaker 2>tainted node unless that pod has a matching toleration in

493
00:24:25.599 --> 00:24:26.480
<v Speaker 2>its spec ah.

494
00:24:26.519 --> 00:24:29.480
<v Speaker 1>So it's like a repellent unless the pod has the antidote.

495
00:24:29.559 --> 00:24:32.039
<v Speaker 2>Good way to put it. It's perfect for isolating workloads

496
00:24:32.079 --> 00:24:35.519
<v Speaker 2>onto dedicated hardware, or maybe keeping general workloads off nodes

497
00:24:35.559 --> 00:24:36.920
<v Speaker 2>reserved for special.

498
00:24:36.559 --> 00:24:39.880
<v Speaker 1>Tasks, and for spreading things out for high availability, making

499
00:24:39.920 --> 00:24:42.359
<v Speaker 1>sure a single node failure doesn't hurt too much.

500
00:24:42.599 --> 00:24:46.119
<v Speaker 2>For that, you'd use topology spread constraints. These let you

501
00:24:46.160 --> 00:24:49.200
<v Speaker 2>tell Kubernetes try to spread the pods for this deployment

502
00:24:49.279 --> 00:24:52.880
<v Speaker 2>evenly across different nodes, or even better, spread them evenly

503
00:24:52.960 --> 00:24:58.480
<v Speaker 2>across different availability zones. It significantly improves resilience against localized failures.

504
00:24:58.559 --> 00:25:02.160
<v Speaker 1>Wow lots of control over placement and resilience. There. Yeah, okay,

505
00:25:02.200 --> 00:25:05.400
<v Speaker 1>let's tackle the big one again. State. We know stateless

506
00:25:05.440 --> 00:25:09.480
<v Speaker 1>is ideal for scaling, but many apps need state like databases.

507
00:25:10.039 --> 00:25:12.799
<v Speaker 1>How does Kubernetes handle persistent data storage reliably?

508
00:25:13.039 --> 00:25:16.359
<v Speaker 2>Kubernetes is actually very well equipped for stateful applications thanks

509
00:25:16.400 --> 00:25:19.440
<v Speaker 2>to its volume system. We mentioned empty for temporary scratch

510
00:25:19.440 --> 00:25:21.640
<v Speaker 2>based on the node and can fig maps for mounting

511
00:25:21.640 --> 00:25:25.359
<v Speaker 2>configuration files right. But for persistent data, the core concepts

512
00:25:25.400 --> 00:25:30.400
<v Speaker 2>are persistent volumes pvs and persistent volume claims PVCs.

513
00:25:30.480 --> 00:25:33.240
<v Speaker 1>PVS and PVCs explain those think of it like this.

514
00:25:34.079 --> 00:25:39.279
<v Speaker 2>A persistent volume PV represents an actual piece of storage

515
00:25:39.319 --> 00:25:42.279
<v Speaker 2>in your cluster, like a network disc provided by your

516
00:25:42.279 --> 00:25:46.880
<v Speaker 2>cloud provider. A persistent volume claim PVC is a request

517
00:25:46.880 --> 00:25:49.640
<v Speaker 2>for storage made by a POD, or rather by you

518
00:25:49.880 --> 00:25:52.799
<v Speaker 2>on behalf of the pod. The POD says I need

519
00:25:52.839 --> 00:25:55.759
<v Speaker 2>ten give of storage with these characteristics via the PVC.

520
00:25:55.920 --> 00:25:58.039
<v Speaker 1>So the PVC is the request, the PV is the

521
00:25:58.079 --> 00:25:59.799
<v Speaker 1>actual storage, fulfilling.

522
00:25:59.359 --> 00:26:03.039
<v Speaker 2>It exactly, and Kupernetes binds a suitable PV to the PVC.

523
00:26:03.559 --> 00:26:06.519
<v Speaker 2>This decouples the POD's need for storage from the specific

524
00:26:06.599 --> 00:26:10.240
<v Speaker 2>underlying storage implementation. Your pod just asks for what it needs.

525
00:26:10.839 --> 00:26:13.519
<v Speaker 1>How does the underlying storage actually get created? Does someone

526
00:26:13.519 --> 00:26:15.480
<v Speaker 1>have to manually create those cloud discs?

527
00:26:15.519 --> 00:26:18.079
<v Speaker 2>You can do it manually, but usually you use storage

528
00:26:18.119 --> 00:26:21.400
<v Speaker 2>classes for dynamic provisioning. A storage class defines a type

529
00:26:21.400 --> 00:26:25.039
<v Speaker 2>of storage like fast SSD or standard HDD, and tells

530
00:26:25.079 --> 00:26:27.759
<v Speaker 2>Kubinetes how to automatically provision a new PV and its

531
00:26:27.839 --> 00:26:30.559
<v Speaker 2>underlying cloud disc whenever a PVC.

532
00:26:30.240 --> 00:26:31.680
<v Speaker 1>Requests that class automation.

533
00:26:31.759 --> 00:26:34.720
<v Speaker 2>Again, Yes, and crucially, when you define your storage class

534
00:26:34.759 --> 00:26:37.240
<v Speaker 2>you can set its reclaim policy. Setting it to retain

535
00:26:37.359 --> 00:26:39.200
<v Speaker 2>is highly recommended for production data.

536
00:26:39.279 --> 00:26:40.160
<v Speaker 1>Why retain it.

537
00:26:40.160 --> 00:26:43.240
<v Speaker 2>Means even if you delete the PVC and PV objects

538
00:26:43.240 --> 00:26:47.039
<v Speaker 2>inside Kupernetes, the actual underlying cloud disc with your data

539
00:26:47.119 --> 00:26:49.839
<v Speaker 2>will not be deleted. It protects your precious data from

540
00:26:49.920 --> 00:26:53.480
<v Speaker 2>accidental quebectyl delete commands. You'd have to manually delete the

541
00:26:53.480 --> 00:26:54.000
<v Speaker 2>disc later.

542
00:26:54.160 --> 00:26:56.400
<v Speaker 1>That's a critical safety net. Okay, so that works for

543
00:26:56.640 --> 00:27:00.839
<v Speaker 1>single pods needing storage. What about clustered state apps like

544
00:27:00.880 --> 00:27:02.160
<v Speaker 1>a multnode database.

545
00:27:02.640 --> 00:27:06.200
<v Speaker 2>For those, Kubernetes provides the stateful set workload controller. It's

546
00:27:06.200 --> 00:27:10.599
<v Speaker 2>specifically designed for applications that need stable unique network identifiers

547
00:27:10.599 --> 00:27:14.279
<v Speaker 2>for each replica and stable persistent storage tied to each

548
00:27:14.319 --> 00:27:18.200
<v Speaker 2>specific replicaxable. How each pod in a stateful set gets

549
00:27:18.200 --> 00:27:21.119
<v Speaker 2>a predictable ordinal host name like my dB zero, my

550
00:27:21.200 --> 00:27:24.079
<v Speaker 2>dB one, my dB two, and it automatically creates a

551
00:27:24.079 --> 00:27:27.640
<v Speaker 2>dedicated PVC for each replica based on a template you provide,

552
00:27:27.960 --> 00:27:31.039
<v Speaker 2>So my dB zero always gets the same persistent disc

553
00:27:31.279 --> 00:27:32.920
<v Speaker 2>even if the pod gets rescheduled.

554
00:27:32.960 --> 00:27:35.960
<v Speaker 1>Perfect for things like database clusters or zoo keeper nodes.

555
00:27:36.319 --> 00:27:39.079
<v Speaker 2>Exactly what it's built for. And one more volume type

556
00:27:39.079 --> 00:27:44.799
<v Speaker 2>worth mentioning generic ephemeral volumes. These are useful for large

557
00:27:44.799 --> 00:27:47.960
<v Speaker 2>amounts of temporary data needed during a POD's lifetime, maybe

558
00:27:48.119 --> 00:27:52.160
<v Speaker 2>for some complex calculation. They provide mounted disk space, but

559
00:27:52.240 --> 00:27:55.480
<v Speaker 2>it's automatically cleaned up when the pod is deleted, faster

560
00:27:55.599 --> 00:27:57.640
<v Speaker 2>than empty eder for large amounts of data.

561
00:27:57.680 --> 00:28:00.680
<v Speaker 1>Sometimes, got it. So lots of options for state Now

562
00:28:00.680 --> 00:28:04.160
<v Speaker 1>what about all those background tasks things that aren't directly

563
00:28:04.200 --> 00:28:08.720
<v Speaker 1>serving user requests but are critical batge processing, image resizing,

564
00:28:08.839 --> 00:28:09.759
<v Speaker 1>sending newsletters.

565
00:28:10.119 --> 00:28:13.799
<v Speaker 2>Yeah, Kubernetes has excellent support for various kinds of background processing.

566
00:28:14.119 --> 00:28:17.759
<v Speaker 2>The approach depends on the type of task. Okay, like what, Well,

567
00:28:17.799 --> 00:28:20.319
<v Speaker 2>if you have a task que that needs to run continuously,

568
00:28:20.400 --> 00:28:23.000
<v Speaker 2>maybe processing jobs offloaded from your web front, and you

569
00:28:23.039 --> 00:28:26.079
<v Speaker 2>typically just use a standard deployment, you'd have worker pods

570
00:28:26.160 --> 00:28:29.920
<v Speaker 2>running your processing code constantly pulling tasks from an external

571
00:28:30.000 --> 00:28:32.039
<v Speaker 2>qu system like rehttis or Rabbit MQ.

572
00:28:32.400 --> 00:28:35.200
<v Speaker 1>So a deployment for continuous background work. What about tasks

573
00:28:35.200 --> 00:28:36.799
<v Speaker 1>that just run once and finish?

574
00:28:37.200 --> 00:28:40.400
<v Speaker 2>For those one off tasks like running a database migration

575
00:28:40.559 --> 00:28:45.119
<v Speaker 2>script or a specific batch analysis, the dedicated job object

576
00:28:45.160 --> 00:28:48.200
<v Speaker 2>is perfect. You define a job, Kubernetes runs the pod

577
00:28:48.279 --> 00:28:51.119
<v Speaker 2>associated with it until they complete successfully, and then the

578
00:28:51.200 --> 00:28:52.359
<v Speaker 2>job is marked as.

579
00:28:52.279 --> 00:28:55.160
<v Speaker 1>Finished and sure as it runs to completion. Can you

580
00:28:55.200 --> 00:28:57.799
<v Speaker 1>schedule these jobs like run a report every night?

581
00:28:58.000 --> 00:29:00.720
<v Speaker 2>Absolutely, That's what cron job is for. You define a

582
00:29:00.799 --> 00:29:03.720
<v Speaker 2>job template and provide a schedule using the standard Unix

583
00:29:03.759 --> 00:29:07.240
<v Speaker 2>Kron format like zero two for two am every day.

584
00:29:07.880 --> 00:29:10.240
<v Speaker 2>Kubernetes takes care of creating a new job based on

585
00:29:10.240 --> 00:29:10.839
<v Speaker 2>that schedule.

586
00:29:11.079 --> 00:29:14.880
<v Speaker 1>Very handy. Can jobs handle like processing a fixed list

587
00:29:14.920 --> 00:29:15.960
<v Speaker 1>of items in parallel?

588
00:29:16.079 --> 00:29:18.160
<v Speaker 2>Yes, they can do that too. You can configure a

589
00:29:18.240 --> 00:29:21.680
<v Speaker 2>job for a static work queue using parameters like completions,

590
00:29:21.759 --> 00:29:24.880
<v Speaker 2>the total number of tasks to complete and parallelism how

591
00:29:24.880 --> 00:29:27.799
<v Speaker 2>many plots should run simultaneously. Each pod gets an environment

592
00:29:27.880 --> 00:29:30.759
<v Speaker 2>variable job completion index, which you can use to figure

593
00:29:30.759 --> 00:29:33.440
<v Speaker 2>out which specific item from the list it's supposed to process.

594
00:29:33.519 --> 00:29:36.519
<v Speaker 1>Lever and do these background tasks need health checks too?

595
00:29:37.000 --> 00:29:40.839
<v Speaker 2>Like liveness probes, they definitely can and often should. Even

596
00:29:40.880 --> 00:29:43.960
<v Speaker 2>a background worker can get stuck or hang. You could,

597
00:29:43.960 --> 00:29:46.960
<v Speaker 2>for example, have a command based liveness probe that checks

598
00:29:47.000 --> 00:29:48.960
<v Speaker 2>the timestamp on a file the worker is supposed to

599
00:29:49.039 --> 00:29:52.200
<v Speaker 2>update periodically. If the file gets too old, the probe

600
00:29:52.200 --> 00:29:56.079
<v Speaker 2>fails and Kubernetes restarts the worker, ensuring your background processing

601
00:29:56.119 --> 00:29:57.519
<v Speaker 2>doesn't just silently.

602
00:29:57.079 --> 00:30:01.480
<v Speaker 1>Stop reliability everywhere. This is amazing, but it also sounds

603
00:30:01.519 --> 00:30:07.759
<v Speaker 1>like a lot of yammal files, deployments, services, jobs, cron jobs, PVCs.

604
00:30:08.319 --> 00:30:11.720
<v Speaker 1>How do people manage all this configuration consistently, especially across

605
00:30:11.759 --> 00:30:15.559
<v Speaker 1>different environments like staging in production, and keep it secure.

606
00:30:15.839 --> 00:30:18.400
<v Speaker 2>That is a huge challenge, and it leads us directly

607
00:30:18.440 --> 00:30:21.200
<v Speaker 2>to a really important practice called git ops get ups.

608
00:30:21.240 --> 00:30:23.440
<v Speaker 1>So using Git for operations.

609
00:30:23.039 --> 00:30:26.799
<v Speaker 2>Essentially, yes, it means treating your Kubernetes configuration all those

610
00:30:26.880 --> 00:30:30.079
<v Speaker 2>yammo files as code. You store them in a Git repository.

611
00:30:30.160 --> 00:30:31.880
<v Speaker 1>Ah, okay, what are the benefits?

612
00:30:31.880 --> 00:30:35.640
<v Speaker 2>Massive benefits. First, you get version control for your infrastructure configuration.

613
00:30:36.039 --> 00:30:38.359
<v Speaker 2>You have a history of every change. You can do

614
00:30:38.400 --> 00:30:42.160
<v Speaker 2>code reviews for infrastructure changes, just like application code Collaboration

615
00:30:42.279 --> 00:30:43.640
<v Speaker 2>becomes much easier.

616
00:30:43.400 --> 00:30:45.400
<v Speaker 1>Makes sense, audit trail rollbacks.

617
00:30:45.119 --> 00:30:48.400
<v Speaker 2>Exactly, and it makes spinning up multiple environments super easy.

618
00:30:49.000 --> 00:30:51.759
<v Speaker 2>You can have branches or directories in your Git repo

619
00:30:51.839 --> 00:30:55.960
<v Speaker 2>for production, staging, development, etc. Perhaps using tools like customize

620
00:30:56.039 --> 00:30:59.119
<v Speaker 2>or helm to manage the differences, but pulling from the

621
00:30:59.119 --> 00:31:00.000
<v Speaker 2>same core.

622
00:31:00.039 --> 00:31:04.480
<v Speaker 1>Figuration consistency across environments. How does the deployment part work

623
00:31:04.519 --> 00:31:05.160
<v Speaker 1>with gitups?

624
00:31:05.559 --> 00:31:09.400
<v Speaker 2>Typically, a Git push to the repository triggers an automated pipeline,

625
00:31:09.440 --> 00:31:13.559
<v Speaker 2>maybe using Jenkins get lab ci GitHub actions that applies

626
00:31:13.559 --> 00:31:16.680
<v Speaker 2>the changes to the target Kubernetes cluster using Quebec del play,

627
00:31:17.319 --> 00:31:20.359
<v Speaker 2>or even better, you can use a dedicated gitups operator

628
00:31:20.440 --> 00:31:23.279
<v Speaker 2>like flux or rgocd running inside your cluster.

629
00:31:23.359 --> 00:31:24.079
<v Speaker 1>How's that work?

630
00:31:24.480 --> 00:31:28.680
<v Speaker 2>The operator continuously monitors your Git repository and automatically reconciles

631
00:31:28.720 --> 00:31:31.599
<v Speaker 2>the cluster's state to match whatever is defined and get.

632
00:31:32.160 --> 00:31:34.960
<v Speaker 2>So Git becomes the single source of truth you change

633
00:31:34.960 --> 00:31:37.279
<v Speaker 2>the YAML and GIT, the operator sees it and updates

634
00:31:37.279 --> 00:31:40.720
<v Speaker 2>the cluster. No manual quebectal commands needed for deployment.

635
00:31:40.880 --> 00:31:44.799
<v Speaker 1>That sounds very powerful and declarative. But what about secrets,

636
00:31:45.400 --> 00:31:49.119
<v Speaker 1>database passwords, API keys. Yeah, you don't commit those to.

637
00:31:49.119 --> 00:31:52.799
<v Speaker 2>Get right, Absolutely not. Sensitive information like that should be

638
00:31:52.839 --> 00:31:56.759
<v Speaker 2>stored in Kubernetes's secret objects. These are separate from your

639
00:31:56.759 --> 00:32:01.119
<v Speaker 2>regular yamlcinfigs. You create the secret securely with Kubernetes, often

640
00:32:01.160 --> 00:32:04.400
<v Speaker 2>populated from a secure vault system, and then you reference

641
00:32:04.480 --> 00:32:07.599
<v Speaker 2>that secret in your deployment yamol telling Kubernetes to mount

642
00:32:07.599 --> 00:32:11.000
<v Speaker 2>the secret data as files or environment variables into your container.

643
00:32:11.359 --> 00:32:15.039
<v Speaker 2>It keeps secrets out of GIT but accessible to your application.

644
00:32:15.279 --> 00:32:19.119
<v Speaker 1>Okay, crucial distinction there. So get ops from managing the

645
00:32:19.200 --> 00:32:22.720
<v Speaker 1>can fig now tying everything together security. How do we

646
00:32:22.799 --> 00:32:26.079
<v Speaker 1>ensure this whole Kubernetes platform, from the cluster infrastructure itself

647
00:32:26.160 --> 00:32:30.039
<v Speaker 1>right down to our individual applications is secure. This seems

648
00:32:30.079 --> 00:32:30.920
<v Speaker 1>like a huge topic.

649
00:32:31.000 --> 00:32:33.440
<v Speaker 2>It is huge, and it's multi layer. There's no single

650
00:32:33.480 --> 00:32:37.119
<v Speaker 2>silver bullet. First, the basics. Keep things updated. That means

651
00:32:37.160 --> 00:32:41.279
<v Speaker 2>regular cluster updates. Managed services like gk Offer release channels

652
00:32:41.279 --> 00:32:44.000
<v Speaker 2>that help automate patching the Kubernetes control.

653
00:32:43.720 --> 00:32:46.000
<v Speaker 1>Plane in nodes see Foundation secure.

654
00:32:45.839 --> 00:32:50.720
<v Speaker 2>YEP, and just as important, diligently updating your container images

655
00:32:51.400 --> 00:32:55.319
<v Speaker 2>regularly rebuild your application images using up to date secure

656
00:32:55.519 --> 00:32:59.839
<v Speaker 2>base images. Minimal images like distrolists are fantastic because they

657
00:32:59.839 --> 00:33:03.839
<v Speaker 2>can contain only your application and its runtime dependencies, no shell,

658
00:33:04.079 --> 00:33:07.640
<v Speaker 2>no package manager, drastically reducing the a pack surface if

659
00:33:07.640 --> 00:33:09.720
<v Speaker 2>someone did manage to break into the container.

660
00:33:09.880 --> 00:33:14.680
<v Speaker 1>Smaller target makes sense. What about protecting running applications during maintenance,

661
00:33:14.960 --> 00:33:16.119
<v Speaker 1>like those node updates.

662
00:33:16.440 --> 00:33:20.039
<v Speaker 2>That's where pod disruption budgets or pdbs come in. A

663
00:33:20.079 --> 00:33:24.039
<v Speaker 2>PDB tells Kubernetes for this application, like my front end deployment,

664
00:33:24.400 --> 00:33:26.920
<v Speaker 2>I need at least x pods or y percent of

665
00:33:27.000 --> 00:33:29.920
<v Speaker 2>pods to always remain available during voluntary.

666
00:33:29.559 --> 00:33:32.160
<v Speaker 1>Disruptions voluntary like node upgrades or.

667
00:33:32.119 --> 00:33:35.119
<v Speaker 2>Drains Exactly so, if an admin drains and node for maintenance,

668
00:33:35.279 --> 00:33:37.960
<v Speaker 2>Kubernetes will respect the PDB and ensure it doesn't take

669
00:33:38.000 --> 00:33:40.640
<v Speaker 2>down too many pods of that application at once, preventing

670
00:33:40.680 --> 00:33:41.240
<v Speaker 2>an outage.

671
00:33:41.279 --> 00:33:44.720
<v Speaker 1>Okay, service availability during maintenance. What about securing the pods

672
00:33:44.799 --> 00:33:46.799
<v Speaker 1>themselves inside the container?

673
00:33:47.119 --> 00:33:50.640
<v Speaker 2>Big one here Pod Security context. This lets you define

674
00:33:50.680 --> 00:33:54.799
<v Speaker 2>granular security settings for your containers. The absolute most important

675
00:33:54.839 --> 00:33:57.519
<v Speaker 2>one is configuring your container to run as a non

676
00:33:57.599 --> 00:33:58.279
<v Speaker 2>route user.

677
00:33:58.680 --> 00:34:01.000
<v Speaker 1>Why is running as non roots so critical?

678
00:34:01.319 --> 00:34:04.519
<v Speaker 2>If an attacker compromises a process running as root inside

679
00:34:04.559 --> 00:34:08.079
<v Speaker 2>a container, they potentially have much broader privileges, making it

680
00:34:08.119 --> 00:34:10.920
<v Speaker 2>easier to escalate attacks or break out of the container.

681
00:34:11.639 --> 00:34:15.800
<v Speaker 2>Running as a dedicated, unprivileged user significantly limits the blast

682
00:34:15.880 --> 00:34:19.719
<v Speaker 2>radius of a compromise. It's a fundamental security best practice.

683
00:34:19.840 --> 00:34:22.960
<v Speaker 1>Got it non route by default? Can you enforce these

684
00:34:23.039 --> 00:34:24.800
<v Speaker 1>kinds of security settings across the cluster?

685
00:34:24.960 --> 00:34:29.679
<v Speaker 2>Yes, using admission controllers, specifically the built in POD Security

686
00:34:29.719 --> 00:34:33.079
<v Speaker 2>Admission Controller standard. Since Kubernetes View one point twenty five

687
00:34:33.239 --> 00:34:36.079
<v Speaker 2>is key, You can apply policies at the namespace level,

688
00:34:36.159 --> 00:34:40.000
<v Speaker 2>like the baseline or stricter restricted profile. These policies automatically

689
00:34:40.079 --> 00:34:42.880
<v Speaker 2>check incoming POD configurations and will either mutate them to

690
00:34:42.920 --> 00:34:45.960
<v Speaker 2>be compliant if possible, or reject them entirely if they

691
00:34:46.000 --> 00:34:48.159
<v Speaker 2>violate the rules like trying to run as route when

692
00:34:48.199 --> 00:34:49.119
<v Speaker 2>the policy forbids it.

693
00:34:49.440 --> 00:34:52.599
<v Speaker 1>So automatic enforcement is security standards exactly.

694
00:34:52.840 --> 00:34:56.360
<v Speaker 2>It prevents insecure configurations from ever getting into the cluster,

695
00:34:57.440 --> 00:35:00.400
<v Speaker 2>and finally controlling who can do what in them cluster

696
00:35:00.719 --> 00:35:04.679
<v Speaker 2>user permissions right that's managed by role based access control

697
00:35:04.800 --> 00:35:09.639
<v Speaker 2>or RBAC. RBAC less cluster administrators define rolls which specify

698
00:35:09.719 --> 00:35:13.599
<v Speaker 2>permissions like can get pods or can create deployments, and

699
00:35:13.840 --> 00:35:18.000
<v Speaker 2>role bindings which assign those roles to specific users, groups

700
00:35:18.079 --> 00:35:22.239
<v Speaker 2>or service accounts, often scoped to particular name spaces, so

701
00:35:22.280 --> 00:35:22.599
<v Speaker 2>you can.

702
00:35:22.480 --> 00:35:25.519
<v Speaker 1>Get developers permissions only in their own development name space,

703
00:35:25.800 --> 00:35:27.920
<v Speaker 1>but not let them touch production precisely.

704
00:35:28.199 --> 00:35:32.199
<v Speaker 2>Fine green control limit privileges to the minimum necessary prevent

705
00:35:32.280 --> 00:35:36.760
<v Speaker 2>accidental or malicious changes. It's absolutely essential for securing a

706
00:35:36.840 --> 00:35:40.159
<v Speaker 2>multi tenant or production cluster. Security really has to be

707
00:35:40.199 --> 00:35:41.280
<v Speaker 2>built in at every layer.

708
00:35:41.519 --> 00:35:44.239
<v Speaker 1>Wow. Okay, so we've really covered a huge amount of

709
00:35:44.280 --> 00:35:47.480
<v Speaker 1>ground here. We've journeyed through the absolute core of Kubernetes,

710
00:35:47.679 --> 00:35:50.320
<v Speaker 1>from packaging that first app in a container.

711
00:35:50.039 --> 00:35:53.400
<v Speaker 2>Right through to scaling it globally, handling that tricky persistent state,

712
00:35:53.480 --> 00:35:55.480
<v Speaker 2>running background jobs reliably.

713
00:35:55.199 --> 00:35:59.199
<v Speaker 1>And finally locking it all down with robust multi layered

714
00:35:59.239 --> 00:36:04.000
<v Speaker 1>security practic is in managing configuration with GitOps, you've really

715
00:36:04.039 --> 00:36:06.760
<v Speaker 1>shown how to build systems that don't just survive going viral,

716
00:36:06.880 --> 00:36:10.159
<v Speaker 1>but are actually engineered to thrive on that kind of success. Yeah.

717
00:36:10.199 --> 00:36:13.440
<v Speaker 2>I mean, what we've really unpacked is how Kubernetes transforms

718
00:36:14.199 --> 00:36:19.079
<v Speaker 2>raw compute power, raw infrastructure into this intelligent, self managing,

719
00:36:19.239 --> 00:36:23.960
<v Speaker 2>self healing platform. It lets you the developer or operator,

720
00:36:24.159 --> 00:36:27.800
<v Speaker 2>focus much more on your application's logic and delivering value,

721
00:36:28.199 --> 00:36:31.480
<v Speaker 2>rather than getting bogged down in the endless data day

722
00:36:31.599 --> 00:36:33.920
<v Speaker 2>fiddling with infrastructure details.

723
00:36:33.679 --> 00:36:36.480
<v Speaker 1>Abstracts ways so much complexity will still giving you that

724
00:36:36.480 --> 00:36:38.039
<v Speaker 1>control when you need it exactly.

725
00:36:38.079 --> 00:36:41.320
<v Speaker 2>So, maybe a final thought to leave everyone with, Considering

726
00:36:41.320 --> 00:36:44.400
<v Speaker 2>everything we've dug into today, the automation, the scaling, the resilience,

727
00:36:44.440 --> 00:36:48.639
<v Speaker 2>the security. If your application genuinely hit the headlines tomorrow

728
00:36:48.880 --> 00:36:52.360
<v Speaker 2>went massively viral, how quickly could you scale it to

729
00:36:52.400 --> 00:36:55.320
<v Speaker 2>the moon. How confident are you right now that every

730
00:36:55.320 --> 00:36:57.880
<v Speaker 2>piece of your architecture, from the container build to the

731
00:36:57.880 --> 00:37:01.400
<v Speaker 2>deployment strategy to the auto scaling rule is truly ready

732
00:37:01.400 --> 00:37:02.000
<v Speaker 2>for that ride
