1
00:00:04,500 --> 00:00:09,540
Let's hide them by the terminal and let's now go to service the YAML configuration file.

2
00:00:09,540 --> 00:00:15,720
And here let's also speed up the process for creation of the service configuration file and type service

3
00:00:15,720 --> 00:00:23,010
and Kubernetes extension will offer us this option and this spec will be created automatically.

4
00:00:23,220 --> 00:00:27,180
Client is a service API version is v one here.

5
00:00:27,180 --> 00:00:34,410
It differs from API version for deployment kind metadata name sets name for this service.

6
00:00:34,410 --> 00:00:37,470
Let's enter a name gate as web.

7
00:00:37,470 --> 00:00:38,130
Hello.

8
00:00:38,310 --> 00:00:45,690
And also here let's modify selector and selector will be up Golden Gate as web hello as well.

9
00:00:45,960 --> 00:00:52,500
By the way, if you hover mouse over any of the keys in this configuration file, you could find hyperlinks

10
00:00:52,500 --> 00:00:55,350
to documentation for each particular key.

11
00:00:55,350 --> 00:01:02,760
For example, key name URL is here or if you hover mouse over a kind, you could also find hyperlinks

12
00:01:02,760 --> 00:01:07,260
here for API version for kind and metadata, for instance.

13
00:01:07,860 --> 00:01:14,520
All right, what is left here in this service is modification of the port section here.

14
00:01:14,520 --> 00:01:22,770
I see that port and target port were out of populated before we utilized we exposed actually same port

15
00:01:22,770 --> 00:01:27,480
3000, which is the port where our express web server is running.

16
00:01:27,480 --> 00:01:35,340
And now we could try different port expose port 3000 which is targeted port to port, let's say.

17
00:01:36,350 --> 00:01:36,600
Thought.

18
00:01:36,600 --> 00:01:37,700
They thought you like that.

19
00:01:38,030 --> 00:01:44,510
And it means that target bought 3000 will be exposed to external port 3030.

20
00:01:44,900 --> 00:01:49,970
Also notice that in this specification there was no type for this service.

21
00:01:50,180 --> 00:01:55,670
And let's say that we want to create a load balance or service for that.

22
00:01:55,670 --> 00:01:57,350
Let's go to documentation.

23
00:01:57,590 --> 00:02:01,100
Let's find documentation for service here.

24
00:02:01,130 --> 00:02:03,920
Kubernetes API service.

25
00:02:03,920 --> 00:02:04,790
Resources.

26
00:02:06,020 --> 00:02:06,920
Serious.

27
00:02:07,780 --> 00:02:13,480
And here, let's click on service specification here, hero selector ports.

28
00:02:13,480 --> 00:02:22,780
And also below you could find type of the service type, either cluster IP which is default or external

29
00:02:22,780 --> 00:02:25,450
name or node port or load balancer.

30
00:02:25,510 --> 00:02:28,090
Lets set type to load balancer.

31
00:02:28,600 --> 00:02:36,940
Let's go back to our configuration file and here in spec, let's set type to load balancer like that.

32
00:02:37,880 --> 00:02:40,880
That's it for this service specification.

33
00:02:40,880 --> 00:02:47,240
Let's save changes in this file and let's apply this using same command as before.

34
00:02:47,330 --> 00:02:54,170
Cube still apply disk f stands for file and hero type service dot yaml.

35
00:02:54,560 --> 00:03:00,110
I am still inside of the gate eight folder, so let's apply a service yaml file.

36
00:03:01,410 --> 00:03:04,080
Applied gay get as we see.

37
00:03:04,260 --> 00:03:09,330
And now I see that new service with type load balancer was created.

38
00:03:10,700 --> 00:03:11,180
And no.

39
00:03:11,180 --> 00:03:18,680
Similarly, as before I could open a connection to our deployment using command meaning service k8s

40
00:03:18,680 --> 00:03:19,370
web.

41
00:03:19,520 --> 00:03:20,120
Hello.

42
00:03:21,020 --> 00:03:21,950
Let's go ahead.

43
00:03:23,290 --> 00:03:25,000
And Page will be opened.

44
00:03:26,400 --> 00:03:29,670
Refreshed and they got response from another port.

45
00:03:29,940 --> 00:03:32,790
It means that now everything works as before.

46
00:03:32,820 --> 00:03:40,860
There is now service and deployment and we created everything using declarative approach, using configuration

47
00:03:40,860 --> 00:03:41,610
files.

48
00:03:42,030 --> 00:03:45,660
Here is file for service and here is file for deployment.

