1
00:00:04,320 --> 00:00:05,000
No.

2
00:00:05,010 --> 00:00:13,980
Let's quickly go back again inside of the Kubernetes mini cube node and list again Docker containers,

3
00:00:13,980 --> 00:00:20,250
and we will find out that now there is one more container which was created in the engine export.

4
00:00:20,430 --> 00:00:25,950
So using up arrow I could go back to the Sage Command which I entered before.

5
00:00:25,980 --> 00:00:29,340
Here it is and connect to this node again.

6
00:00:29,340 --> 00:00:33,900
Enter DC user password and let's enter.

7
00:00:33,900 --> 00:00:43,860
Here are Docker PS but now let's filter output by name engine and now I'll find out that there are two

8
00:00:43,860 --> 00:00:51,800
different containers here with first one and Hero's second one which are related to engine x.

9
00:00:52,800 --> 00:00:59,640
Here is name of the first container K eight as Engine X and Jennings default and so on.

10
00:00:59,790 --> 00:01:06,570
And also there is one more container k8s Port and Jennings default and so on.

11
00:01:07,050 --> 00:01:15,330
And this second container is called POS container here you see that inside of the container pause executable

12
00:01:15,330 --> 00:01:19,080
was actually launched when container was created.

13
00:01:19,800 --> 00:01:29,550
And if Docker is container runtime in Kubernetes, there are always such post containers which are created

14
00:01:29,550 --> 00:01:38,910
for each specific port and such POS containers are created in order to, let's say, log namespace of

15
00:01:38,910 --> 00:01:40,110
specific port.

16
00:01:40,110 --> 00:01:46,800
And we discussed before that all containers inside of the same port actually share namespaces.

17
00:01:47,100 --> 00:01:55,260
And this container, which is actually running our engine web server could be stopped, could be recreated

18
00:01:55,260 --> 00:01:58,770
by Kubernetes, but port remains untouched.

19
00:01:59,250 --> 00:02:06,570
And this second container, which is called post container, is required to keep namespace of the port.

20
00:02:07,440 --> 00:02:08,100
All right.

21
00:02:08,100 --> 00:02:10,889
That's how containers look right now.

22
00:02:10,889 --> 00:02:17,790
And let's actually connect to this container where we are running engine service.

23
00:02:17,910 --> 00:02:23,700
In order to connect to container, you could use either ID, this one or this name.

24
00:02:23,700 --> 00:02:25,380
Let's connect to container.

25
00:02:25,380 --> 00:02:36,000
By this ID, please select this container, not POS container and let's enter command docker exec dash

26
00:02:36,000 --> 00:02:36,720
it.

27
00:02:36,870 --> 00:02:42,510
Here is ID of the container and let's connect this container using SHA executable.

28
00:02:42,510 --> 00:02:44,820
Now I am inside of the container.

29
00:02:45,690 --> 00:02:49,490
Let's check its hostname and Jennings.

30
00:02:49,920 --> 00:02:55,530
It is name of the port actually and the same name was assigned to this container.

31
00:02:55,530 --> 00:02:58,680
And let's also check IP address of this container.

32
00:02:58,680 --> 00:03:07,710
Here is such IP address 170 217 zero three and that's that IP address which we saw in the details of

33
00:03:07,710 --> 00:03:08,430
the port.

34
00:03:08,790 --> 00:03:14,820
Now let's try to connect to web server, which is running inside of this container where we are currently

35
00:03:14,820 --> 00:03:17,160
in by using this IP address.

36
00:03:17,160 --> 00:03:24,720
And for that we could utilize see URL command and here are paste IP address of this particular container

37
00:03:25,260 --> 00:03:28,020
that we are inside of the container.

38
00:03:28,230 --> 00:03:31,500
Let's try to make connection and here I see.

39
00:03:31,500 --> 00:03:36,900
Welcome to again s page which was returned by this web server.

40
00:03:37,230 --> 00:03:41,070
It means that again its web server is up and running.

41
00:03:41,730 --> 00:03:44,460
Let's go out of this container.

42
00:03:44,760 --> 00:03:51,090
And now we are still inside of the Kubernetes node that we made as a connection to it.

43
00:03:51,090 --> 00:03:54,840
And now let's exit from this connection as well like that.

44
00:03:54,840 --> 00:03:57,120
And now let's enter following command.

45
00:03:57,150 --> 00:04:06,690
You still get ports this all wide and with such option you'll find also IP address of particular port

46
00:04:06,690 --> 00:04:07,920
in this output.

47
00:04:07,920 --> 00:04:13,410
And here is the same IP address which we just saw inside of the container.

48
00:04:14,100 --> 00:04:18,690
Let's now try to connect to such IP address from our computer.

49
00:04:19,110 --> 00:04:26,910
Our computer is external relative to our Kubernetes cluster because Kubernetes node is running inside

50
00:04:26,910 --> 00:04:28,110
of the virtual machine.

51
00:04:28,740 --> 00:04:35,040
And this IP address was assigned by Docker to particular container inside of the node.

52
00:04:36,380 --> 00:04:38,870
Let's try to connect to such IP address.

53
00:04:38,900 --> 00:04:41,910
I could utilize the same command SEO URL.

54
00:04:41,930 --> 00:04:43,700
Here it is available on Mac.

55
00:04:43,820 --> 00:04:50,870
Or you could simply open up web browser and connect to this IP address and you'll find out that you

56
00:04:50,870 --> 00:04:55,220
will not be able to connect to engine container like that.

57
00:04:55,310 --> 00:05:01,400
Because as I told you before, such IP address is internal IP address of the port and you are not able

58
00:05:01,400 --> 00:05:06,110
to connect to such port from outside world outside of the classroom.

59
00:05:07,100 --> 00:05:07,670
Great.

60
00:05:07,670 --> 00:05:12,320
That's how we created very first port in our Kubernetes cluster.

61
00:05:12,320 --> 00:05:15,950
And we also explored details of such port.

62
00:05:15,950 --> 00:05:21,800
And I hope that now it is clear to you what happens when you create a port inside of the port.

63
00:05:21,830 --> 00:05:27,740
Kubernetes creates container, and in order to create container, it has to pull image from the Docker

64
00:05:27,740 --> 00:05:28,340
hub.

65
00:05:28,340 --> 00:05:35,060
And in our example, Engine X image was pulled and new container was created based on that image.

66
00:05:35,330 --> 00:05:42,770
Also, we went inside of the container and verified that engine, its web server is now actually running,

67
00:05:42,770 --> 00:05:49,370
but we are not able to connect to such port from the outside because now it has only internal IP address

68
00:05:49,370 --> 00:05:51,290
which was assigned by the Docker.

69
00:05:51,290 --> 00:05:57,620
But of course creation of the port using cube ctrl run command is not really convenient because you

70
00:05:57,620 --> 00:06:02,930
are not able to scale and for example, increase quantity of the ports.

71
00:06:02,930 --> 00:06:07,670
There was just a single port which we created using Cube City Run Command.

72
00:06:07,700 --> 00:06:12,590
That's why now let's simply delete created port so that there is command cube.

73
00:06:12,590 --> 00:06:20,000
Still delete next will be name of the resource we would like to delete and it is port and here we'll

74
00:06:20,000 --> 00:06:27,980
be name of the port in our example again because we specified such name for the port manually when we

75
00:06:27,980 --> 00:06:32,990
entered Cube, it'll run command, so let's go ahead and delete such a port.

76
00:06:33,920 --> 00:06:35,750
But again, it's deleted.

77
00:06:35,870 --> 00:06:44,960
Q Still get polls and there are no resources found in the vault namespace and such port is simply gone.

78
00:06:45,350 --> 00:06:51,530
And all volumes, all namespaces related to this particular port were removed.

