1
00:00:02,060 --> 00:00:04,760
Now I did already outline the problems.

2
00:00:04,760 --> 00:00:06,050
Problems start,

3
00:00:06,050 --> 00:00:08,520
when our containers are restarted.

4
00:00:08,520 --> 00:00:10,150
Now, here in this application,

5
00:00:10,150 --> 00:00:13,810
we got no obvious way of restarting a container

6
00:00:13,810 --> 00:00:16,560
because I got no error at point

7
00:00:16,560 --> 00:00:18,230
as I did have it in the past.

8
00:00:18,230 --> 00:00:20,380
But of course there could be circumstances

9
00:00:20,380 --> 00:00:22,560
where this container does restart.

10
00:00:22,560 --> 00:00:25,160
Because maybe it gets so much traffic

11
00:00:25,160 --> 00:00:27,570
that some process times out

12
00:00:27,570 --> 00:00:31,010
and therefore the container crashes and needs to be restart.

13
00:00:31,010 --> 00:00:34,530
There definitely are scenarios where this could happen.

14
00:00:34,530 --> 00:00:39,530
There are always scenarios where your applications crash.

15
00:00:39,650 --> 00:00:41,960
And when that container restarts,

16
00:00:41,960 --> 00:00:44,760
because currently we're not using any volumes here

17
00:00:44,760 --> 00:00:46,600
on this Kubernetes cluster,

18
00:00:46,600 --> 00:00:48,660
all the data would be lost.

19
00:00:48,660 --> 00:00:50,740
So the data which I'm getting here.

20
00:00:50,740 --> 00:00:54,020
And that's something we wanna solve with volumes.

21
00:00:54,020 --> 00:00:56,910
Now, if you search for Kubernetes volumes,

22
00:00:56,910 --> 00:00:59,540
you should find an article from the official docs.

23
00:00:59,540 --> 00:01:02,300
And of course there you can learn way more about it

24
00:01:02,300 --> 00:01:03,295
if you want to.

25
00:01:03,295 --> 00:01:05,370
But most importantly here,

26
00:01:05,370 --> 00:01:06,950
you find the different types

27
00:01:06,950 --> 00:01:09,153
of volumes which are supported.

28
00:01:10,220 --> 00:01:11,940
And that's what I meant before.

29
00:01:11,940 --> 00:01:14,610
Kubernetes, supports a broad variety

30
00:01:14,610 --> 00:01:18,030
of volume types and drivers.

31
00:01:18,030 --> 00:01:19,230
And the reason for that

32
00:01:19,230 --> 00:01:21,900
is that you don't just run Kubernetes

33
00:01:21,900 --> 00:01:23,600
on your local machine,

34
00:01:23,600 --> 00:01:24,740
even though we technically

35
00:01:24,740 --> 00:01:27,210
are doing this right now of course with minikube.

36
00:01:27,210 --> 00:01:30,040
But even that is a separate virtual machine

37
00:01:30,040 --> 00:01:31,440
on our local machine.

38
00:01:31,440 --> 00:01:33,840
So it is like a different machine in the end.

39
00:01:33,840 --> 00:01:34,730
But in reality,

40
00:01:34,730 --> 00:01:36,480
of course it will also use kubernetes

41
00:01:36,480 --> 00:01:37,930
to deploy your application

42
00:01:37,930 --> 00:01:41,000
to some cloud provider or some data center.

43
00:01:41,000 --> 00:01:43,400
And therefore you have a broad variety

44
00:01:43,400 --> 00:01:44,233
of

45
00:01:44,233 --> 00:01:46,600
ways of storing your data.

46
00:01:46,600 --> 00:01:49,740
Because it's not just your local hard drive

47
00:01:49,740 --> 00:01:52,520
as the case of just Docker volumes,

48
00:01:52,520 --> 00:01:55,400
but instead maybe you are using AWS

49
00:01:55,400 --> 00:01:59,400
and you wanna use their elastic block store service.

50
00:01:59,400 --> 00:02:01,340
Which is a service we haven't used

51
00:02:01,340 --> 00:02:02,800
up to this point in this course,

52
00:02:02,800 --> 00:02:06,530
but which is another storage service that you have

53
00:02:06,530 --> 00:02:08,910
or maybe you're using Microsoft Azure

54
00:02:08,910 --> 00:02:11,520
and therefore you wanna use one of these services

55
00:02:11,520 --> 00:02:13,647
or any other provider

56
00:02:13,647 --> 00:02:16,293
or type of volume here.

57
00:02:16,293 --> 00:02:18,814
And this list might look overwhelming.

58
00:02:18,814 --> 00:02:20,550
Of course in reality,

59
00:02:20,550 --> 00:02:23,960
you will not need all these types all the time.

60
00:02:23,960 --> 00:02:26,900
It depends on how you're hosting your application

61
00:02:26,900 --> 00:02:29,340
and the deeper you dive into Kubernetes of course,

62
00:02:29,340 --> 00:02:32,283
the more you will know about these different options.

63
00:02:33,670 --> 00:02:34,503
For

64
00:02:34,503 --> 00:02:36,620
this course section,

65
00:02:36,620 --> 00:02:40,490
we are going to focus on this CSI type.

66
00:02:40,490 --> 00:02:43,390
We are going to dive into the emptyDir type

67
00:02:43,390 --> 00:02:46,510
and we're going to have a look at the hostpath type.

68
00:02:46,510 --> 00:02:49,360
And actually we're going to start with emptyDir

69
00:02:49,360 --> 00:02:51,910
and have a look at the other types thereafter.

70
00:02:51,910 --> 00:02:53,620
The key thing is that

71
00:02:53,620 --> 00:02:56,941
all these types don't influence how volumes work

72
00:02:56,941 --> 00:02:58,760
inside of a container.

73
00:02:58,760 --> 00:03:01,630
There it's always just some path,

74
00:03:01,630 --> 00:03:04,520
which is then also stored outside of the container.

75
00:03:04,520 --> 00:03:06,760
So basically just like volumes work

76
00:03:06,760 --> 00:03:08,542
with just Docker as well.

77
00:03:08,542 --> 00:03:10,920
But the difference here just is that,

78
00:03:10,920 --> 00:03:14,310
how the data is stored outside of the container

79
00:03:14,310 --> 00:03:18,203
depends on which type or driver you use here.

80
00:03:19,440 --> 00:03:20,273
So with that,

81
00:03:20,273 --> 00:03:22,980
let's start with this emptyDir type here

82
00:03:22,980 --> 00:03:26,270
and let's learn how we can configure a volume

83
00:03:26,270 --> 00:03:27,853
with Kubernetes.

