1
00:00:04,560 --> 00:00:11,280
Let's not try to create cluster IP for our deployment and we will create for that specific service.

2
00:00:11,640 --> 00:00:14,540
So we already have deployment created.

3
00:00:14,550 --> 00:00:17,020
Let's read the details about such deployment.

4
00:00:17,040 --> 00:00:19,530
K get deployments.

5
00:00:21,780 --> 00:00:27,420
By the way, you could shorten such a long road just to deploy like that gay get deployed.

6
00:00:27,660 --> 00:00:30,040
And here was the name of our deployment.

7
00:00:30,060 --> 00:00:34,810
Now there are three different ports which are ready in this deployment.

8
00:00:34,830 --> 00:00:38,550
Let's now create a service for this particular deployment.

9
00:00:38,640 --> 00:00:44,250
And using service, you could expose specific port from the deployment.

10
00:00:45,360 --> 00:00:52,380
Now we are running three different ports and inside of each port there was engine x container and by

11
00:00:52,380 --> 00:00:56,010
default, engine x web server is running at Port eight.

12
00:00:56,520 --> 00:01:05,459
It means that we have to expose internal port eight from the containers to any other port outside of

13
00:01:05,459 --> 00:01:06,450
the deployment.

14
00:01:07,350 --> 00:01:14,430
And we could choose, for instance, port 88 for this particular example, in order to expose internal

15
00:01:14,430 --> 00:01:19,530
port from the deployment ports, you should utilize command expose.

16
00:01:19,710 --> 00:01:25,890
Let's enter a key expose deployment here will be name of the deployment.

17
00:01:25,890 --> 00:01:34,320
We would like to create service form and index deployment here with the name of our deployment request

18
00:01:34,350 --> 00:01:35,930
that we don't mention here.

19
00:01:35,940 --> 00:01:42,120
Ports we work with, deployments and ports are managed by deployments.

20
00:01:42,540 --> 00:01:48,090
So let's expose deployment engine is deployment here will be option port.

21
00:01:48,270 --> 00:01:54,660
Let's specify a port which we would like to utilize as external port for our deployment.

22
00:01:54,660 --> 00:01:57,210
And let's set it to Port 88.

23
00:01:57,750 --> 00:02:05,700
And also we have to add here to port if port inside of the containers is different from this port,

24
00:02:05,700 --> 00:02:12,460
which we specify right now here and in our example right now, port inside of the container is 80.

25
00:02:12,480 --> 00:02:14,370
That's why we have to add here.

26
00:02:14,370 --> 00:02:19,020
Option there's this target port equals sign eight.

27
00:02:20,470 --> 00:02:29,560
So we expose internal port from the containers to external port 88 and we do that for the deployment.

28
00:02:29,590 --> 00:02:31,720
Here was the name of the deployment.

29
00:02:32,320 --> 00:02:34,930
All right, let's expose again.

30
00:02:35,110 --> 00:02:43,030
Deployment service engine is deployment was exposed and now let's list services for that.

31
00:02:43,030 --> 00:02:48,880
There was command k get services and now there are two services.

32
00:02:48,920 --> 00:02:52,300
First, service is default system service.

33
00:02:52,330 --> 00:02:57,730
It is called Kubernetes, type is cluster IP and here is cluster IP address.

34
00:02:58,120 --> 00:03:03,310
And also here we see one more service engine is deployment.

35
00:03:04,700 --> 00:03:10,280
Here was name here type cluster IP and here is cluster IP.

36
00:03:10,610 --> 00:03:16,910
And this IP address is completely different from the IP addresses assigned to the puts.

37
00:03:17,600 --> 00:03:20,480
This IP address is even from another network.

38
00:03:21,230 --> 00:03:24,980
IP addresses of the ports start from 172.

39
00:03:24,980 --> 00:03:28,040
And here this IP address starts from ten.

40
00:03:28,910 --> 00:03:37,160
And this is a virtual IP address which was created by Kubernetes, and it is just a single IP address

41
00:03:37,760 --> 00:03:41,480
which could be used in order to connect to any of the ports.

42
00:03:44,340 --> 00:03:50,010
And such type glass tribe allows you to connect to specific deployment.

43
00:03:50,010 --> 00:03:56,160
In our example, engine X deployment only from inside of the Kubernetes cluster.

44
00:03:56,610 --> 00:04:01,770
For instance, if in your Kubernetes cluster there was database deployment, for instance, there was

45
00:04:01,770 --> 00:04:08,700
MongoDB database or my SQL database, and such database should not be available and accessible from

46
00:04:08,700 --> 00:04:09,780
outside world.

47
00:04:09,960 --> 00:04:18,180
You could create cluster IP service for such database deployment and other deployments inside of your

48
00:04:18,180 --> 00:04:24,510
Kubernetes cluster will be able to connect to database deployment using cluster IP.

49
00:04:24,660 --> 00:04:29,130
But again, such deployment will be hidden from the outside world.

50
00:04:29,550 --> 00:04:36,060
But on the other hand, if you create any Web service deployment and it should be available from outside.

51
00:04:36,090 --> 00:04:42,160
Of course you have to expose it to outside world using node port or load balancer.

52
00:04:42,180 --> 00:04:44,250
That's what we'll try a bit later.

53
00:04:44,970 --> 00:04:49,110
Cluster IP will be available only inside of the cluster.

54
00:04:49,680 --> 00:05:00,300
So here we see cluster IP address here what is and here is broad, which was exposed by our deployment.

55
00:05:01,140 --> 00:05:05,620
Also, you could get a list of services using short version of this command.

56
00:05:05,640 --> 00:05:07,920
Simply enter a k get svg.

57
00:05:07,990 --> 00:05:13,830
See it is short version of services as we see and result will be the same.

58
00:05:13,860 --> 00:05:21,090
There are now two different services with those cluster IP address, this one for Kubernetes service

59
00:05:21,090 --> 00:05:24,390
and this one for engine deployment service.

