1
00:00:02,120 --> 00:00:04,374
So that was the liveness probe.

2
00:00:04,374 --> 00:00:07,320
If we have a look at the official reference,

3
00:00:07,320 --> 00:00:09,270
for the container object,

4
00:00:09,270 --> 00:00:11,304
we see that there's a lot we can configure here.

5
00:00:11,304 --> 00:00:14,029
For example the default command that should be configured,

6
00:00:14,029 --> 00:00:16,685
that should be executed if the container is run,

7
00:00:16,685 --> 00:00:18,021
and you might recall that

8
00:00:18,021 --> 00:00:21,770
that was also possible for Docker-compose,

9
00:00:21,770 --> 00:00:22,814
and to a certain extent,

10
00:00:22,814 --> 00:00:25,309
this of course is equal to Docker-compose.

11
00:00:25,309 --> 00:00:28,710
You define how your containers should be executed

12
00:00:28,710 --> 00:00:29,543
by Kubernetes.

13
00:00:29,543 --> 00:00:32,381
And that's very similar to what we did with Docker-compose.

14
00:00:32,381 --> 00:00:35,845
We defined how containers should be started.

15
00:00:35,845 --> 00:00:38,488
Here of course it's just in the bigger context,

16
00:00:38,488 --> 00:00:40,276
of doing that in a cluster.

17
00:00:40,276 --> 00:00:43,708
So besides defining how our containers should be executed,

18
00:00:43,708 --> 00:00:48,708
we also define our cluster relevant things like services.

19
00:00:49,126 --> 00:00:50,825
But therefore it shouldn't be a surprise

20
00:00:50,825 --> 00:00:52,318
that on the container level,

21
00:00:52,318 --> 00:00:54,926
you can configure a lot of things,

22
00:00:54,926 --> 00:00:58,757
which you also can configure when executing Docker run,

23
00:00:58,757 --> 00:01:00,930
or in a Docker-compose file.

24
00:01:00,930 --> 00:01:04,750
For example all the environment variables,

25
00:01:04,750 --> 00:01:07,975
or the image, but also then Kubernetes is specific,

26
00:01:07,975 --> 00:01:10,748
how the image should be pulled.

27
00:01:10,748 --> 00:01:12,454
And that's quite interesting.

28
00:01:12,454 --> 00:01:17,419
You might remember that earlier when we updated our image,

29
00:01:17,419 --> 00:01:20,920
it didn't pick up that image change,

30
00:01:20,920 --> 00:01:23,720
unless we changed the image tag.

31
00:01:23,720 --> 00:01:26,359
Well it turns out, that it should have picked it up,

32
00:01:26,359 --> 00:01:30,603
if we defined latest, as the image tag here.

33
00:01:31,470 --> 00:01:34,240
Because then it will always pull the image

34
00:01:34,240 --> 00:01:36,712
and use the latest image therefore.

35
00:01:36,712 --> 00:01:39,640
But if you don't specify colon latest,

36
00:01:39,640 --> 00:01:41,737
it will not re pull it.

37
00:01:41,737 --> 00:01:44,634
So that's something you can of course also configure here.

38
00:01:44,634 --> 00:01:47,412
You can add the image pull policy,

39
00:01:47,412 --> 00:01:49,398
and set that to always,

40
00:01:49,398 --> 00:01:51,940
to always pull the latest image,

41
00:01:51,940 --> 00:01:55,670
even if you have no tag specified at all,

42
00:01:55,670 --> 00:01:57,681
or you go with the default in which case you don't need

43
00:01:57,681 --> 00:01:59,426
to specify this,

44
00:01:59,426 --> 00:02:03,030
or you set it to one of the other supported values,

45
00:02:03,030 --> 00:02:05,710
like never or if not present.

46
00:02:05,710 --> 00:02:08,122
So that it's only pulled if it's not there yet,

47
00:02:08,122 --> 00:02:10,955
or that you don't even try pulling it.

48
00:02:10,955 --> 00:02:15,015
Of course that might rarely be helpful, but you can set it.

49
00:02:15,015 --> 00:02:16,814
And here I'll set it to always,

50
00:02:16,814 --> 00:02:21,697
to always force pulling that latest image on that tag.

51
00:02:21,697 --> 00:02:24,950
So now if we would redeploy our application

52
00:02:24,950 --> 00:02:28,986
on the same tag as before, it should still pull it.

53
00:02:28,986 --> 00:02:32,120
And let's maybe give this a try right away.

54
00:02:32,120 --> 00:02:33,976
Let's change something in our code.

55
00:02:33,976 --> 00:02:37,433
Let's say we remove that paragraph again,

56
00:02:37,433 --> 00:02:39,843
which fit the moments still have here.

57
00:02:39,843 --> 00:02:42,697
And we remove all the extra exclamation marks.

58
00:02:42,697 --> 00:02:46,014
Instead we add one in the frontier,

59
00:02:46,014 --> 00:02:48,747
then we can of course build this image,

60
00:02:48,747 --> 00:02:51,195
with that tag, which we need to push it.

61
00:02:51,195 --> 00:02:56,195
So our repository image name Kub first app.

62
00:02:57,990 --> 00:03:00,775
And I want to build it on that tag too.

63
00:03:00,775 --> 00:03:03,563
So call colon two has to be added here.

64
00:03:05,166 --> 00:03:07,743
So thereafter We can push it,

65
00:03:10,601 --> 00:03:13,350
like this, on that tag.

66
00:03:13,350 --> 00:03:15,465
And now since the tag didn't change,

67
00:03:15,465 --> 00:03:20,465
previously Kubernetes would not pull the image again, right?

68
00:03:20,698 --> 00:03:22,447
Because that's what we learn.

69
00:03:22,447 --> 00:03:26,242
And now I pushed to the same tag we already used,

70
00:03:26,242 --> 00:03:29,851
but because of our image pull policy always,

71
00:03:29,851 --> 00:03:34,068
Kubernetes now hopefully stills pulls that latest image,

72
00:03:34,068 --> 00:03:37,707
if we change something about the deployment.

73
00:03:37,707 --> 00:03:42,707
So if I apply this deployment.yaml file,

74
00:03:43,710 --> 00:03:46,143
it should re pull that image,

75
00:03:48,750 --> 00:03:50,747
and therefore if you run get pods,

76
00:03:50,747 --> 00:03:53,440
you indeed see one container is being terminated,

77
00:03:53,440 --> 00:03:56,600
And then new one is getting started,

78
00:03:56,600 --> 00:03:58,389
because it detected a change in the image,

79
00:03:58,389 --> 00:04:00,963
and therefore it's performing a rolling update,

80
00:04:00,963 --> 00:04:03,249
and it's rolling out this latest version

81
00:04:03,249 --> 00:04:05,167
or this new version of the app.

82
00:04:05,167 --> 00:04:07,660
So after some seconds, if you reload,

83
00:04:07,660 --> 00:04:10,532
you see that latest version.

84
00:04:10,532 --> 00:04:12,358
So that's always good to know.

85
00:04:12,358 --> 00:04:13,976
And these are the kind of things

86
00:04:13,976 --> 00:04:16,718
you can of course find out in the docs here.

87
00:04:16,718 --> 00:04:18,632
Now there's still will be many options,

88
00:04:18,632 --> 00:04:21,815
which you rarely need to set, but I do recommend

89
00:04:21,815 --> 00:04:24,379
that you do have a look at this documentation

90
00:04:24,379 --> 00:04:28,238
from time to time, to find out what you can configure here.

91
00:04:28,238 --> 00:04:30,713
Of course there also are certain options

92
00:04:30,713 --> 00:04:32,423
like these volume options,

93
00:04:32,423 --> 00:04:35,414
which we'll have a look at together later in the course,

94
00:04:35,414 --> 00:04:37,751
when we talk about volumes being used

95
00:04:37,751 --> 00:04:40,569
in a Kubernetes managed application.

96
00:04:40,569 --> 00:04:42,272
You can also not just check out

97
00:04:42,272 --> 00:04:44,694
the specification of containers,

98
00:04:44,694 --> 00:04:46,035
but also of the pods

99
00:04:46,035 --> 00:04:48,280
to find out what could be configured there.

100
00:04:48,280 --> 00:04:51,873
Even though again, many things here are rarely needed,

101
00:04:51,873 --> 00:04:54,837
and might not tell you much, which is totally fine.

102
00:04:54,837 --> 00:04:56,352
In that case the official docs

103
00:04:56,352 --> 00:04:58,646
are always a place you can dive into.

104
00:04:58,646 --> 00:05:02,268
But with that we actually got all we need for the moment.

105
00:05:02,268 --> 00:05:07,268
So what I'll do now here, is I'll delete my deployment,

106
00:05:09,598 --> 00:05:13,510
by deleting the files so to say,

107
00:05:13,510 --> 00:05:15,648
by pointing at the files of the resources

108
00:05:15,648 --> 00:05:17,530
that should be deleted,

109
00:05:17,530 --> 00:05:19,347
and we can now wrap up this module,

110
00:05:19,347 --> 00:05:21,416
and then move on to the next module,

111
00:05:21,416 --> 00:05:24,550
where we dive deeper into Kubernetes.

