1
00:00:04,500 --> 00:00:06,300
And now let's try following.

2
00:00:06,330 --> 00:00:14,160
Let's try to update version of the image in our deployment notice here.

3
00:00:14,190 --> 00:00:17,250
That strategy type is a rolling update.

4
00:00:17,550 --> 00:00:22,380
What does it mean when you release new version of your application?

5
00:00:22,590 --> 00:00:29,880
Of course you want to roll out this new version in production smoothly without any interruption of service.

6
00:00:29,940 --> 00:00:32,670
And Kubernetes allows that out of the box.

7
00:00:32,670 --> 00:00:34,500
And this is very easy.

8
00:00:35,250 --> 00:00:46,020
And this strategy type rolling update means that new ports will be created with new image while previous

9
00:00:46,020 --> 00:00:48,360
ports will be still running.

10
00:00:49,390 --> 00:00:52,900
So both will be replaced one by one.

11
00:00:53,110 --> 00:00:58,660
And finally, in some time, all both will be running in your updated image.

12
00:00:59,050 --> 00:01:01,450
And now let's try that in action.

13
00:01:01,690 --> 00:01:07,930
We will update a bit our application and the build to new image with another tag.

14
00:01:07,930 --> 00:01:10,470
For instance, version 2.0.0.

15
00:01:10,480 --> 00:01:19,150
And afterwards we will modify image in our deployment and see what will happen, how Kubernetes will

16
00:01:19,150 --> 00:01:21,190
roll out this update.

17
00:01:21,820 --> 00:01:24,400
So let's go ahead and do that.

18
00:01:24,850 --> 00:01:31,270
By the way, I don't need this step anymore where I created a SSH connection to Node.

19
00:01:31,300 --> 00:01:38,620
Therefore, let me exit from this connection and close this step actually, and I'll keep only one tap

20
00:01:38,620 --> 00:01:39,280
open.

21
00:01:39,520 --> 00:01:48,520
So let's go back to Visual Studio code and here are contents of the index dot mj's file and we already

22
00:01:48,520 --> 00:01:56,620
have image available for this version of the application where server answers us with such string.

23
00:01:56,860 --> 00:01:59,270
Now let's modify this string.

24
00:01:59,290 --> 00:02:03,340
For instance, let's add here prefix version two like that.

25
00:02:04,360 --> 00:02:12,070
And let's now build new image with a new tag, push it to Docker Hub and afterwards modify image in

26
00:02:12,070 --> 00:02:13,150
our deployment.

27
00:02:13,210 --> 00:02:20,770
Let's save changes in this file, open up a better terminal and let's build image and assign a novel

28
00:02:20,770 --> 00:02:21,610
tech to it.

29
00:02:21,880 --> 00:02:24,010
Now Image has only a single tag.

30
00:02:24,010 --> 00:02:25,000
It is latest.

31
00:02:25,000 --> 00:02:31,180
So let's build new image docker build dot DST tag.

32
00:02:31,210 --> 00:02:40,040
This should prevent your name if you want to push this version of the image to your Docker hub account.

33
00:02:40,060 --> 00:02:45,040
So this task and here will be name of the image gate as web.

34
00:02:45,040 --> 00:02:45,850
Hello.

35
00:02:45,850 --> 00:02:51,070
And after column I'll add the tag for instance 2.0.0.

36
00:02:51,100 --> 00:02:51,910
Like that.

37
00:02:52,810 --> 00:02:56,710
Let's build the such image that I modify it.

38
00:02:56,710 --> 00:03:04,180
Index dot mdgs file and I updated this string so it should build new image.

39
00:03:04,540 --> 00:03:06,220
Let's go ahead and build it.

40
00:03:07,820 --> 00:03:10,630
Building exporting layers.

41
00:03:10,760 --> 00:03:14,420
Image was built and now let's push it to Docker Hub.

42
00:03:14,510 --> 00:03:17,750
I'll copy this name, including Tag.

43
00:03:18,320 --> 00:03:26,510
And now here I enter Docker Push and new version of my application will be pushed using separate tech

44
00:03:26,510 --> 00:03:28,820
for the same gate as web.

45
00:03:28,820 --> 00:03:29,760
Hello image.

46
00:03:29,780 --> 00:03:31,610
So let's go ahead and push.

47
00:03:32,730 --> 00:03:33,450
Pushing.

48
00:03:35,040 --> 00:03:39,360
I see that some layers already exist and only one layer was pushed.

49
00:03:40,810 --> 00:03:42,990
So image was pushed successfully.

50
00:03:43,000 --> 00:03:44,410
Let me verify that.

51
00:03:44,470 --> 00:03:47,350
Go to my Docker hub account.

52
00:03:47,350 --> 00:03:48,190
Refresh.

53
00:03:52,790 --> 00:03:55,300
I still see just a single image.

54
00:03:55,310 --> 00:03:55,930
Here it is.

55
00:03:55,940 --> 00:03:57,050
Let me click on it.

56
00:03:58,140 --> 00:04:03,120
And here I should find to text latest and 2.0.0.

57
00:04:03,750 --> 00:04:08,720
Now let's deploy this new version of this image.

58
00:04:08,730 --> 00:04:11,790
And for that, we will utilize following command.

59
00:04:11,820 --> 00:04:16,860
Let's go to the terminal here and let's set new image for the deployment.

60
00:04:17,430 --> 00:04:18,690
Set image.

61
00:04:18,720 --> 00:04:22,079
We are setting new image for particular deployment.

62
00:04:22,110 --> 00:04:23,640
Next will be deployment.

63
00:04:24,600 --> 00:04:25,950
Name of the deployment.

64
00:04:25,980 --> 00:04:27,990
Kay, it's web.

65
00:04:28,020 --> 00:04:28,800
Hello.

66
00:04:28,800 --> 00:04:34,050
And afterwards, we need to select ports where we would like to set new image.

67
00:04:34,350 --> 00:04:37,500
Here we will write k eight as web.

68
00:04:37,530 --> 00:04:38,340
Hello.

69
00:04:38,580 --> 00:04:43,200
And after equal sign, we will specify new image.

70
00:04:43,230 --> 00:04:48,630
In my case it is business slash k eight as web.

71
00:04:48,660 --> 00:04:49,440
Hello.

72
00:04:49,920 --> 00:04:52,590
Column 2.0.0.

73
00:04:52,620 --> 00:05:00,540
That's a new tech which was assigned by us before we pushed the new version of the image to Docker Hub.

74
00:05:01,930 --> 00:05:08,080
After entering this command image will be changed and rollout update will be started.

75
00:05:08,680 --> 00:05:12,280
Be ready to enter following command after this one.

76
00:05:12,640 --> 00:05:17,010
K Rollout Status Deployment k eight as web.

77
00:05:17,020 --> 00:05:17,620
Hello.

78
00:05:17,770 --> 00:05:24,430
You could prepare this command somewhere in the text editor and afterwards quickly paste it after this

79
00:05:24,430 --> 00:05:25,090
command.

80
00:05:25,120 --> 00:05:27,550
I'll try to enter it manually.

81
00:05:27,580 --> 00:05:29,770
Let's go ahead and change image.

82
00:05:29,800 --> 00:05:30,280
Image.

83
00:05:30,280 --> 00:05:35,230
Updated K Rollout Status Deployment.

84
00:05:35,950 --> 00:05:37,030
Gates.

85
00:05:37,030 --> 00:05:37,660
Webb.

86
00:05:37,690 --> 00:05:38,440
Hello.

87
00:05:39,570 --> 00:05:41,910
Waiting for deployment or allowed to finish.

88
00:05:42,210 --> 00:05:46,680
And now I see the deployment successfully rolled out.

89
00:05:47,770 --> 00:05:54,680
And before I saw such messages as three out of four new replicas have been updated.

90
00:05:54,700 --> 00:05:58,580
One old replicas are pending termination and so on.

91
00:05:58,600 --> 00:06:06,520
Finally, all previous replicas were terminated and new replicas were rolled out.

92
00:06:07,030 --> 00:06:16,060
Lets now list bots get bots and now I see that there are four bots and notice age of those spots.

93
00:06:16,790 --> 00:06:18,920
From 30 to 40 seconds.

94
00:06:19,190 --> 00:06:26,080
It means that previous sports were fully terminated and new boats were created.

95
00:06:26,090 --> 00:06:33,680
And now in all those four boats, we are running a new version of our application and we could verify

96
00:06:33,680 --> 00:06:38,000
that very easily by accessing our deployment.

97
00:06:38,000 --> 00:06:40,550
Using service, there was still service.

98
00:06:40,550 --> 00:06:42,050
Get get SVC.

99
00:06:43,010 --> 00:06:49,820
Type of it is a load balancer and here is cluster IP, here is port and by entering command mini cube

100
00:06:49,820 --> 00:06:52,810
service k8s web.

101
00:06:52,820 --> 00:06:53,390
Hello.

102
00:06:53,420 --> 00:06:57,920
I could open a connection to one of the running ports, so let's go ahead.

103
00:06:59,410 --> 00:07:04,050
Connection was opened and now I see response, which includes version two.

104
00:07:05,360 --> 00:07:08,000
That's how rolling updates work.

105
00:07:08,030 --> 00:07:13,700
You could refresh page here and you should see a response from other server, for instance, this one.

106
00:07:14,390 --> 00:07:16,720
And again here I see version two.

107
00:07:16,730 --> 00:07:23,690
It means that our new application version was successfully deployed to all ports in the deployment.

108
00:07:24,710 --> 00:07:25,520
Wonderful.

109
00:07:25,520 --> 00:07:27,110
That's where I rolling updates.

110
00:07:27,110 --> 00:07:33,500
And that's how you could check status of the rolling update by entering command k rollout status.

111
00:07:34,510 --> 00:07:35,250
This one.

112
00:07:35,260 --> 00:07:41,890
If you would like, you could create one more tag for your image, push it to Docker Hub and verify

113
00:07:41,890 --> 00:07:43,620
how rollout works again.

114
00:07:43,630 --> 00:07:47,320
Or if you want, you could roll back to previous versions.

115
00:07:47,350 --> 00:07:50,330
By the way, we could quickly try that together.

116
00:07:50,350 --> 00:07:58,140
Let's go to this command and here I will remove tech and it will mean that I would like to utilize all

117
00:07:58,150 --> 00:07:58,960
latest tech.

118
00:07:58,960 --> 00:08:02,110
And let's check how image will be modified again.

119
00:08:02,110 --> 00:08:06,340
And we are actually going back to previous version of our application.

120
00:08:06,520 --> 00:08:08,020
Let's modify image.

121
00:08:08,800 --> 00:08:09,660
Let's check.

122
00:08:10,920 --> 00:08:12,100
You're allowed status.

123
00:08:13,370 --> 00:08:20,090
Two out of four new replicas have been updated, waiting for deployment rollout to finish and finally

124
00:08:20,090 --> 00:08:22,430
deployment successfully rolled out.

125
00:08:22,430 --> 00:08:28,190
And again, I will see four completely new ports get ports.

126
00:08:28,990 --> 00:08:30,670
Here was age of those four.

127
00:08:31,840 --> 00:08:36,549
Let's connect to our deployment again, meaning service k eight as well.

128
00:08:36,580 --> 00:08:37,240
Hello.

129
00:08:37,539 --> 00:08:41,590
And I again say hello from the server without version two.

130
00:08:42,070 --> 00:08:44,140
That's where rolling updates.

