1
00:00:04,650 --> 00:00:08,740
Let's go to Tylenol here and let's create a new deployment.

2
00:00:08,760 --> 00:00:10,900
By the way, now there are no deployments.

3
00:00:10,910 --> 00:00:12,540
Okay, get deploy.

4
00:00:14,730 --> 00:00:15,660
No deployments.

5
00:00:15,690 --> 00:00:20,880
Gay get SVC services, no services, just a single one.

6
00:00:20,880 --> 00:00:22,530
Kubernetes it is default one.

7
00:00:22,620 --> 00:00:27,060
And now let's create new deployment based on custom built image.

8
00:00:27,060 --> 00:00:30,960
For that, let's first utilize same command as we used before.

9
00:00:30,990 --> 00:00:32,670
K Create deployment.

10
00:00:32,940 --> 00:00:35,190
K Create deployment.

11
00:00:35,940 --> 00:00:36,870
Let's name it.

12
00:00:36,870 --> 00:00:39,930
K eight as web.

13
00:00:39,960 --> 00:00:40,740
Hello.

14
00:00:41,340 --> 00:00:43,050
And the next will be option.

15
00:00:43,050 --> 00:00:46,890
Image and image will be this statute in my case.

16
00:00:47,540 --> 00:00:50,350
Slash gay aids web.

17
00:00:50,480 --> 00:00:51,170
Hello.

18
00:00:51,590 --> 00:01:01,640
Same name as it appears here when I pushed this image to the Docker hub and the same name as I see here.

19
00:01:03,510 --> 00:01:07,050
So here is my username and hero's name of the Docker repository.

20
00:01:07,820 --> 00:01:12,800
Let's go ahead and create a deployment based on this image.

21
00:01:13,820 --> 00:01:19,850
Of course, if you performed all the steps yourself and pushed custom built image to Docker Hub under

22
00:01:19,850 --> 00:01:23,600
your account, you could utilize here your username.

23
00:01:24,330 --> 00:01:27,420
So let's go ahead and create a new deployment.

24
00:01:28,080 --> 00:01:29,660
Deployment was created.

25
00:01:29,670 --> 00:01:32,400
Let's k get pods.

26
00:01:33,520 --> 00:01:40,450
Now I see that container creating status is status of this port which was created for this deployment.

27
00:01:40,480 --> 00:01:41,710
Let's check again.

28
00:01:42,570 --> 00:01:47,760
Still container creating because it takes some time to pool image from Docker Hub.

29
00:01:49,250 --> 00:01:53,090
And now I see that container is running great.

30
00:01:53,450 --> 00:02:01,580
Here is the name of the container and here is hash of the replica set which was created by deployment.

31
00:02:01,580 --> 00:02:05,780
And here is a specific hash for this particular port.

32
00:02:06,350 --> 00:02:16,670
Now let's create service using cluster IP and try to connect afterwards to our web server, which is

33
00:02:16,670 --> 00:02:19,460
running using Node.js Express.

34
00:02:19,640 --> 00:02:21,950
So let's create a service for that.

35
00:02:21,950 --> 00:02:27,230
We will expose Port K, expose deployment.

36
00:02:27,830 --> 00:02:31,460
Here will be name of the deployment K eight as web.

37
00:02:32,000 --> 00:02:32,720
Hello.

38
00:02:32,750 --> 00:02:39,630
Next, let's add option port and recap that our express web server is running at Port 3000.

39
00:02:39,650 --> 00:02:47,630
Let's go back to our application, go to index dot mj's file and here is this port 3000 and we could

40
00:02:47,630 --> 00:02:54,140
basically expose it to the same external port that will be used for connections to deployment.

41
00:02:54,410 --> 00:03:01,190
Let's utilize for that just single port we will not need for that target port option this way.

42
00:03:01,220 --> 00:03:10,220
Let's add this dashpot equals sign 3000 like that and this will create cluster ip for deployment k eight

43
00:03:10,220 --> 00:03:10,850
as web.

44
00:03:10,850 --> 00:03:11,390
Hello.

45
00:03:12,020 --> 00:03:14,300
Let's go ahead and create service.

46
00:03:14,330 --> 00:03:16,220
Let's list services.

47
00:03:16,220 --> 00:03:17,720
K get svc.

48
00:03:18,350 --> 00:03:21,050
And here was newly created service.

49
00:03:21,080 --> 00:03:27,110
Here was the name of the service and here was cluster IP which was created by Kubernetes.

50
00:03:28,040 --> 00:03:33,140
And again, using such IP address, we will be able to connect to our deployment.

51
00:03:33,140 --> 00:03:39,470
It means that you could connect to any of the ports you don't select which port you will be connected

52
00:03:39,470 --> 00:03:39,860
to.

53
00:03:39,890 --> 00:03:42,110
Kubernetes does this job for you.

54
00:03:42,740 --> 00:03:48,650
And here we see that we opened port 3000, exposed port 3000.

55
00:03:49,130 --> 00:03:53,860
Let's try to connect to this cluster IP and port 3000.

56
00:03:53,870 --> 00:04:01,280
Let me copy this cluster IP and of course I will not be able to connect to this cluster IP from my local

57
00:04:01,280 --> 00:04:02,030
computer.

58
00:04:02,060 --> 00:04:12,470
That's why let's as usually quickly connect to our mini cube node as a sage docker at this IP.

59
00:04:13,730 --> 00:04:14,990
59 one on one.

60
00:04:14,990 --> 00:04:17,570
In your case, this IP is different here.

61
00:04:17,570 --> 00:04:19,790
Our password is TSI user.

62
00:04:20,300 --> 00:04:26,210
And now here let's see URL to cluster IP and port 3000.

63
00:04:26,240 --> 00:04:29,960
That's that port which we exposed from deployment.

64
00:04:30,710 --> 00:04:33,890
So let's go ahead and I see message.

65
00:04:33,890 --> 00:04:35,300
Hello from the K eight.

66
00:04:35,330 --> 00:04:35,860
S Web.

67
00:04:35,870 --> 00:04:36,410
Hello.

68
00:04:36,410 --> 00:04:43,670
And entire name of the server where express Node.js application is actually running.

69
00:04:45,420 --> 00:04:50,610
And that's that message which comes from the Express website over here.

70
00:04:51,690 --> 00:04:53,670
That's where we send it back to the client.

71
00:04:53,700 --> 00:04:54,060
Hello.

72
00:04:54,060 --> 00:05:01,800
From the and name hostname of the server where this application is running and it means that everything

73
00:05:01,800 --> 00:05:03,360
works perfectly.

74
00:05:03,510 --> 00:05:12,930
We created a deployment based on the custom built image which we pushed the Docker hub and here a result

75
00:05:12,930 --> 00:05:17,160
of it and we see response from the web server application.

76
00:05:17,580 --> 00:05:18,520
Wonderful.

77
00:05:18,540 --> 00:05:24,480
By the way, if you enter a serial command like that, you will be automatically moved to the new prompt

78
00:05:24,480 --> 00:05:27,060
and you will stay on this line.

79
00:05:27,060 --> 00:05:33,210
If you want to move to the new line, you could enter a queue URL, then add the semicolon and add here

80
00:05:33,220 --> 00:05:34,380
echo like that.

81
00:05:34,620 --> 00:05:38,340
And now you will be moved to the new line here in the output.

82
00:05:38,370 --> 00:05:39,270
Wonderful.

83
00:05:39,300 --> 00:05:42,040
Now we got a response from the same port.

84
00:05:42,060 --> 00:05:45,630
Here we see same hostname as we saw here.

