1
00:00:02,330 --> 00:00:03,730
So let's take a closer look

2
00:00:03,730 --> 00:00:06,000
at these Worker Nodes now.

3
00:00:06,000 --> 00:00:07,760
A Worker Node, as I mentioned,

4
00:00:07,760 --> 00:00:10,870
is simply our machine, a computer,

5
00:00:10,870 --> 00:00:14,810
an ec2 instance, for example, running somewhere.

6
00:00:14,810 --> 00:00:17,220
And the Worker Node is managed

7
00:00:17,220 --> 00:00:19,553
by the Master Node, as I explained.

8
00:00:20,610 --> 00:00:22,620
Now, inside of that Worker Node,

9
00:00:22,620 --> 00:00:25,320
we have our Pods.

10
00:00:25,320 --> 00:00:28,290
And a Pod simply hosts one or more

11
00:00:28,290 --> 00:00:30,740
application containers and all their

12
00:00:30,740 --> 00:00:33,680
resources belonging to these containers.

13
00:00:33,680 --> 00:00:35,410
For example, the configuration

14
00:00:35,410 --> 00:00:37,290
to run the containers correctly,

15
00:00:37,290 --> 00:00:39,630
but also things like volumes.

16
00:00:39,630 --> 00:00:43,320
And the Pods themselves are managed by Kubernetes,

17
00:00:43,320 --> 00:00:45,270
again, by this Master Node.

18
00:00:45,270 --> 00:00:46,960
So, Kubernetes can, for example,

19
00:00:46,960 --> 00:00:49,080
create or delete Pods.

20
00:00:49,080 --> 00:00:51,120
And when a Pod is deleted,

21
00:00:51,120 --> 00:00:54,010
the Pod internally is then able to run

22
00:00:54,010 --> 00:00:57,430
and manage the Container that belongs to the Pod.

23
00:00:57,430 --> 00:01:00,220
And, of course, you can have one Container in a Pod,

24
00:01:00,220 --> 00:01:02,180
but if you have multiple Containers,

25
00:01:02,180 --> 00:01:04,650
which need to work together closely,

26
00:01:04,650 --> 00:01:06,730
you could also have multiple Containers

27
00:01:06,730 --> 00:01:08,330
inside of a Pod.

28
00:01:08,330 --> 00:01:11,670
And then any additional resources that might be needed,

29
00:01:11,670 --> 00:01:14,550
like for example, a Volume, so some space on a

30
00:01:14,550 --> 00:01:18,660
hard drive which the Containers can talk to.

31
00:01:18,660 --> 00:01:21,850
And as I also mentioned, the idea typically is

32
00:01:21,850 --> 00:01:23,690
that you have more than one Pod

33
00:01:23,690 --> 00:01:26,780
running on a given Worker Node.

34
00:01:26,780 --> 00:01:29,810
Now, that can be a copy of another Pod,

35
00:01:29,810 --> 00:01:32,290
in case you're scaling it up and you want to have

36
00:01:32,290 --> 00:01:34,920
multiple instances off one and the same

37
00:01:34,920 --> 00:01:37,670
Container up and running to distribute

38
00:01:37,670 --> 00:01:39,740
incoming traffic, for example.

39
00:01:39,740 --> 00:01:42,560
But it can also be a Pod with a totally different

40
00:01:42,560 --> 00:01:46,140
Container inside of it to do a totally different task.

41
00:01:46,140 --> 00:01:49,090
Because the Worker Node is not task specific,

42
00:01:49,090 --> 00:01:52,810
the Worker Node, it's really important to keep this in mind,

43
00:01:52,810 --> 00:01:55,480
is just your computer, your machine.

44
00:01:55,480 --> 00:01:58,410
It's just a machine somewhere on the internet

45
00:01:58,410 --> 00:02:00,850
with a certain amount of CPU and memory,

46
00:02:00,850 --> 00:02:03,420
and, therefore, you can of course run totally

47
00:02:03,420 --> 00:02:06,300
different Containers and tasks on it,

48
00:02:06,300 --> 00:02:08,210
just as you can run totally different

49
00:02:08,210 --> 00:02:11,240
Containers on our own development machine.

50
00:02:11,240 --> 00:02:13,050
With the "docker run" command,

51
00:02:13,050 --> 00:02:15,660
I can run as many Containers based on

52
00:02:15,660 --> 00:02:18,490
as many different images as I want.

53
00:02:18,490 --> 00:02:21,000
And we actually did this throughout the course,

54
00:02:21,000 --> 00:02:22,920
also with "docker compose".

55
00:02:22,920 --> 00:02:25,340
We definitely had a backend, a frontend,

56
00:02:25,340 --> 00:02:29,750
and a database container running all on our local machine.

57
00:02:29,750 --> 00:02:32,100
And it's basically the same with a Worker Node.

58
00:02:32,100 --> 00:02:33,949
It's just on our local machine, but some machine

59
00:02:33,949 --> 00:02:37,530
out there in the internet offered by some

60
00:02:37,530 --> 00:02:39,093
cloud provider, typically.

61
00:02:39,980 --> 00:02:42,380
Now on this Worker Node, we then all don't just

62
00:02:42,380 --> 00:02:45,570
have these Pods, but also some additional software.

63
00:02:45,570 --> 00:02:48,690
For example, Docker needs to be installed there,

64
00:02:48,690 --> 00:02:51,720
because Docker, of course, is required by the Pods

65
00:02:51,720 --> 00:02:54,270
to create and run the Containers.

66
00:02:54,270 --> 00:02:57,270
We then also have another piece of software

67
00:02:57,270 --> 00:03:00,270
running there, which is called a kubelet,

68
00:03:00,270 --> 00:03:03,000
which is basically the communication device

69
00:03:03,000 --> 00:03:05,650
between the Worker Node and the Master Node.

70
00:03:05,650 --> 00:03:08,596
So, it's basically a software service running

71
00:03:08,596 --> 00:03:11,220
on that machine, on the Worker Node machine,

72
00:03:11,220 --> 00:03:13,910
which does the actual communication with the

73
00:03:13,910 --> 00:03:17,160
Master Node, so that the Master Node is able to

74
00:03:17,160 --> 00:03:20,320
control the Pods on this Worker Node.

75
00:03:20,320 --> 00:03:22,900
And, we've got this proxy service running,

76
00:03:22,900 --> 00:03:26,600
which is responsible for handling incoming and outgoing

77
00:03:26,600 --> 00:03:30,940
traffic to insure that everything is working as desired,

78
00:03:30,940 --> 00:03:34,550
and only allowed traffic is able to reach the Pods,

79
00:03:34,550 --> 00:03:38,023
and only allowed traffic is able to leave the Worker Node.

80
00:03:39,330 --> 00:03:41,380
And that is the Worker Node.

81
00:03:41,380 --> 00:03:43,600
That's a closer look at the Worker Node

82
00:03:43,600 --> 00:03:46,090
and what's running on there.

83
00:03:46,090 --> 00:03:49,050
And the great thing is that with Kubernetes,

84
00:03:49,050 --> 00:03:52,450
you just need to define the desired end state,

85
00:03:52,450 --> 00:03:55,940
and if you're then using a cloud provider like AWS,

86
00:03:55,940 --> 00:03:59,430
they have services which allow you to provide

87
00:03:59,430 --> 00:04:03,450
this Kubernetes definition, and then AWS will

88
00:04:03,450 --> 00:04:06,870
set up all the instances and install all the

89
00:04:06,870 --> 00:04:08,860
required software for you.

90
00:04:08,860 --> 00:04:10,960
So you don't have to deal with that.

91
00:04:10,960 --> 00:04:13,180
You just have to know what's happening there,

92
00:04:13,180 --> 00:04:16,310
because as a developer, you should always know

93
00:04:16,310 --> 00:04:19,452
what your code, and what your configuration is doing.

