4 videos 📅 2022-11-21 09:00:00 Africa/Blantyre
1:04:49
2022-11-21 11:28:21
44:16
2022-11-21 13:36:53
44:08
2022-11-21 14:41:53
10:27
2022-11-21 15:56:25

Visit the Certified Kubernetes Administrator - Exam Preparation course recordings page

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

                WEBVTT

00:00:00.760 --> 00:00:05.360
Hell is it? I think your voice is breaking, but I am able to see your

00:00:06.240 --> 00:00:12.920
Machine now. Yeah, so what is the problem here? CubeCtl scale rs 7b

00:00:14.840 --> 00:00:17.720
CubeCtl get rs, but you are not

00:00:18.600 --> 00:00:21.100
It says not found

00:00:21.100 --> 00:00:28.700
Did you my deployment your replica set name is my deployment by deployment? Yeah

00:00:34.280 --> 00:00:35.680
a problem

00:00:42.160 --> 00:00:42.860
Deployment

00:00:43.800 --> 00:00:49.760
You can scale the deployment you need to deploy. This is the command right you need to deploy

00:00:49.760 --> 00:00:57.560
Scale your deployment. What is your deployment name? CubeCtl get deploy do CubeCtl get deploy. Okay, so CubeCtl scale

00:00:59.230 --> 00:01:03.370
Deploy my deploy if and if and replicas equals five deploy

00:01:04.210 --> 00:01:06.370
Deploy you need to specify the resource name

00:01:06.370 --> 00:01:11.350
You are trying to deploy and deployment, right? So it should be CubeCtl scale

00:01:12.630 --> 00:01:13.190
deploy

00:01:13.190 --> 00:01:19.190
Space my deploy resource name of the resource and then the replicas if and if and replicas

00:01:20.710 --> 00:01:21.830
Yeah, perfect

00:01:22.990 --> 00:01:25.990
What is that can you please come again with your question?

00:01:25.990 --> 00:01:27.990
Okay, one way is

00:01:30.390 --> 00:01:36.010
By looking at the labels that is there is no specific commands that you can execute but

00:01:36.010 --> 00:01:42.890
From the resource perspective you can pick a label and then you can use it in the sector query if that resource matches

00:01:43.970 --> 00:01:49.750
then it is let's say you have a replica set that has a

00:01:49.750 --> 00:01:55.110
Just give me a minute go back to the board. Okay, so you have a deployment and

00:01:56.590 --> 00:02:00.270
The deployment has a label my my app equals hermohab

00:02:01.190 --> 00:02:08.390
Right. So if you want to see whether if a specific part belongs to this deployment, then you can execute a query

00:02:08.390 --> 00:02:11.010
using the selector

00:02:11.010 --> 00:02:12.590
app equals

00:02:12.590 --> 00:02:17.070
Hermohab if that part is listed here, then it is maintained by the top-level resource

00:02:18.070 --> 00:02:18.630
Okay

00:02:19.230 --> 00:02:23.210
That's how you can see so from the pod perspective. You can't say

00:02:23.210 --> 00:02:29.730
What all the top-level resources manage in this part that is not something that you can find only with the label selector

00:02:29.730 --> 00:02:33.730
you can identify go to the top-level resource look at the

00:02:35.010 --> 00:02:37.370
label selector and query for that

00:02:39.050 --> 00:02:42.130
Query for query for the pod with those labels

00:02:48.520 --> 00:02:49.160
You

00:02:49.160 --> 00:02:52.200
Yeah, you can do that selector equals there are many

00:02:52.200 --> 00:02:58.500
You can refer the documentation. Yes. There are many operators that we can use under the selector level

00:02:59.460 --> 00:03:05.300
You can use operators like get all the parts that has only this key

00:03:05.300 --> 00:03:08.660
You don't bother about the value as long as it has a key get all the

00:03:08.920 --> 00:03:15.960
Things and then get all the thing that that has a value in some list of values

00:03:16.480 --> 00:03:20.400
There are multiple operators that you can use at the selector query level

00:03:20.400 --> 00:03:25.440
Yes, that is possible not app which means get all that doesn't have this label on it

00:03:31.740 --> 00:03:38.520
Correct correct, but the best but the best practices in your deployment file just include the label

00:03:38.520 --> 00:03:44.660
This is the deployment file for the my deploy if you look at any deployment file

00:03:44.660 --> 00:03:47.240
You will see label related

00:03:47.240 --> 00:03:49.600
configurations in three places

00:03:49.600 --> 00:03:55.640
The first place is under the metadata. We have labels. You see that here labels app my deploy

00:03:55.640 --> 00:03:57.240
This is the first place

00:03:57.240 --> 00:04:01.740
second place under the specification we have selector and

00:04:01.740 --> 00:04:07.520
It also has a label and the third place is under the template. We have the label

00:04:08.040 --> 00:04:09.040
See that

00:04:09.040 --> 00:04:12.940
So this is the YAML file created by the kubectl client for us

00:04:12.940 --> 00:04:20.860
So these three are three different things what this first one is a deployment is created to the deployment

00:04:20.860 --> 00:04:24.300
And label is assigned app equals my deploy

00:04:24.980 --> 00:04:28.280
So how a label is assigned to the deployment using this?

00:04:29.500 --> 00:04:31.220
metadata label under the metadata

00:04:32.480 --> 00:04:36.620
Okay, and then this deployment is going to create child revel

00:04:37.660 --> 00:04:41.820
replica sets right replica set and parts and

00:04:41.820 --> 00:04:45.640
The label that should be assigned to those child level resources

00:04:45.640 --> 00:04:50.020
You can see it under the template template label, which means it will get that

00:04:51.260 --> 00:04:53.220
labels app equals my deploy

00:04:53.960 --> 00:04:55.680
That is this one

00:04:56.200 --> 00:04:58.200
the labels on the resources and

00:04:58.940 --> 00:05:04.340
The third one is this selector. This is the important one what you give here

00:05:04.340 --> 00:05:09.080
This is what going to be used in the selector query app equals my deploy got the idea

00:05:09.080 --> 00:05:13.520
So which means in our case, it's all look same, but you can have a different values here

00:05:13.520 --> 00:05:16.500
Maybe on the resource level you can have a different labels

00:05:17.920 --> 00:05:19.900
But what you give here?

00:05:21.240 --> 00:05:26.780
Should be here at least a subset of what you give here should be here because then only

00:05:27.500 --> 00:05:33.380
These parts will match to this selector query if you are giving a different labels here and different labels here

00:05:33.380 --> 00:05:38.100
Then that that is an invalid configuration. You won't be able to spin up the deployment

00:05:38.100 --> 00:05:42.080
So basically it's creating the resources and with the match labels

00:05:42.080 --> 00:05:47.700
You are going to this is what will be used in the sector query by the resources like replica set or the deployment

00:05:47.700 --> 00:05:53.800
Yes, go ahead, please

00:05:55.660 --> 00:06:02.560
Correct part template has is created at run at runtime only will know the ID right so kubernetes will assign it

00:06:09.400 --> 00:06:09.920
You

00:06:09.920 --> 00:06:16.580
Can do anything this is this is not an assist system reserved label keyword it can be anything

00:06:17.180 --> 00:06:18.780
Right. I hope it is clear

00:06:18.780 --> 00:06:26.260
So you generally for the applications that you deploy to the production the application team will have more control on the labels that they

00:06:26.260 --> 00:06:30.820
Are going to assign and do stuff if if if you miss to do it then kubernetes will do it

00:06:32.520 --> 00:06:37.400
Okay, okay going back to the question from hamo, I totally

00:06:37.400 --> 00:06:42.500
Forgot the question that came from hamo. So it is about

00:06:44.360 --> 00:06:49.780
Or fan parts what was the question again, okay

00:06:51.100 --> 00:07:00.140
Got it out of the box. We don't have a straightforward command to achieve it, but with a bit of

00:07:00.140 --> 00:07:06.000
Scripting we can achieve it. We can identify the top-level resources get their sector labels

00:07:06.000 --> 00:07:09.540
Look for the parts that doesn't have any of those

00:07:10.240 --> 00:07:14.700
Top level resource labels and then delete it. So we need to do do some

00:07:16.080 --> 00:07:19.140
Bit of scripting and we can automate it

00:07:20.180 --> 00:07:23.480
But out of the box, it's not possible. Yep

00:07:23.480 --> 00:07:25.300
You are welcome

00:07:26.300 --> 00:07:30.560
Okay, I think this is the perfect time to take a quick coffee break

00:07:30.560 --> 00:07:35.740
So let's take an coffee break for 15 minutes and refresh yourself and be back by

00:07:36.800 --> 00:07:38.700
310 p.m. Thank you

00:07:40.740 --> 00:07:44.420
I'm back. I'll come back. So just an

00:07:46.240 --> 00:07:48.360
Quick attendance check

00:07:49.140 --> 00:07:54.620
Can you please raise your hands in the teams if you're back to your desk? Okay velocity

00:07:55.540 --> 00:07:58.480
So I'm not sure I don't have an

00:07:58.480 --> 00:08:02.820
Option to record this because this meeting came from your organization

00:08:03.520 --> 00:08:07.540
So I'm not sure whether they I don't have permission to start recording

00:08:07.540 --> 00:08:11.660
If it is not recorded maybe from tomorrow

00:08:11.660 --> 00:08:17.900
You can request your organizer to join and begin the recording so that we can cover these scenarios, right?

00:08:18.340 --> 00:08:20.360
And in the last one and a far. Yes

00:08:20.360 --> 00:08:26.240
We discussed a lot of things respect to a deployment replicas it and then the parts

00:08:27.120 --> 00:08:30.680
you can follow along the video file that I shared and

00:08:31.560 --> 00:08:35.420
You can connect with any one of the colleague, but if you still feel that he likes

00:08:35.420 --> 00:08:37.520
I really want to catch up on it

00:08:38.500 --> 00:08:43.560
Maybe after the training time if you find some time I'm available anyways, so

00:08:44.260 --> 00:08:48.840
If we can have a connect for just the 30 minutes or so I can quickly given a

00:08:50.280 --> 00:08:53.360
Quick overview on the topics that we covered, right?

00:08:54.040 --> 00:08:57.640
So it's up to you so you can check with the colleagues or you can later

00:08:57.640 --> 00:08:59.660
I will drop my email is in the email

00:08:59.660 --> 00:09:05.240
We can have an quick one-to-one and I will make sure you are on board on these topics. All right, welcome

00:09:05.800 --> 00:09:10.340
Sure. Sure. Maybe you can also check with others if somebody has the similar problem

00:09:10.340 --> 00:09:13.980
They can also join into that meeting. Okay

00:09:14.860 --> 00:09:15.300
Perfect

00:09:19.000 --> 00:09:23.960
Okay again, welcome back so we are at the last part of the day one of training and

00:09:25.440 --> 00:09:29.740
The thing that we discuss before our coffee break is

00:09:31.180 --> 00:09:38.620
We now know how to create a deployment and creating a deployment creates a replica set and then the parts and we know

00:09:38.620 --> 00:09:43.400
The role and role of replica set here that is CS equals DS

00:09:44.000 --> 00:09:46.800
In addition to that. We also learned

00:09:48.770 --> 00:09:50.130
Labels and

00:09:50.130 --> 00:09:53.490
Labels select us how this simple but powerful

00:09:54.030 --> 00:09:57.950
Kubernetes resource ties up this entire hierarchy, right?

00:09:58.170 --> 00:10:04.230
We even learned how to assign and as in the label using the labels in the sector query using different operators

00:10:04.230 --> 00:10:06.610
those stuff we discussed and

00:10:08.210 --> 00:10:08.890
then

00:10:08.890 --> 00:10:09.850
What else?

00:10:10.750 --> 00:10:16.950
Yeah, some cases like quarantining apart adopting apart using labels those things

00:10:16.970 --> 00:10:18.030
we tried

00:10:19.090 --> 00:10:19.770
Okay

00:10:19.770 --> 00:10:24.450
so now the next topic that we are going to discuss is about

00:10:25.150 --> 00:10:28.010
Deployment itself we created a deployment

00:10:28.990 --> 00:10:32.690
But then we discussed more on the features of the replica set

00:10:33.470 --> 00:10:39.530
The reconciliation loop it executes and so on so but what this top-level resource deployment

00:10:40.250 --> 00:10:41.390
actually does

00:10:41.930 --> 00:10:45.490
Or what what all the features that it brings to the table?

00:10:46.290 --> 00:10:48.610
That's what we are going to discuss now

00:10:48.610 --> 00:10:51.450
so let's say we have velocity and

00:10:52.990 --> 00:11:00.390
She deployed an application name of the name of her application is let's say speed

00:11:01.450 --> 00:11:07.690
Speed is the name of velocity supplication. I think we are more into physics lessons now, right?

00:11:08.430 --> 00:11:14.530
I'm just kidding. So this is the name of the application and right now she developed version 1.0

00:11:15.490 --> 00:11:19.930
And she deployed to the kubernetes cluster. So in the cluster

00:11:20.990 --> 00:11:27.370
There are hundred replicas of speed application that are running hundred replicas, let's say

00:11:28.850 --> 00:11:32.570
And now velocity came up she did some

00:11:32.570 --> 00:11:39.090
enhancements and bug fixes and she came up with version 2.0 of the speed image and

00:11:39.970 --> 00:11:41.610
now she want to

00:11:41.710 --> 00:11:50.110
Roll out this new version of the application, which means all the 100 parts that are running version

00:11:50.110 --> 00:11:51.830
1.0

00:11:51.830 --> 00:11:57.730
Needs to be replaced with new 100 parts. That's going to run version 2.0. Correct

00:11:57.730 --> 00:12:02.310
So how we are going to achieve by specifying something called?

00:12:03.970 --> 00:12:05.510
Deployment strategy

00:12:06.730 --> 00:12:08.830
At the deployment level

00:12:09.490 --> 00:12:13.550
We can specify the strategy as recreate or

00:12:15.570 --> 00:12:18.550
Rolling update if you set it to recreate

00:12:18.550 --> 00:12:23.670
which means all this 100 old parts will be deleted and

00:12:25.110 --> 00:12:27.810
Then new 100 parts will be spin up

00:12:29.890 --> 00:12:31.170
Which means

00:12:31.170 --> 00:12:38.130
This will come with the downtime the time it takes for all the 100 parts to be deleted and the time it takes

00:12:38.130 --> 00:12:45.290
For the new parts to be up and running all the 100 part must go through the liveness probe and it should be healthy

00:12:45.810 --> 00:12:47.430
and ready

00:12:47.430 --> 00:12:50.570
Then only it can accept the request

00:12:50.570 --> 00:12:54.190
So there is going to be a downtime that comes with the recreate strategy

00:12:54.190 --> 00:12:58.490
but if we choose rolling update, let's say velocity chosen

00:12:59.170 --> 00:13:01.890
strategy as and rolling update for our application and

00:13:02.690 --> 00:13:08.110
Under the rolling update she can make use of couple of properties. Let's say max unavailable

00:13:09.370 --> 00:13:10.730
max search

00:13:11.690 --> 00:13:21.350
She can give Alice for both but just to give you an idea, let's say she said max unavailable as and 25% each and

00:13:21.350 --> 00:13:26.610
Then she update the image and apply the DML file. Then what will happen is

00:13:28.150 --> 00:13:33.430
Because she specified max unavailable as and 25 you have 100

00:13:34.350 --> 00:13:36.450
version 1.0 running and

00:13:36.450 --> 00:13:42.530
You set the strategy as and rolling update max unavailable 25 and you trigger the rollout

00:13:43.110 --> 00:13:46.110
What will happen is it will bring?

00:13:48.450 --> 00:13:53.850
25 version 1.0 parts down and

00:13:53.850 --> 00:13:57.670
Then you will have 75 version 1.0 running

00:13:58.530 --> 00:14:02.530
you will first bring the cubanets will first bring 25 parts down and

00:14:03.490 --> 00:14:06.070
Then it will bring up version 2.0. Let's say

00:14:06.450 --> 00:14:09.850
so which means at that moment you have

00:14:11.830 --> 00:14:17.090
75 version 1.0 and 25 version 2.0 and again another

00:14:17.650 --> 00:14:25.590
25 version 1.0 down bring 25 version 2.0, which means at that moment you will have 50 version 2.0

00:14:26.550 --> 00:14:28.370
50 version 1.0

00:14:29.450 --> 00:14:35.890
Right. So similarly did this iteration this iteration will move on and at one moment

00:14:35.890 --> 00:14:41.450
All you have is 100 version 2.0 zero version 1.0. So if you look at this process

00:14:42.170 --> 00:14:43.450
rollout process

00:14:43.450 --> 00:14:47.770
There is only 25 percentage of the parts were unavailable

00:14:48.730 --> 00:14:53.490
Because the max unavailable is set to 25 only 25 parts were unavailable

00:14:54.370 --> 00:14:59.170
75 parts were available throughout this deployment process

00:14:59.690 --> 00:15:01.530
which are

00:15:01.530 --> 00:15:08.890
Processing all the records that this application receives. Okay, you're bringing down only 25 percentage 25 percentage 25 percentage

00:15:08.890 --> 00:15:11.210
And then bringing up new parts

00:15:12.430 --> 00:15:17.750
Which means during the rollout process you have mix of both version 1 and version 2.0

00:15:17.750 --> 00:15:24.090
Which means it's your applications team's responsibility to make sure these two versions are backward

00:15:24.090 --> 00:15:26.730
compatible if there are any breaking changes then

00:15:27.450 --> 00:15:32.370
Users will face errors if they try to access the application during this rollout time

00:15:33.030 --> 00:15:35.810
So there are breaking changes, obviously need to go with

00:15:37.330 --> 00:15:43.830
Recreate or some other deployment patterns in combination with recreate. Okay, that is max unavailable

00:15:44.410 --> 00:15:46.890
She can also set max search

00:15:47.970 --> 00:15:49.470
What it means

00:15:50.090 --> 00:15:54.870
Here in the unavailable scenario, we have 25 parts that are unavailable, right?

00:15:54.870 --> 00:15:56.910
What if if your application is really really

00:15:57.770 --> 00:15:59.870
doing busy and

00:15:59.870 --> 00:16:06.970
Even the 25 percentage unavailability you won't be able to tolerate you really need that 100 percentage

00:16:06.970 --> 00:16:12.550
That is 100 parts all the time. Then you can play with the max search property and

00:16:13.650 --> 00:16:20.790
How it's going to work instead of bringing down the parts. It will spin up additional 25 version 2 0 parts

00:16:21.690 --> 00:16:28.430
You will have version 1.0 running and a surge of 25 percentage that is 25 parts will be spin down

00:16:28.430 --> 00:16:31.870
Once it is up and running then I will bring 20 parts down

00:16:32.810 --> 00:16:40.530
Kubernetes will bring 20 parts down so that you will have a mix of this and then again additional and then bring 20 down

00:16:40.530 --> 00:16:45.990
So similarly the iteration is going to move on 25. Sorry 25 25 25 something like this

00:16:46.610 --> 00:16:53.370
You will create additional parts here you are deleting the you are setting the unavailable here you are setting the search

00:16:53.370 --> 00:16:56.870
Okay, so you need to be careful while while doing

00:16:56.870 --> 00:17:00.050
setting high value for the search because

00:17:00.050 --> 00:17:03.710
You are spinning 25 new parts. Do you have?

00:17:05.090 --> 00:17:10.750
Enough resources in the cluster to accommodate that new 25 parts, even though it's going to be for a short time

00:17:10.750 --> 00:17:17.850
But do you have the resources if resource is a constraint in the cluster then better go for max unavailable and set some lower percentages

00:17:19.670 --> 00:17:26.830
Okay, so that the deployment that week this go ahead please 75. Yeah, it should be 75

00:17:26.830 --> 00:17:29.030
Yeah, I made a mistake there. Okay

00:17:30.370 --> 00:17:32.810
So that's the whole idea here

00:17:32.810 --> 00:17:38.130
So for the deployment that we created we didn't specify the strategy at all, right?

00:17:38.130 --> 00:17:46.570
So the default is rolling update with max available and max suggests and 25 25

00:17:46.570 --> 00:17:53.930
so if I do keep CTL get deploy you can describe the deployment and you can understand the

00:17:58.270 --> 00:18:04.410
Strategy but then if you output it as an AML and if you scroll up here you can see

00:18:04.640 --> 00:18:09.540
Strategies rolling update with max search max unavailable as a 25 25

00:18:09.540 --> 00:18:14.020
Which means at the same time 25 will be brought up and then 25 will be added

00:18:14.020 --> 00:18:20.300
Right, so you can configure one of it or even you can specify some hard numbers instead of the percentage

00:18:22.380 --> 00:18:28.880
Right purely depends based on how we want you can configure this so this is this is the two strategies

00:18:29.500 --> 00:18:35.560
Recreate and rolling update that comes out of the box from the core kubernetes distribution, right?

00:18:36.100 --> 00:18:41.020
So on top of it you can traditionally we are following some kind of deployment patterns right?

00:18:41.800 --> 00:18:44.580
Canary deployments blue-green deployments

00:18:44.580 --> 00:18:51.480
So those patterns you can apply on top of this any one of these strategies that has nothing to do with kubernetes

00:18:51.480 --> 00:18:58.200
But out of the box from the kubernetes at the deployment resource level you can specify the

00:18:58.920 --> 00:18:59.360
Strategy

00:19:00.120 --> 00:19:08.000
recreate and rolling update if you are going to set max unavailable as an 100 percentage if you set max unavailable as an

00:19:08.000 --> 00:19:11.320
100% it is nothing but the recreate strategy

00:19:11.980 --> 00:19:16.400
Isn't it because it's going to do the same behavior and that what's deleted

00:19:16.920 --> 00:19:20.140
Create under new parts. That is nothing but the recreate

00:19:21.720 --> 00:19:26.860
Okay, so

00:19:26.860 --> 00:19:30.320
Resource level that is number one. Let's say

00:19:30.320 --> 00:19:37.780
Velocity see chosen rolling update as the strategy and she set some values for the max unavailable

00:19:37.780 --> 00:19:41.480
So she is all set. She already chosen the strategy now

00:19:41.480 --> 00:19:44.740
she included those values in the deployment dot eml file and

00:19:45.480 --> 00:19:53.700
She updated the version of the image from version 1.0 to version 2.0 and then she is going to apply that eml file

00:19:54.260 --> 00:19:56.700
the moment when she applies

00:19:57.700 --> 00:19:59.420
It's going to trigger

00:20:00.440 --> 00:20:01.560
the rollout

00:20:01.560 --> 00:20:05.100
Rolling out the new version of the application rollout

00:20:06.360 --> 00:20:12.420
Based on the strategy. It's going to bring down bring up bring down bring out bring down bring up and after a few seconds

00:20:12.420 --> 00:20:14.380
Or a minute. It's going to complete the

00:20:15.120 --> 00:20:20.540
Rollout process correct. So while rollout is in progress. You can actually view

00:20:21.300 --> 00:20:23.660
status of your rollout kubectl rollout

00:20:24.260 --> 00:20:26.640
Status for the deployment

00:20:27.180 --> 00:20:32.340
My deploy so this will actually show you and a running update of

00:20:32.340 --> 00:20:35.340
the deployment progress you can even

00:20:36.920 --> 00:20:42.460
Pass a rollout. Let's say already some 50 percentage is completed and

00:20:43.920 --> 00:20:46.640
You are seeing a lot of alerts

00:20:47.860 --> 00:20:50.220
Coming from the cluster and

00:20:50.420 --> 00:20:55.980
You suspect maybe this deployment is causing this rollout is causing some issues

00:20:55.980 --> 00:20:58.600
So you may want to pause that rollout for a moment

00:20:59.300 --> 00:21:04.960
To observe those logs and informations to see what went wrong so you can pause it

00:21:04.960 --> 00:21:09.220
so which means it will simply the rollout will pass it to the current state, which means

00:21:10.240 --> 00:21:15.300
40 old 60 new it will simply stay in the same state without any progression and

00:21:15.960 --> 00:21:20.160
After analysis you can simply resume the role or resume

00:21:21.640 --> 00:21:22.300
and

00:21:22.300 --> 00:21:28.240
Once the rollout is successfully completed, which means all the old parts are replaced with the new parts

00:21:28.240 --> 00:21:30.560
You can actually view

00:21:31.120 --> 00:21:34.620
The history of rollout for that specific deployment

00:21:34.620 --> 00:21:36.940
for example velocity

00:21:36.940 --> 00:21:45.320
humans back to started with zero point one point six zero point two point three zero point three point five one point zero point

00:21:45.320 --> 00:21:49.360
Today she is deploying one point zero point two for the speed app

00:21:50.160 --> 00:21:52.840
So she can actually see all this

00:21:53.680 --> 00:22:02.380
history of rollout she performed for that specific deployment speed and then today she deployed this and

00:22:02.380 --> 00:22:03.620
after deployment

00:22:03.620 --> 00:22:08.400
there are a lot of errors that are there are a lot of incidents that users are reporting and

00:22:09.240 --> 00:22:10.900
Then you found out that

00:22:10.900 --> 00:22:15.300
There is an bug in this specific version one point zero point two

00:22:15.320 --> 00:22:18.800
You can easily and undo will

00:22:19.640 --> 00:22:25.680
Will revert back to the previous version which means all the 100 parts will be replaced with

00:22:27.000 --> 00:22:29.500
parts version one point zero point one

00:22:29.500 --> 00:22:36.720
This is again going to trigger another rollout. You can undo to the immediate previous version or you can even go back in time

00:22:38.340 --> 00:22:40.020
specifying to revision

00:22:40.700 --> 00:22:44.140
From here you can go back to zero point two point three

00:22:44.140 --> 00:22:48.520
Let's say each each will be associated with some kind of revision number

00:22:48.520 --> 00:22:56.080
So you can specify that revision number here to revision number two that is associated with zero point two point three version of your application

00:22:58.480 --> 00:22:59.700
So status pass

00:23:01.240 --> 00:23:02.440
resume history

00:23:03.060 --> 00:23:06.400
Undo you can do all of these operations for the rollout

00:23:07.120 --> 00:23:10.620
Which is associated with an deployment resource

00:23:14.300 --> 00:23:20.380
Okay, so with this I'm going to quickly demonstrate that so that you can also give it a try

00:23:21.180 --> 00:23:27.980
So we already have a deployment, but I'm going to create a new deployment for this purpose kubectl create

00:23:29.420 --> 00:23:34.520
Deployment I need an an image with different versions, right?

00:23:34.660 --> 00:23:38.980
So I'm going to pretend like the developer of the application and I'm going to deploy

00:23:39.180 --> 00:23:47.340
Multiple versions of the application so for that I'm going to pick any image from the docker hub and I'm going to try

00:23:48.560 --> 00:23:52.160
Deploying multiple versions of a same application

00:23:52.960 --> 00:23:54.900
Let's go with the same engine X

00:23:57.260 --> 00:24:00.420
Okay, I'm going to first start with

00:24:01.760 --> 00:24:09.060
One point two to a fan Alpine and then I am going to update it to one point two two and then

00:24:09.860 --> 00:24:10.420
point

00:24:11.300 --> 00:24:13.180
To three Alpine and

00:24:13.860 --> 00:24:17.380
Then finally to the one point two three. Let's give it a quick try

00:24:17.380 --> 00:24:21.360
So first I'm going to start with one point two to a fan Alpine tag

00:24:26.100 --> 00:24:26.660
image

00:24:30.880 --> 00:24:35.380
Engine X and the code tag is one point two two

00:24:37.620 --> 00:24:42.480
Something wrong with me

00:24:42.480 --> 00:24:46.600
Keyboard engine next one point two

00:24:47.980 --> 00:24:51.680
See, I forget the tag name already one point two to a fan Alpine

00:24:56.000 --> 00:24:59.360
And the name of the deployment is my web

00:25:01.960 --> 00:25:05.580
And I want to get the ML file for this

00:25:17.860 --> 00:25:18.840
I

00:25:18.840 --> 00:25:20.440
Output as an ML

00:25:24.980 --> 00:25:30.960
Perfect I'm going to write this to an ML

00:25:40.720 --> 00:25:41.800
I

00:25:41.800 --> 00:25:43.280
Perfect let's open that file

00:25:57.560 --> 00:26:02.560
Come on I'm trying to open a file

00:26:04.240 --> 00:26:08.920
Okay, let's go with this defaults if you want you can clear it up it's up to you

00:26:08.920 --> 00:26:14.140
I'm going to go with the default strategy. I'm happy with the default strategy

00:26:15.100 --> 00:26:17.540
That cubers is going to assign

00:26:18.840 --> 00:26:21.080
Let's keep it simple

00:26:25.620 --> 00:26:28.140
Okay a more simpler version

00:26:33.320 --> 00:26:36.100
And I want let's say

00:26:36.100 --> 00:26:40.420
Some fire replicas and it's going to use this image, right?

00:26:41.060 --> 00:26:42.960
So as like labels

00:26:42.960 --> 00:26:47.040
We have one more cuban its resource called annotations

00:26:47.600 --> 00:26:54.600
So be aware of the indentation under the template in the same indentation as labels

00:26:55.740 --> 00:26:57.120
I am giving

00:26:59.240 --> 00:27:00.040
Annotations

00:27:03.120 --> 00:27:06.120
Okay, it takes the same format as labels

00:27:07.280 --> 00:27:10.200
But annotations are meant for different purposes

00:27:11.060 --> 00:27:14.840
annotations are heavily used by automation tools or

00:27:15.640 --> 00:27:20.120
Kubernetes is also using heavily the annotations. There are many

00:27:21.200 --> 00:27:29.160
system reserved keys annotation keys that we will use to enable or disable or to set some system level

00:27:29.160 --> 00:27:33.280
Properties kubernetes system level properties. You can also use any

00:27:34.260 --> 00:27:36.120
thing like for example

00:27:36.120 --> 00:27:41.300
Logo URL and then you can give the URL for the logo PNG something like that

00:27:41.300 --> 00:27:44.760
You can put some metadata informations on the rotations also

00:27:45.560 --> 00:27:49.220
right, for example, the build tool will use annotations to

00:27:51.000 --> 00:27:52.280
put the

00:27:52.280 --> 00:27:55.460
Build hash template something like that. Okay

00:27:56.120 --> 00:27:59.100
You can't use annotations in the selector query

00:27:59.160 --> 00:28:01.720
You can use label only label in the sector query

00:28:02.560 --> 00:28:06.140
Alright, so for the annotations we have one system

00:28:09.200 --> 00:28:14.620
Reserved annotation key called kubernetes at IO change cause

00:28:15.420 --> 00:28:17.720
some user-friendly text

00:28:18.560 --> 00:28:21.940
That you can have as an value for this rotation

00:28:22.560 --> 00:28:26.880
To quickly identify what's happening with this rollout for example

00:28:29.840 --> 00:28:30.920
Deploying initial

00:28:32.940 --> 00:28:33.480
Version

00:28:34.160 --> 00:28:39.760
1.22 if an Alpine some some user-friendly text that you can provide here

00:28:39.760 --> 00:28:42.680
So this is going to reflect in one place that we will see in a moment

00:28:43.280 --> 00:28:45.240
Okay, this key isn't reserved one

00:28:46.900 --> 00:28:52.520
Fine, so with this change now, I'm going to save this file and apply this yaml file

00:28:53.750 --> 00:28:59.310
We are deploying the first version of our application kubectl

00:29:02.530 --> 00:29:06.990
Apply if nf my web

00:29:11.770 --> 00:29:13.510
Kubectl rollout

00:29:15.750 --> 00:29:19.930
Status for the deploy my web

00:29:20.550 --> 00:29:28.310
As you can see it's showing as there as a running update on the current rollout

00:29:31.310 --> 00:29:37.250
Successfully rolled out perfect. So now you can view history of this deployment

00:29:37.830 --> 00:29:40.130
So far we deployed only one version

00:29:40.870 --> 00:29:43.390
So it should at least show one entry

00:29:45.450 --> 00:29:47.350
See revision number one

00:29:47.560 --> 00:29:55.620
That that the annotations that we gave it reflected here, right if you want to view more information little bit more information

00:29:55.620 --> 00:29:59.960
about that specific revision then you can use revision flag and

00:30:01.020 --> 00:30:03.220
specify the revision number

00:30:03.220 --> 00:30:07.900
That will tell what is the image that's used?

00:30:09.480 --> 00:30:09.740
and

00:30:09.740 --> 00:30:11.800
some additional metadata information

00:30:13.900 --> 00:30:19.480
Okay, we deployed our first version and we are able to view the

00:30:19.480 --> 00:30:25.240
Rollout history comments, right? So now I'm going to make a change. I

00:30:25.240 --> 00:30:29.660
Did some bug fixes and enhancements. I came up with the new version 1.22

00:30:30.860 --> 00:30:35.320
Go back here and I'm going to update the image

00:30:36.660 --> 00:30:39.400
To use the 1.22 version

00:30:41.260 --> 00:30:45.000
I'm dating from 1.22 Alpine

00:30:47.040 --> 00:30:52.020
So in this case, I'm manually updating it so in your CACD scenario

00:30:53.640 --> 00:30:56.140
You can add an annotation automatically

00:30:56.140 --> 00:31:01.880
After your build process and everything is completed so that it will get reflected updated from

00:31:02.480 --> 00:31:04.720
1.22 to 1.22

00:31:06.860 --> 00:31:08.620
And save the file

00:31:10.840 --> 00:31:11.480
I

00:31:11.480 --> 00:31:17.400
Play it so which means all the five parts will be replaced with new five parts that uses version 1.22

00:31:22.700 --> 00:31:23.980
Cubectl apply

00:31:27.280 --> 00:31:29.160
Cubectl rollout status

00:31:33.680 --> 00:31:39.380
Based on the strategies that is there in the ML file it's performing the rollout

00:31:46.140 --> 00:31:46.620
and

00:31:46.620 --> 00:31:48.080
Perfect so if I do history again

00:31:54.220 --> 00:31:58.160
Now I can see to two revisions under the history, right?

00:31:58.320 --> 00:32:03.880
Let's deploy one more and then we can try down to operation pass and resume. You can try it while you are

00:32:04.100 --> 00:32:10.300
Doing the hands-on. So let me show the undo for that. I am going to deploy one more revision

00:32:12.240 --> 00:32:14.840
Let's say I'm going to deploy 1.23

00:32:16.660 --> 00:32:18.500
Back open your email file

00:32:29.420 --> 00:32:30.500
Dating from

00:32:37.140 --> 00:32:37.960
You

00:32:37.960 --> 00:32:41.900
Bear with me there is an split-second delay when I'm typing here

00:32:45.000 --> 00:32:46.900
All right save this

00:32:50.700 --> 00:32:52.820
Go back apply it

00:33:06.620 --> 00:33:09.180
Okay, so if I do history again I

00:33:10.480 --> 00:33:15.960
Can now see three revisions, right? So let's say after deploying 1.23

00:33:15.960 --> 00:33:21.820
I'm getting some errors and blah blah blah. I want to roll out then the same command roll out undo

00:33:28.700 --> 00:33:29.900
The deployment

00:33:30.460 --> 00:33:36.800
My web if I press enter it will roll back to one point two two half one point two two

00:33:36.800 --> 00:33:41.340
The immediate previous version if I want to go back then I need to put

00:33:41.880 --> 00:33:45.060
Two revision and specify the revision number

00:33:45.600 --> 00:33:47.900
Let's say the revision number is one

00:33:49.640 --> 00:33:55.200
And you can view the rollout status the parts getting being replaced

00:33:56.900 --> 00:33:59.880
And it's successfully rolled out and

00:33:59.900 --> 00:34:01.900
If you view the history now

00:34:03.360 --> 00:34:07.420
One became for the revision number will be keep on incrementing so one

00:34:08.220 --> 00:34:15.480
Became four. So we don't see the one here because it already became four, right? So we deployed the initial version back

00:34:17.800 --> 00:34:24.660
Okay, so these rollout features are available only at the deployment resource level

00:34:25.220 --> 00:34:30.300
This is not applicable for replica set this is not applicable at the pod resource level

00:34:32.020 --> 00:34:38.860
Okay, so that's the two thing that we learned from here one is strategy second is

00:34:40.980 --> 00:34:43.860
Making use of this rollout capabilities

00:34:44.600 --> 00:34:46.280
well, you are

00:34:46.280 --> 00:34:52.460
Deploying the new version of the application. So how many versions it will it will maintain that also

00:34:53.540 --> 00:34:58.360
You can have more control. Let's say get deploy

00:34:59.540 --> 00:35:00.940
my web

00:35:00.940 --> 00:35:02.780
Output as an email

00:35:04.960 --> 00:35:12.100
There is one default here revision history limit so by default it will keep past 10

00:35:13.520 --> 00:35:14.220
rollout

00:35:14.220 --> 00:35:18.820
In the history if you do if you do rollout history command if you want 100

00:35:18.820 --> 00:35:24.260
Then you can include this in your email file and then put it as an handle simply over at this default

00:35:25.920 --> 00:35:28.760
Okay revision history limit

00:35:30.820 --> 00:35:35.080
How many revisions you want to see positive visions

00:35:37.520 --> 00:35:39.560
Alright with this our

00:35:39.560 --> 00:35:40.700
deployment

00:35:40.700 --> 00:35:41.840
resource

00:35:42.520 --> 00:35:46.900
Comes to an end. I am going to share this email file with you

00:35:46.900 --> 00:35:54.980
Please give it a try any questions on the deployment

00:35:59.800 --> 00:36:01.900
Deployment and in the rollout features

00:36:09.460 --> 00:36:12.960
Let me also include the kubernetes documentation

00:36:32.780 --> 00:36:33.380
You

00:36:33.380 --> 00:36:37.520
Okay, it already has all the information that we discussed

00:36:40.640 --> 00:36:42.640
Okay, so

00:36:42.640 --> 00:36:50.640
Yep, any questions before I give time for you to try this any questions on the deployment. Perfect. Let's give these comments a quick try, please

00:37:00.600 --> 00:37:02.940
Yes, please is that a question

00:37:20.280 --> 00:37:23.160
Why we use dry run is that a question

00:37:24.560 --> 00:37:28.960
Okay, so okay, so if you are

00:37:28.960 --> 00:37:35.980
If you want to create an email file from scratch. Yes, you can go ahead and you can write an email

00:37:35.980 --> 00:37:37.740
from scratch

00:37:37.740 --> 00:37:40.700
specifying the API versions kind

00:37:41.300 --> 00:37:42.620
Specifications you can define it as a kind

00:37:42.620 --> 00:37:49.280
Or you can copy from the kubernetes documentation some templates and you can modify it right there are two ways

00:37:49.280 --> 00:37:52.820
Scott from scratch or get a template from kubernetes documentation

00:37:52.820 --> 00:37:55.080
another way is

00:37:55.080 --> 00:37:58.560
You are right. You are writing some kubectl command behind the scene

00:37:58.560 --> 00:38:03.320
This guy is translating your command to an email and then submitting to the API server

00:38:03.320 --> 00:38:10.580
If you do kubectl create deployment and press enter is generating an email file and is submitting it to the API server

00:38:11.480 --> 00:38:15.820
So what we are going to do is we are going to ask this kubectl

00:38:17.640 --> 00:38:23.520
For the command that you wrote a dry run, which means don't submit the request to the server

00:38:23.520 --> 00:38:30.100
Just print the email that you will you will send it to the server, but don't submit to the server

00:38:31.680 --> 00:38:37.660
Okay, and we are able to see that email and have we are writing it to an file and having that as a base

00:38:37.660 --> 00:38:43.620
We do some changes and then we are applying on our own by using the application. Okay, dry. Okay this option, right?

00:38:43.620 --> 00:38:48.560
Okay, you can also give it a sense server, which means request will be submitted as well as you will get the email

00:38:48.560 --> 00:38:50.880
I there are multiple options that you can do here

00:38:51.800 --> 00:38:53.700
Okay, let me show the

00:38:54.440 --> 00:38:59.160
Client means at the kubectl client client refers to this kubectl client

00:39:00.600 --> 00:39:03.500
Okay, so you can give options like

00:39:05.480 --> 00:39:06.440
dry run

00:39:06.440 --> 00:39:08.700
client kubernetes

00:39:08.700 --> 00:39:10.960
Let me show from the documentation

00:39:12.840 --> 00:39:14.980
So you can't set it to server

00:39:15.460 --> 00:39:17.180
Where is it? Where is it? Here it is

00:39:17.180 --> 00:39:20.940
It can be non server or a client if if it is a client

00:39:20.940 --> 00:39:26.000
Then it will only print the object that would be sent without sending to the server if server

00:39:26.000 --> 00:39:30.160
Then the records will be submitted to the server without persisting that resources

00:39:30.160 --> 00:39:32.200
Go ahead. Correct. Correct

00:39:32.200 --> 00:39:40.500
So basically, yep, if we don't persist that resource to that city, so it's also more often writer, correct

00:39:40.500 --> 00:39:42.320
So, yep

00:39:42.320 --> 00:39:44.080
That's the purpose come again

00:39:44.980 --> 00:39:46.520
Sorry, I missed the question

00:39:46.520 --> 00:39:52.180
Yes, so basically every request that you submit because you ask this question

00:39:52.180 --> 00:39:58.520
Let me provide a quick level over here. Whatever the request that you submit from your client or dashboard or GUI

00:39:59.320 --> 00:40:03.700
The first component that's going to process is the API server, right?

00:40:04.340 --> 00:40:05.000
so

00:40:05.000 --> 00:40:07.100
in the API server

00:40:07.100 --> 00:40:09.020
within the API server

00:40:10.080 --> 00:40:17.200
Let's say this is the core logic that's going to persist to the etcd database. Okay, so before that core logic

00:40:18.020 --> 00:40:23.200
kicks in your request will pass through three gates that I mentioned in the morning at

00:40:24.220 --> 00:40:24.880
authentication

00:40:25.560 --> 00:40:31.200
Authorization admission controller. So if and only if your request passes in all the gates, let's say

00:40:31.780 --> 00:40:33.620
Velocity is an valid employee

00:40:33.620 --> 00:40:36.920
Velocity has a permission to create a deployment

00:40:37.620 --> 00:40:38.180
velocity

00:40:38.900 --> 00:40:46.920
In each spot specification. He has all the required namespace information resource information something like that. Then only it will be persistent

00:40:47.800 --> 00:40:51.020
So when I say by persisting this is what it is

00:40:51.660 --> 00:40:55.740
Storing that specification in the aml file by including all the defaults and stuff

00:40:56.520 --> 00:41:01.240
Okay, so to answer your question. Yes, if there are something that are missing

00:41:01.240 --> 00:41:03.420
Let's say you're submitting without request

00:41:03.420 --> 00:41:10.240
But you have an admission controller that will perform some validation if an if an request is missing reject the request, right?

00:41:10.260 --> 00:41:12.080
So those validations will happen. Of course

00:41:12.080 --> 00:41:17.700
If you submit right and as a client then it will go through the admission controller layer level

00:41:17.700 --> 00:41:24.940
Authentication authorization, it will be simply rejected if any one of it fails. Okay, you can try an example with dry run as a server and observe the

00:41:26.620 --> 00:41:27.100
difference

00:41:27.100 --> 00:41:34.740
Setting dry run as a server and without dry run server and submit a resource and find the difference. Okay, I hope it helps

00:41:36.300 --> 00:41:37.980
Dry run server

00:41:37.980 --> 00:41:44.300
Let me see if I can include some documentation link so that you can try it. Okay, so here you can see that

00:41:44.440 --> 00:41:48.540
Look at this one if you are giving it as an server

00:41:48.540 --> 00:41:51.680
Your request will actually go through

00:41:52.300 --> 00:41:58.020
authentication authorization and then the admission controller at the admission controller layer level

00:41:58.020 --> 00:42:04.960
We will do some validations. Even the kubernetes can do some mutations, which means as

00:42:04.960 --> 00:42:12.260
Administrator you can run some admission controllers that will do some modifications to your request, which means

00:42:12.260 --> 00:42:17.020
What you submit is not what you are going to see in the kubernetes because

00:42:17.820 --> 00:42:23.420
Your cluster administrator may have an admission controller that will perform some mutation

00:42:23.420 --> 00:42:28.220
let's say if you are submitting and request without namespace an

00:42:28.220 --> 00:42:31.700
Admission controller will include a namespace with value as and Luis

00:42:31.700 --> 00:42:37.100
So those kind of manipulations also we can do so if you dry run as a server

00:42:37.100 --> 00:42:42.240
it will go through authentication authorization and then the admission controller step and

00:42:42.260 --> 00:42:43.740
then that

00:42:43.740 --> 00:42:45.620
File object will be returned to the user

00:42:46.560 --> 00:42:51.600
It won't be persisted to the etc database, but it will go through the server side process

00:42:52.440 --> 00:42:58.040
Which means you will already see the one that has the defaults and steps already included in it

00:42:58.040 --> 00:43:04.100
But in the client you won't have the defaults included because the default included logic happens in the server side

00:43:04.100 --> 00:43:09.180
Okay, is it clear or I did I confused you a lot already? Okay, great great there

00:43:11.640 --> 00:43:20.460
Good I could see a few of them already completed the rollout exercise good job

00:43:21.520 --> 00:43:26.700
Okay, I think we are at the end of the training so if you are progressing you can continue on this

00:43:26.700 --> 00:43:31.140
We only have five more minutes left to conclude the day one

00:43:31.140 --> 00:43:36.060
So I'm going to do a quick review on the topics that we completed today

00:43:36.060 --> 00:43:38.520
Let me go back to the

00:43:38.520 --> 00:43:43.060
Agenda one that we discussed in the morning. It looks like we covered only few resources

00:43:43.060 --> 00:43:48.040
But then the knowledge that we gained. Yep. Go ahead

00:43:48.040 --> 00:43:50.340
Change cause okay. Let me share it

00:43:51.620 --> 00:43:54.860
In the chat. Okay, maybe you need to look at your

00:43:57.340 --> 00:43:57.940
Intendation

00:43:58.860 --> 00:44:04.520
Yes, sure sure sure sure who is this? Okay training room

00:44:06.060 --> 00:44:08.440
Are you in the training room? I'm not seeing you here