1
00:00:02,120 --> 00:00:05,370
So we saw how we can use the declarative approach.

2
00:00:05,370 --> 00:00:10,370
How can we now make changes to our deployments or services?

3
00:00:10,670 --> 00:00:13,060
Well, the cool thing is you can simply change something

4
00:00:13,060 --> 00:00:15,750
in your Yaml files, reapply the files

5
00:00:15,750 --> 00:00:20,070
and the necessary changes will be made in your cluster.

6
00:00:20,070 --> 00:00:23,020
For example, if you wanna change the number of replicas

7
00:00:23,020 --> 00:00:26,530
for the deployment, you can change it in Yaml file,

8
00:00:26,530 --> 00:00:30,373
save the file and then simply apply it again.

9
00:00:31,910 --> 00:00:34,670
So we run the kub control applied dash f

10
00:00:34,670 --> 00:00:36,150
deployment Yaml file.

11
00:00:36,150 --> 00:00:40,260
Again, if we hit enter, these changes will be made

12
00:00:40,260 --> 00:00:42,490
and therefore if you now run get pods,

13
00:00:42,490 --> 00:00:44,320
you'll see that you get free pods

14
00:00:44,320 --> 00:00:47,180
because we specified three replicas here.

15
00:00:47,180 --> 00:00:48,763
And that's how easy it is.

16
00:00:49,690 --> 00:00:51,630
And if you wanna scale down again

17
00:00:51,630 --> 00:00:54,070
you can of course, rechange this,

18
00:00:54,070 --> 00:00:56,030
apply these changes

19
00:00:56,030 --> 00:00:58,480
and then after a while,

20
00:00:58,480 --> 00:01:00,780
you will see that you got only one pod,

21
00:01:00,780 --> 00:01:03,723
you'll see, two pods are already terminating here.

22
00:01:05,099 --> 00:01:08,740
Now, what if we wanted to change the image for example,

23
00:01:08,740 --> 00:01:11,940
if we wanna go back to kub first app here

24
00:01:12,920 --> 00:01:15,500
we can also change the image here

25
00:01:15,500 --> 00:01:19,453
and then apply this and now see whether that has an effect.

26
00:01:20,830 --> 00:01:23,420
And you see if I reload, it does.

27
00:01:23,420 --> 00:01:27,200
So that is how easy it is to make changes

28
00:01:27,200 --> 00:01:28,730
to your deployments

29
00:01:28,730 --> 00:01:31,940
or to your configuration files in general.

30
00:01:31,940 --> 00:01:33,590
And that's of course, another advantage

31
00:01:33,590 --> 00:01:35,640
of this declarative approach.

32
00:01:35,640 --> 00:01:38,180
You can just change these conflict files,

33
00:01:38,180 --> 00:01:41,490
reapply them, and your changes will be applied.

34
00:01:41,490 --> 00:01:44,090
You don't have to type long commands again

35
00:01:44,090 --> 00:01:46,150
and you can only change single things

36
00:01:46,150 --> 00:01:48,770
and only these changes will then be applied.

37
00:01:48,770 --> 00:01:51,290
So you don't have to repeat an entire command

38
00:01:51,290 --> 00:01:54,250
just to change one option in the command.

39
00:01:54,250 --> 00:01:57,410
With the declarative approach, that's not required.

40
00:01:57,410 --> 00:02:01,170
In addition, of course, you can check this Yaml file

41
00:02:01,170 --> 00:02:03,728
into source, control and also use tools like

42
00:02:03,728 --> 00:02:07,028
Git to therefore for keep track of different versions

43
00:02:07,028 --> 00:02:09,210
of this Yaml file.

44
00:02:09,210 --> 00:02:11,610
So that's another advantage you would have here.

45
00:02:13,040 --> 00:02:17,580
With that however, I'll go back to the tac two here

46
00:02:17,580 --> 00:02:19,180
and apply that.

47
00:02:19,180 --> 00:02:22,220
And if I now reload, we get this again.

48
00:02:22,220 --> 00:02:23,100
So that's awesome,

49
00:02:23,100 --> 00:02:25,150
that's how easy we can make changes here.

50
00:02:26,330 --> 00:02:29,190
Now what about deleting resources?

51
00:02:29,190 --> 00:02:30,760
You also got a command for that

52
00:02:30,760 --> 00:02:32,800
and that's the kub control delete command

53
00:02:32,800 --> 00:02:34,790
which we saw before already,

54
00:02:34,790 --> 00:02:36,710
but besides deleting a deployment

55
00:02:36,710 --> 00:02:40,170
by targeting it by its name, which you still could do,

56
00:02:40,170 --> 00:02:43,050
just because you created it declaratively,

57
00:02:43,050 --> 00:02:46,090
doesn't mean that you can't delete it imperatively,

58
00:02:46,090 --> 00:02:49,970
so we could delete our deployment by its name here,

59
00:02:49,970 --> 00:02:52,460
which we chose, so by this name

60
00:02:53,770 --> 00:02:58,100
but you can also simply call kub control delete dash f

61
00:02:58,100 --> 00:03:02,010
and then point at the file name, which you wanna delete.

62
00:03:02,010 --> 00:03:04,400
And it's not the file, which will be deleted

63
00:03:04,400 --> 00:03:08,800
but the resources that were created based on the file.

64
00:03:08,800 --> 00:03:11,030
And if you wanna delete multiple resources

65
00:03:11,030 --> 00:03:13,070
you can separate them with a comma here

66
00:03:14,210 --> 00:03:19,210
or simply add multiple dash f option flax here like this.

67
00:03:20,810 --> 00:03:22,080
I'm not going to do it here

68
00:03:22,080 --> 00:03:23,720
we're going to do it in the next lecture

69
00:03:23,720 --> 00:03:26,160
but this is how you can delete resources

70
00:03:26,160 --> 00:03:28,370
in a declarative approach

71
00:03:28,370 --> 00:03:31,170
or if you want still in an imperative approach.

72
00:03:31,170 --> 00:03:33,550
So you don't have to go with the declarative one,

73
00:03:33,550 --> 00:03:35,966
you can also use the imperative way of deleting,

74
00:03:35,966 --> 00:03:39,113
even though we created it declaratively.

