1
00:00:00,290 --> 00:00:00,650
All right.

2
00:00:00,660 --> 00:00:06,330
So now we're going to run our task and for this we're going to define an easy a service that will basically

3
00:00:06,330 --> 00:00:09,460
define how many tasks should run and how they should be run.

4
00:00:09,690 --> 00:00:14,310
And the easiest service will ensure that the number of days our task is always running consistently

5
00:00:14,370 --> 00:00:16,530
across our fleet of easy to instance.

6
00:00:16,650 --> 00:00:18,920
That will also help us when we do updates to our task.

7
00:00:19,320 --> 00:00:23,070
So easy a service can also be linked to an ESB and there'll be an A or B.

8
00:00:23,160 --> 00:00:26,460
So little down says basically if needed and we'll see this in practice.

9
00:00:26,460 --> 00:00:28,980
So let's make our first service OK.

10
00:00:29,000 --> 00:00:34,710
So in our case we're going to go back to our cluster and we're going to click on cluster demo and in

11
00:00:34,710 --> 00:00:39,930
there we want to create a service so civics gets created at the level of a cluster.

12
00:00:39,960 --> 00:00:45,960
So we'll create a service and the lunch type is going to be easy to the task definition is going to

13
00:00:45,960 --> 00:00:50,940
be my issue TPD which comes from the test definition we just created and the revision is one which is

14
00:00:50,940 --> 00:00:55,250
the latest the cluster we assign this to is cluster demo and their service name.

15
00:00:55,260 --> 00:00:58,290
I'll just call it HPD service.

16
00:00:58,380 --> 00:01:02,520
Now the type of service we're going to run is replica and replicable means that we're going to run as

17
00:01:02,520 --> 00:01:08,450
many task as possible so if I say five is going to try to run five tasks but if I run daemon it's different

18
00:01:08,460 --> 00:01:14,130
the number of task is automatic it is going to try to run one task on each e yes instance easy to instance

19
00:01:14,130 --> 00:01:15,660
in our use yes cluster.

20
00:01:15,660 --> 00:01:20,250
So Damon is like when you want to run maybe monitoring across all your instances and gather metrics.

21
00:01:20,250 --> 00:01:25,710
But for our case because we just want to run our application or just run replicate the number of task

22
00:01:25,950 --> 00:01:27,980
I will choose for now is one.

23
00:01:28,050 --> 00:01:29,740
Now the M.O. healthy.

24
00:01:29,910 --> 00:01:31,500
I'll just set this a zero.

25
00:01:31,500 --> 00:01:33,320
You don't need to understand why we're just at a zero.

26
00:01:33,330 --> 00:01:37,770
This will allow us basically to do rolling restarts and the maximum person will be 200.

27
00:01:38,030 --> 00:01:41,490
Now four deployments we defined how is our service deployed.

28
00:01:42,160 --> 00:01:46,560
And so the deployment type is going to be rolling update that squad comes with basically with ease.

29
00:01:46,560 --> 00:01:52,070
Yes but now there's a new rolling deployment called Blue Green deployment that is powered by code deploy.

30
00:01:52,080 --> 00:01:57,600
This is out of scope for now but just know that's code deployed can be used to deploy HECS as well.

31
00:01:57,630 --> 00:02:00,830
We'll keep this as rolling updates task placements.

32
00:02:00,930 --> 00:02:06,300
We'll just leave it as default which is basically this for defending a strategy of how to place task

33
00:02:06,360 --> 00:02:08,160
on different e yes instances.

34
00:02:08,340 --> 00:02:12,420
So you can choose whatever you want for now or just use AC balance spread.

35
00:02:12,460 --> 00:02:13,040
Okay.

36
00:02:13,290 --> 00:02:15,990
Click on next up and we scroll back up.

37
00:02:16,050 --> 00:02:17,540
Now we can figure the network.

38
00:02:17,580 --> 00:02:20,520
So basically we can choose a load balancer type.

39
00:02:20,610 --> 00:02:22,090
And for now I'll choose none.

40
00:02:22,110 --> 00:02:25,430
And this is intended but will add a load balancer later on.

41
00:02:25,860 --> 00:02:32,190
But we could choose application network or classic load balancer will enable I will disable a service

42
00:02:32,190 --> 00:02:35,680
discovery integration because this is out of scope and a little bit too complicated.

43
00:02:35,790 --> 00:02:40,860
So click on next and we'll not set up the scaling but it is possible to set up Otis going for your easiest

44
00:02:40,860 --> 00:02:42,100
service as well.

45
00:02:42,150 --> 00:02:42,720
Next step.

46
00:02:43,050 --> 00:02:43,290
Okay.

47
00:02:43,290 --> 00:02:43,980
Everything looks good.

48
00:02:43,980 --> 00:02:46,830
We're running this test definition this is the name of our service.

49
00:02:46,830 --> 00:02:51,570
We're going to run one task it's a replica type minimum healthy and maximum healthy zero to hundred

50
00:02:51,960 --> 00:02:54,630
network is not configured and is not configured either.

51
00:02:54,630 --> 00:02:56,590
That makes a service really simple.

52
00:02:56,790 --> 00:02:58,230
Let's create the service.

53
00:02:58,230 --> 00:03:06,420
The service was created we can view service and as we can see now very very quickly a task is in pending

54
00:03:06,420 --> 00:03:06,710
state.

55
00:03:06,720 --> 00:03:11,850
So our service is going to start a task to basically launch our HPD task.

56
00:03:11,860 --> 00:03:19,470
Okay let's go back to um cluster demo and in there we can see that we have our service name GDP service

57
00:03:19,470 --> 00:03:24,300
that's running the desired number of task is one and the number of running task is one as well.

58
00:03:24,600 --> 00:03:26,070
So our task is running.

59
00:03:26,070 --> 00:03:32,550
If you go to tasks now we can see in this tab that indeed our task is running this task definition and

60
00:03:32,550 --> 00:03:35,780
it's running on this container instance right here.

61
00:03:35,790 --> 00:03:40,410
So what I could do is click on this container instance and get some information around the public IP

62
00:03:40,410 --> 00:03:42,970
and stuff but we know it's our easy to instance we just created.

63
00:03:43,410 --> 00:03:47,990
So as we can see this instance had one 24 ACP but now we're using a limit.

64
00:03:48,000 --> 00:03:53,030
So it has less CPSU available and the memory as well has decreased because we've reserved some stuff.

65
00:03:53,720 --> 00:03:55,300
OK so this is good.

66
00:03:55,350 --> 00:03:57,150
Let's go back to a cluster demo.

67
00:03:57,150 --> 00:03:59,290
Everything looks good the task is created.

68
00:03:59,310 --> 00:04:02,130
So how about we check out our service.

69
00:04:02,130 --> 00:04:08,790
So for this if we go to the uh public IP of our instance so let's begin our instance here is the public

70
00:04:08,790 --> 00:04:11,160
IP and we go to Port 88.

71
00:04:12,060 --> 00:04:14,460
If you're attentive this should work but it doesn't.

72
00:04:14,460 --> 00:04:14,820
Why.

73
00:04:14,820 --> 00:04:17,340
Well because it's a security group issue obviously.

74
00:04:17,370 --> 00:04:23,050
So we click on the security group we go to inbound edits we're going to add a rule and custom GPL say

75
00:04:23,050 --> 00:04:28,760
for Port ADHD from anywhere we'll just allow as you TPD click on save.

76
00:04:28,950 --> 00:04:30,380
And now we've added that rule.

77
00:04:30,390 --> 00:04:32,010
So if I if I go back.

78
00:04:32,100 --> 00:04:32,470
Yes.

79
00:04:32,490 --> 00:04:33,960
Now it says it works.

80
00:04:33,960 --> 00:04:39,100
So our first docker container is running are easy to instance and it's mapped to port 88.

81
00:04:39,390 --> 00:04:42,780
And this is it works saying as you TPD works that's just what it does.

82
00:04:42,780 --> 00:04:44,180
It is just as it works.

83
00:04:44,340 --> 00:04:49,630
Now if we go back into our instance and want to have a look at what's happening would you Ducker.

84
00:04:49,670 --> 00:04:50,390
Yes.

85
00:04:50,400 --> 00:04:52,660
And now we can see that on top of the Amazon.

86
00:04:52,680 --> 00:04:52,880
Yes.

87
00:04:52,890 --> 00:04:53,160
Yes.

88
00:04:53,160 --> 00:04:53,870
Agents.

89
00:04:53,880 --> 00:04:54,970
There is HPD.

90
00:04:55,030 --> 00:05:00,510
Two point four that is running in the foreground and has started so we could also curl you know this

91
00:05:00,510 --> 00:05:06,840
container from our local host and do quote local host ADHD and we get it works back as an answer.

92
00:05:06,840 --> 00:05:07,870
So very cool right.

93
00:05:07,890 --> 00:05:14,630
We have one easy to instance running in our cluster and is running a task of HPD.

94
00:05:14,640 --> 00:05:15,420
Very very awesome.

95
00:05:15,840 --> 00:05:17,880
So now you may ask me can we scale our service.

96
00:05:17,880 --> 00:05:19,890
Can we run two tasks.

97
00:05:19,890 --> 00:05:26,580
So let's take on the service update it and then when I want to do now is a number of tasks to click

98
00:05:26,580 --> 00:05:26,690
on.

99
00:05:26,690 --> 00:05:32,190
Next up click on Next Step and click on Next up an update service.

100
00:05:32,190 --> 00:05:36,210
So now we're saying to our service I want to have two tasks running.

101
00:05:36,510 --> 00:05:40,020
But the problem is as we can see nothing will happen.

102
00:05:40,020 --> 00:05:44,160
So nothing happens there's just one task happening no other task spending.

103
00:05:44,160 --> 00:05:50,220
And it says okay it was unable to place a task because no container instance met its requirements.

104
00:05:50,220 --> 00:05:54,600
The container is already using a port required by your task.

105
00:05:54,660 --> 00:06:01,230
So if you remember in our task definition right here when we have defined our task we said hey by the

106
00:06:01,230 --> 00:06:05,930
way I want you to map the container port to the host port 88.

107
00:06:06,420 --> 00:06:08,460
So we can only have one task per.

108
00:06:08,630 --> 00:06:08,970
Yes.

109
00:06:09,060 --> 00:06:14,250
Instance because if I try to launch a second task it will try to use again that port ADHD but it's already

110
00:06:14,250 --> 00:06:17,690
used by our instance so this will not work.

111
00:06:17,700 --> 00:06:22,980
So this is a bit of a problem but for now let's do something pretty cool instead of launching to task

112
00:06:22,980 --> 00:06:29,910
on the same issue to instance where we can do is scale our cluster so we can go to E yes instances I'll

113
00:06:29,910 --> 00:06:35,430
click on scale easy to use yes instances in how I have to instance this will basically create another

114
00:06:35,430 --> 00:06:40,190
two to micro that will come up and hopefully should join the cluster and then run our task.

115
00:06:40,200 --> 00:06:41,130
So let's wait a little bit.

116
00:06:41,620 --> 00:06:41,910
Okay.

117
00:06:41,910 --> 00:06:43,080
So if I refresh this.

118
00:06:43,080 --> 00:06:44,580
Now I see two instances.

119
00:06:44,580 --> 00:06:49,020
And what happened is that our oldest killing group so if we go back to our orders killing group right

120
00:06:49,020 --> 00:06:53,610
here our Earth is killing group was updated to have a desired count of two.

121
00:06:53,610 --> 00:06:56,500
So it has created to issue two instances total.

122
00:06:56,520 --> 00:07:01,320
Now if we go back to East yes we see that instance get registered into medically and actually all of

123
00:07:01,320 --> 00:07:04,440
the sudden you know magically a second task is running.

124
00:07:04,470 --> 00:07:09,110
So now we have to task HPD running on two different container instances.

125
00:07:09,270 --> 00:07:14,630
So let's have a quick look at the IP of this one so I think it was this this instance just got launched.

126
00:07:14,690 --> 00:07:18,880
Well we'll have a look at the IP so here is the public IP top right.

127
00:07:19,110 --> 00:07:20,680
And I'll go to the port 88.

128
00:07:21,270 --> 00:07:22,140
And yes it works too.

129
00:07:22,200 --> 00:07:26,790
So now we have two instances running our HDTV image and it works.

130
00:07:26,790 --> 00:07:32,730
So that's it for this beginning but we'll see how to relaunch this with a little load balancer and see

131
00:07:32,730 --> 00:07:33,780
how we can make this more fun.

132
00:07:33,780 --> 00:07:35,190
So I will see you in the next lecture.
