1
00:00:04,560 --> 00:00:10,590
As I mentioned before, it is not convenient to create separate pods inside of the Kubernetes cluster

2
00:00:10,620 --> 00:00:14,820
because you are not able to scale and increase quantity of the ports.

3
00:00:15,120 --> 00:00:22,860
Therefore, the most common way to create multiple ports when you are able to increase quantity of the

4
00:00:22,860 --> 00:00:31,110
ports, decrease quantity, modify configuration, etc. is by using deployment and deployment will be

5
00:00:31,110 --> 00:00:34,090
responsible for creation of the actual ports.

6
00:00:34,110 --> 00:00:40,140
But please notice that all ports inside of the deployment will be the same, exactly the same.

7
00:00:40,140 --> 00:00:47,070
But you could create multiple copies of the same port and distribute load across different nodes in

8
00:00:47,070 --> 00:00:48,360
the Kubernetes cluster.

9
00:00:48,390 --> 00:00:50,250
That's the purpose of the deployment.

10
00:00:51,030 --> 00:00:57,690
Now let's go ahead and create deployment, and we will utilize same image which we utilized before.

11
00:00:57,720 --> 00:00:59,340
It is engine image.

12
00:00:59,490 --> 00:01:05,850
And also afterwards we will increase quantity of the ports in this deployment and also we will create

13
00:01:05,850 --> 00:01:12,900
a service for this deployment in order to be able to connect to our deployment from external world.

14
00:01:12,930 --> 00:01:20,490
Let's go ahead and create such deployment and for that we will utilize Command Cube, Ctrl create deployment.

15
00:01:20,490 --> 00:01:23,520
We already alias the cube ctrl command.

16
00:01:23,520 --> 00:01:31,080
That's why I will enter k create deployment and next will be the name of the deployment.

17
00:01:31,080 --> 00:01:36,390
Let's name it Gen X and afterwards let us specify also image.

18
00:01:36,420 --> 00:01:44,100
Similarly, as we did in cubes, it will run command and here after equal sign will be name of the image

19
00:01:44,100 --> 00:01:46,860
we would like to utilize for this deployment.

20
00:01:46,860 --> 00:01:49,050
And let's enter here again.

21
00:01:49,830 --> 00:01:55,590
In order to avoid any confusion, let's modify the name of this deployment and let's name it, for instance,

22
00:01:55,590 --> 00:01:59,040
and Gen does deployment like that.

23
00:01:59,190 --> 00:02:02,040
Let's go ahead and create this deployment.

24
00:02:02,880 --> 00:02:04,380
Deployment was created.

25
00:02:04,380 --> 00:02:07,770
Let's enter command k get deployment.

26
00:02:09,110 --> 00:02:10,940
Here was a single deployment.

27
00:02:10,970 --> 00:02:15,890
It is ready and up to date and let's enter k get ports.

28
00:02:16,490 --> 00:02:24,080
And now I see that there was no single boat which is managed by this particular deployment and such

29
00:02:24,080 --> 00:02:29,240
a boat was created automatically after we created such deployment.

30
00:02:30,080 --> 00:02:34,130
And now this boat is managed by this deployment.

31
00:02:35,750 --> 00:02:38,750
There was just a single port at the moment.

32
00:02:39,500 --> 00:02:45,380
And of course, the impossible to scale quantity of the ports and increase quantity of the ports, for

33
00:02:45,380 --> 00:02:47,570
instance, to three, five and so on.

34
00:02:48,350 --> 00:02:53,570
But first, before doing that, let's read details about such deployment.

35
00:02:53,660 --> 00:02:58,100
And for that, let's enter command k describe deployment.

36
00:02:58,820 --> 00:03:03,110
And here will be name of the deployment and deployment.

37
00:03:05,210 --> 00:03:07,970
Here are details of creative deployment.

38
00:03:08,000 --> 00:03:14,940
Let's scroll a bit up and here at the beginning of the output, I see name of the deployment and Gen-X

39
00:03:15,020 --> 00:03:15,760
deployment.

40
00:03:15,770 --> 00:03:19,610
That's that name which was given to this deployment by us.

41
00:03:19,970 --> 00:03:23,720
Here was Name Space where our such deployment was created.

42
00:03:23,720 --> 00:03:25,280
Default namespace.

43
00:03:25,610 --> 00:03:31,280
Below you'll see that Kubernetes is automatically assigned labels to this particular deployment.

44
00:03:31,280 --> 00:03:36,140
And there was just a single label up equals sign engine its deployment.

45
00:03:37,660 --> 00:03:41,520
Also there are annotations again created automatically.

46
00:03:41,530 --> 00:03:44,580
Here was annotation and here is also selector.

47
00:03:44,860 --> 00:03:52,570
Selectors are used in order to connect ports with deployments because in Kubernetes both and deployments

48
00:03:52,570 --> 00:04:00,430
are actually separate objects and we have to know how to assign specific ports to particular deployments.

49
00:04:00,580 --> 00:04:07,870
And here we see selector app equals Sign and Jennings deployment and for particular port, which was

50
00:04:07,870 --> 00:04:10,930
automatically created and assigned to this deployment.

51
00:04:10,930 --> 00:04:17,470
We will find a label with the same value up equal sign and Jennings deployment.

52
00:04:17,470 --> 00:04:19,630
We will have look at that just in a minute.

53
00:04:20,529 --> 00:04:28,330
Also, there was a replica field and here you could find information about quantity of the ports which

54
00:04:28,330 --> 00:04:36,940
are desired by this deployment and actual quantity of the ports which are running here with just a single

55
00:04:36,940 --> 00:04:43,240
port, single replica which is desired one updated, one total and one available.

56
00:04:43,240 --> 00:04:48,100
It means that now there was one port which is assigned to this deployment.

57
00:04:49,480 --> 00:04:56,380
Here is also strategy type rolling update which tells how to perform updates of the deployments.

58
00:04:56,380 --> 00:04:59,140
We will get back to it a bit later in this course.

59
00:04:59,440 --> 00:05:06,160
And also below, you'll find other details about this particular deployment here.

60
00:05:06,160 --> 00:05:09,160
You'll find also details about port template.

61
00:05:09,160 --> 00:05:16,020
And as I just told you, you'll find out inside of the port corresponding label up equals sign and is

62
00:05:16,060 --> 00:05:16,900
deployment.

63
00:05:18,240 --> 00:05:23,130
And same label is mentioned here in the selector field in the deployment.

64
00:05:23,400 --> 00:05:27,510
And that's how deployment is connected to particular ports.

65
00:05:30,630 --> 00:05:37,070
Also, if you scroll a bit down, you'll find actual events related to this particular deployment.

66
00:05:37,080 --> 00:05:41,580
And here we see single event scaling replica set.

67
00:05:41,880 --> 00:05:43,620
But what is replica set?

68
00:05:44,550 --> 00:05:53,670
A bit above you see new replica set and next deployment and ID of the replica set and replica set actually

69
00:05:53,670 --> 00:06:02,130
manages all posts related to deployment and replica set is a set of replicas of your application because

70
00:06:02,130 --> 00:06:09,450
you could create five or ten 100 different posts in the same deployment and all of them are included

71
00:06:09,450 --> 00:06:10,830
in the replica set.

72
00:06:11,310 --> 00:06:19,170
And that's why here you see that such replica set was scaled up to one and one.

73
00:06:19,170 --> 00:06:21,840
What was created in this replica set?

74
00:06:23,050 --> 00:06:26,650
Great this are details about this particular deployment.

75
00:06:26,650 --> 00:06:29,350
And now let's have a look again at the list of the ports.

76
00:06:29,380 --> 00:06:34,900
They get ports here with just a single port and notice its name.

77
00:06:35,530 --> 00:06:39,760
It starts with the name of the replica set, which we just discussed.

78
00:06:39,760 --> 00:06:47,170
And so in the output of the details of the deployment engine, its deployment and this hash and afterwards,

79
00:06:47,170 --> 00:06:50,890
there was specific hash for this particular port.

80
00:06:51,100 --> 00:06:57,220
And if there are multiple ports in the same deployment which belong to the same replica set, you'll

81
00:06:57,220 --> 00:07:02,800
see same prefix here, but different hashes here for different ports.

82
00:07:03,100 --> 00:07:06,940
Now there is just a single port which is ready and which is running.

83
00:07:07,690 --> 00:07:11,140
Also, we could get details about this particular port.

84
00:07:11,140 --> 00:07:14,670
Let's grab its name and enter here.

85
00:07:14,680 --> 00:07:15,970
K describe.

86
00:07:16,810 --> 00:07:17,350
Board.

87
00:07:17,350 --> 00:07:19,680
And here let's paste copied hatch.

88
00:07:19,750 --> 00:07:22,600
And here are the details about this particular pot.

89
00:07:22,720 --> 00:07:24,040
Let's scroll up.

90
00:07:25,140 --> 00:07:26,630
Here was the name of the board.

91
00:07:26,640 --> 00:07:28,290
It matches with this name.

92
00:07:28,410 --> 00:07:33,060
It was assigned to default namespace, same as deployment.

93
00:07:33,330 --> 00:07:37,920
Here is Node where this particular port is running right now.

94
00:07:38,070 --> 00:07:45,360
Here are labels of this particular port and I see such label as app and UNIX deployment and port template

95
00:07:45,360 --> 00:07:45,900
has.

96
00:07:46,920 --> 00:07:53,190
Notice that this hash is equal to this hash and it matches with ID of the replica set.

97
00:07:53,910 --> 00:08:01,050
Also I see status running here was IP address of the port and here I see that it is controlled by specific

98
00:08:01,050 --> 00:08:07,860
replica set, replica set and Jennings deployment and hero's hash of the replica set which controls

99
00:08:07,860 --> 00:08:09,570
this particular port.

100
00:08:10,890 --> 00:08:15,120
Also here are details about containers which are running inside of the port.

101
00:08:15,120 --> 00:08:21,300
And here is container ID and image, which was used for creation of the container in this particular

102
00:08:21,300 --> 00:08:21,780
port.

103
00:08:23,880 --> 00:08:31,860
Also at the end, you could find logs related to the board, as we discussed before, successfully assigned

104
00:08:31,860 --> 00:08:35,460
to specific node pulling image and and so on.

105
00:08:35,880 --> 00:08:43,380
Now there was deployment and instead of the deployment there was replica set and ports are managed by

106
00:08:43,380 --> 00:08:44,370
this deployment.

107
00:08:44,400 --> 00:08:46,110
Now there was just a single port.

