8 videos 📅 2022-10-26 09:00:00 Africa/Blantyre
1:21
2022-10-26 10:40:47
48:29
2022-10-26 11:22:27
1:32
2022-10-26 14:03:58
22:02
2022-10-26 14:09:12
18:32
2022-10-26 14:38:39
1:26:59
2022-10-27 09:43:27
2:08:07
2022-10-27 13:00:05
5:19
2022-10-28 09:57:45

Visit the Certified Kubernetes Administrator Exam Preparation course recordings page

United Arab Emirates - Certified Kubernetes Administrator (CKA) - exam preparation

                WEBVTT

00:00:06.960 --> 00:00:12.220
Even it's is it is the problem still there for you or the audio or is it already started

00:00:12.220 --> 00:00:23.880
out even okay, okay, I suspect this teams really so teams is not so reliable for this

00:00:23.880 --> 00:00:29.880
long meetings and all based on my past experience maybe zoom but let's see if it

00:00:29.880 --> 00:00:34.960
is a problem then maybe we can consider switching to a different one let's observe for the rest of the day

00:04:58.460 --> 00:04:59.860
in

00:04:59.860 --> 00:05:07.720
there is a hedge hedge missing in the hash so that's the reason it's not adopted by the deployment if

00:05:07.720 --> 00:05:13.500
you notice here you missed an edge you see that in your last part yeah okay

00:05:19.860 --> 00:05:24.620
okay let's let's go let's take a coffee quick coffee break for 15 minutes if you want you

00:05:26.240 --> 00:05:32.080
but after the 15 minutes break we are going to start with the deployment resource especially

00:05:32.080 --> 00:05:40.760
we are going to talk about a rollout feature of deployment resource okay please try this labels

00:05:40.760 --> 00:05:46.040
and let me know for any questions after the break thank you

00:06:48.780 --> 00:06:54.520
hello I'm back yeah welcome back welcome back welcome back

00:06:54.520 --> 00:07:03.680
thanks for those confirmations all right what we are going to do now we are going to continue

00:07:03.680 --> 00:07:11.620
our discussion we discussed about part we discussed about replica set and there is

00:07:11.620 --> 00:07:17.780
one guy that we are yet to discuss that is this top-level resource called deployment why

00:07:17.780 --> 00:07:24.860
I need to have this guy sitting at the top right so replica set has a duty to perform that

00:07:24.860 --> 00:07:34.540
disease to DS and what this is doing that's what we are going to discuss now so from the

00:07:34.540 --> 00:07:42.300
deployment resource perspective we have one capability called rollout rollout feature which

00:07:42.300 --> 00:07:51.140
means let's say even built an application the name of the application is even app and the

00:07:51.140 --> 00:07:58.620
the first version that he released is 1.0 and in the cluster he is running 100 he

00:07:58.620 --> 00:08:06.480
created a deployment with replica as an 100 100 100 parts are running with version 1.0

00:08:06.480 --> 00:08:18.320
and then he made some bug fixes and enhancements and he released a new version of the image 2.0

00:08:19.780 --> 00:08:33.780
okay so here he wants to replace all this 100 version 1.0 application with 2.0 right

00:08:33.780 --> 00:08:38.900
all the all these 100 parts need to be deleted and new 100 parts needs to be

00:08:38.900 --> 00:08:47.880
created that's going to run 2.0 so this is nothing but rolling out new version of the

00:08:47.880 --> 00:08:54.560
application just give me a second someone is at my door let me quickly check apologies

00:08:54.560 --> 00:09:03.000
for that hey Adi get lost Adi hey what are you doing you are in a meeting

00:09:03.000 --> 00:09:12.000
you are making me nervous give me a job hello yep what happened I'm back hello am I audible

00:09:12.000 --> 00:09:20.160
now hello yep was that a question okay okay so yep so he wants to roll out a new version

00:09:20.160 --> 00:09:27.240
of the application 2.0 so how to perform this so basically he want to roll out a new

00:09:27.240 --> 00:09:32.640
version of the application and what we are trying to target is how I can perform this

00:09:32.640 --> 00:09:37.200
with zero downtime that too during peak business hard so at the deployment level

00:09:37.200 --> 00:09:41.900
we can specify something called strategy there are two strategies that we can specify one

00:09:41.900 --> 00:09:46.080
is recreate another one is rolling update recreate and then the rolling update if you

00:09:46.280 --> 00:09:54.500
specify strategy as an recreate which means all the old version 1.0 will be deleted once

00:09:54.500 --> 00:10:01.120
it is all deleted then new 100 version 2.0 parts will be created which means the time

00:10:01.120 --> 00:10:06.580
it takes for to delete and then the time it takes for all the 100 points to be up and

00:10:06.580 --> 00:10:11.620
running go through the liveness readiness proof and be ready and then only it will start to

00:10:12.480 --> 00:10:17.900
so which means obviously you are going to have some downtime if you are going to choose

00:10:17.900 --> 00:10:22.440
recreate strategy but if you choose rolling update if you choose rolling update as a strategy

00:10:22.440 --> 00:10:29.160
then you can make use of two properties max unavailable max search so let's say

00:10:29.160 --> 00:10:34.900
you are going to choose max unavailable as an 20 percentage let's say you are going to

00:10:35.830 --> 00:10:41.910
configure your deployment as max unavailable as a 20 percentage and you are going to deploy

00:10:41.910 --> 00:10:48.330
the new version of your application so what will happen is in the 100 application that are

00:10:48.330 --> 00:10:54.250
running with version 1.0 we just started the rollout with max unavailable as in 20

00:10:54.950 --> 00:11:01.270
so as a first iteration 20 percentage of the part which is let's say we have 120

00:11:01.270 --> 00:11:07.910
percentage is going to be 20 20 version 1.0 part will be brought down so which means at

00:11:07.910 --> 00:11:16.470
that moment i will have 80 version 1.0 part running okay and then kubernetes will bring

00:11:16.470 --> 00:11:23.730
up 20 version 2.0 parts up which means at that moment you will have mix of version 1.0

00:11:23.730 --> 00:11:30.550
and 2.0 80 and 20 and then bring another 20 down so which means it will become 60 1.0

00:11:30.550 --> 00:11:36.970
bring 20 up this means 40 version 2.0 so similarly the iteration will proceed

00:11:36.970 --> 00:11:45.090
and at one point in time it's going to be 0 version 1.0 and 100 version 2.0 which means

00:11:45.090 --> 00:11:50.950
we successfully rolled out the new version of the application so it means as the name says

00:11:51.930 --> 00:11:58.490
throughout the deployment window or the rollout window we had only 20 percentage of the part

00:11:59.270 --> 00:12:03.210
unavailable which means remaining 80 percentage of the parts were available

00:12:03.850 --> 00:12:10.730
and it was processing all the incoming traffic max unavailable that's what it means

00:12:11.450 --> 00:12:17.450
if you set max unavailable to 100 percentage which is nothing but the recreate strategy where

00:12:18.130 --> 00:12:22.250
all the old part will be written new part will be created it's going to be whole 100

00:12:22.810 --> 00:12:29.530
okay fine this is the max unavailable what if even if the 20 percentage of the unavailability

00:12:30.410 --> 00:12:34.710
your service can't tolerate because it's really really super busy you need that many

00:12:34.710 --> 00:12:40.190
instances to be available then you can have a play around max search property so what it means

00:12:40.190 --> 00:12:45.910
if you set the max search to 20 basically you can do both configure both properties how

00:12:45.910 --> 00:12:51.590
many to bring down how many to spin up that you can do it here search means think of it

00:12:52.150 --> 00:13:00.470
let's say version 1.0 i have 100 if i set search to 20 instead of bringing down old part first

00:13:01.150 --> 00:13:08.630
it will bring up 20 new parts up so which means you will have 100 version 1.0

00:13:10.290 --> 00:13:15.630
running you'll be your a surge of 20 new parts and once this is up and running then

00:13:15.630 --> 00:13:21.790
i will bring 20 down this will become version 80 and then 20 version 2.0 okay and then again

00:13:21.790 --> 00:13:26.310
a search 40 make it 40 so similarly it's going to proceed and at the end you will have 100

00:13:26.310 --> 00:13:33.670
version 2.0 and 0 version 1.0 so you can go for search provided in your infrastructure you

00:13:33.670 --> 00:13:41.130
can have you have enough resources to accommodate that search here it is 120 is fine but what if

00:13:41.130 --> 00:13:46.810
you have 1000 and if you set it to 20 it's going to be 200 parts so 200 additional parts

00:13:46.810 --> 00:13:53.810
which means it's going to take a lot of resources so resource availability is a concern then don't

00:13:53.810 --> 00:13:59.610
go for search maybe you can go with max and available with some less value okay so first

00:13:59.610 --> 00:14:05.290
step is at the deployment level you can specify the strategy hey this is the strategy

00:14:05.290 --> 00:14:10.210
i'm going to use rolling update with max and available this much max search this much so

00:14:10.210 --> 00:14:15.490
the deployment that we already created we didn't explicitly specified one right we just

00:14:16.210 --> 00:14:23.450
did with yaml file as well as with imperative we didn't specified one explicitly

00:14:23.450 --> 00:14:30.590
so the default is rolling update with max search and max and available set to 25 percentage

00:14:33.190 --> 00:14:34.050
come on

00:14:40.210 --> 00:14:46.450
so we have one deployment you can actually view the ml that is stored in the kubernetes etcd

00:14:46.450 --> 00:14:53.830
database which has all the defaults included the ml that's actually used by kubernetes to

00:14:53.830 --> 00:15:01.990
create that resource right just in the get command output it as an ml-o-ml that will

00:15:01.990 --> 00:15:06.610
print the ml with all the defaults and everything included that is stored in the

00:15:06.610 --> 00:15:12.470
etcd database so here this is the deployment specification where you can see the strategy

00:15:12.470 --> 00:15:21.490
default is included rolling update okay need to scroll down a bit

00:15:21.490 --> 00:15:27.410
rolling update max search max and available those informations are provided here okay

00:15:28.570 --> 00:15:34.970
so this is number one where you can specify the strategy and number two feature that it

00:15:34.970 --> 00:15:44.850
says rollout kubectl rollout for one specific deployment let's say for events app maybe he

00:15:44.850 --> 00:15:51.190
did multiple deployment multiple versions deployments in the past for this one single

00:15:51.190 --> 00:16:01.790
deployment he initially deployed version 0.7 and then 8 0.9 version 1.0 version 1.5 now he is

00:16:01.790 --> 00:16:09.030
version 2.0 right so for one single deployment he's just updating the image version and then

00:16:09.030 --> 00:16:15.270
he's rolling out a new version so you can actually view all the history of rollouts

00:16:15.270 --> 00:16:20.490
performed for that deployment so this will history command will list all the past

00:16:20.490 --> 00:16:27.770
rollouts you did for that specific deployment okay and then if he is going to do an

00:16:27.770 --> 00:16:33.150
version 2.0 deployment what he will do he will open the ml file he will update the image

00:16:34.030 --> 00:16:39.150
and then he will save the file and then he will apply that's going to trigger the rollout

00:16:39.150 --> 00:16:44.770
process that is replacing the parts with the new image parts right so while rollout is in

00:16:44.770 --> 00:16:51.010
progress you can actually do view the status of the rollout status deploy even app so how

00:16:51.010 --> 00:16:56.050
many are currently being replaced how many old are there how many new are there you can view

00:16:56.050 --> 00:17:03.110
the status and you can even pause the deployment rollout while the rollout is in progress in the

00:17:03.110 --> 00:17:07.610
monitoring tool you are observing a lot of alerts so you suspect maybe this may be a

00:17:07.610 --> 00:17:13.170
cost so you can immediately pass the rollout which means maybe 50 percentage are replaced

00:17:13.170 --> 00:17:18.050
50 percentage are still yet to be replaced it was still in the same state because you

00:17:18.050 --> 00:17:23.730
passed the rollout maybe after the troubleshooting you found out that it's because of a different

00:17:23.730 --> 00:17:30.490
issue so you can resume the rollout cube ctl rollout resume deploy and so on okay

00:17:30.490 --> 00:17:35.750
you deployed version 2.0 and after an hour there are a lot of user incidents that are creating

00:17:36.590 --> 00:17:40.710
and you found out that there is some serious bug with this version 2.0

00:17:40.710 --> 00:17:47.290
then you can undo the rollout which means all the 100 parts will be replaced with version

00:17:47.290 --> 00:17:54.610
1.0 the previous version you can go back to the immediate previous version or you can go back to

00:17:54.610 --> 00:18:01.430
any version in the past using undo command okay so for one specific deployment you can view

00:18:01.430 --> 00:18:08.050
the history of all the rollers that you did in the past you can view the status of current

00:18:08.050 --> 00:18:13.450
rollout that's being in progress that's just in progress you can pause resume and you can

00:18:13.450 --> 00:18:18.350
even undo to immediate previous version or to any version in the past

00:18:20.590 --> 00:18:23.950
okay so let me quickly show that commands right

00:18:23.950 --> 00:18:30.850
let's let's explore those rollout commands real quick and then we are all set for the topic