You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/integrations/ecs.md
+45-34Lines changed: 45 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,46 +12,57 @@ Amazon EC2 Container Service (ECS) is a highly scalable, high performance contai
12
12
To monitor your ECS containers and tasks with Datadog, run the Agent as a container on every EC2 instance in your ECS cluster. As detailed below, there are a few setup steps:
13
13
14
14
1.**Add an ECS Task**
15
-
2.**Create or Modify your IAM Policy**
16
-
3.**Create a new Instance with a User Script**
15
+
1.**Create or Modify your IAM Policy**
16
+
1.**Create a new Instance with a User Script**
17
17
18
18
This documentation assume you already have a working EC2 Container Service cluster configured. If not, review the [Getting Started section in the ECS documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html).
19
19
20
20
### Create an ECS Task
21
21
22
22
This task will launch the Datadog container. When you need to modify the configuration, you will update this Task Definition as described further down in this guide.
23
23
24
+
You may either configure the task using the [AWS CLI tools](https://aws.amazon.com/cli/) or using the Amazon Web Console.
1. Log in to your AWS Console and navigate to the EC2 Container Service section.
25
-
2. Click on the cluster you wish to add Datadog to.
26
-
3. Click on **Task Definitions** on the left side and click the button **Create new Task Definition**.
27
-
4. Enter a **Task Definition Name**, such as ```dd-agent-task```.
28
-
5. Click on the **Add volume** link.
29
-
6. For **Name** enter ```docker_sock```. For **Source Path**, enter ```/var/run/docker.sock```. Click **Add**.
30
-
7. Add another volume with the name ```proc``` and source path of ```/proc/```.
31
-
8. Add another volume with the name ```cgroup``` and source path of ```/cgroup/```.
32
-
9. Click the large **Add container** button.
33
-
10. For **Container name** enter ```dd-agent```.
34
-
11. For **Image** enter ```datadog/docker-dd-agent:ecs```.
35
-
12. For **Maximum memory** enter ```128```.
36
-
13. Scroll down to the **Advanced container configuration** section and enter ```10``` in **CPU units**.
37
-
14. For **Env Variables**, add a **Key** of ```API_KEY``` and enter your Datadog API Key in the value. *If you feel more comfortable storing secrets like this in s3, take a [look at the ECS Configuration guide](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html#ecs-config-s3).*
38
-
15. Add another Environment Variable for any tags you want to add using the key ```TAGS```.
39
-
16. Scroll down to the **Storage and Logging** section.
40
-
17. In **Mount points** select the **docker_sock** source volume and enter ```/var/run/docker.sock``` in the Container path. Leave the **Read only** checkbox un-checked.
41
-
18. Add another mount point for **proc** and enter ```/host/proc/``` in the Container path. Check the **Read only** checkbox.
42
-
19. Add a third mount point for **cgroup** and enter ```/host/sys/fs/cgroup``` in the Container path. Check the **Read only** checkbox.
36
+
1. Click on the cluster you wish to add Datadog to.
37
+
1. Click on **Task Definitions** on the left side and click the button **Create new Task Definition**.
38
+
1. Enter a **Task Definition Name**, such as ```dd-agent-task```.
39
+
1. Click on the **Add volume** link.
40
+
1. For **Name** enter ```docker_sock```. For **Source Path**, enter ```/var/run/docker.sock```. Click **Add**.
41
+
1. Add another volume with the name ```proc``` and source path of ```/proc/```.
42
+
1. Add another volume with the name ```cgroup``` and source path of ```/cgroup/```.
43
+
1. Click the large **Add container** button.
44
+
1. For **Container name** enter ```dd-agent```.
45
+
1. For **Image** enter ```datadog/docker-dd-agent:ecs```.
46
+
1. For **Maximum memory** enter ```128```.
47
+
1. Scroll down to the **Advanced container configuration** section and enter ```10``` in **CPU units**.
48
+
1. For **Env Variables**, add a **Key** of ```API_KEY``` and enter your Datadog API Key in the value. *If you feel more comfortable storing secrets like this in s3, take a [look at the ECS Configuration guide](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html#ecs-config-s3).*
49
+
1. Add another Environment Variable for any tags you want to add using the key ```TAGS```.
50
+
1. Scroll down to the **Storage and Logging** section.
51
+
1. In **Mount points** select the **docker_sock** source volume and enter ```/var/run/docker.sock``` in the Container path. Leave the **Read only** checkbox un-checked.
52
+
1. Add another mount point for **proc** and enter ```/host/proc/``` in the Container path. Check the **Read only** checkbox.
53
+
1. Add a third mount point for **cgroup** and enter ```/host/sys/fs/cgroup``` in the Container path. Check the **Read only** checkbox.
43
54
44
55
### Create or Modify your IAM Policy
45
56
46
57
If you are modifying the IAM Policy you created for your cluster, you may only need to add one Action: ```ecs:StartTask```.
47
58
48
59
1. Using the Identity and Access Management (IAM) console, create a new role called ```dd-agent-ecs```.
49
-
2. Select **Amazon EC2 Role for EC2 Container Service**. On the next screen do not check any checkboxes and click **Next Step**.
50
-
3. Click **Create Role**.
51
-
4. Click on the newly created role.
52
-
5. Expand the **Inline Policies** section. Click the link to create a new inline policy.
53
-
6. Choose **Custom Policy** and press the button.
54
-
7. For **Policy Name** enter ```dd-agent-policy```. Copy the following text into the **Policy Document**:
60
+
1. Select **Amazon EC2 Role for EC2 Container Service**. On the next screen do not check any checkboxes and click **Next Step**.
61
+
1. Click **Create Role**.
62
+
1. Click on the newly created role.
63
+
1. Expand the **Inline Policies** section. Click the link to create a new inline policy.
64
+
1. Choose **Custom Policy** and press the button.
65
+
1. For **Policy Name** enter ```dd-agent-policy```. Copy the following text into the **Policy Document**:
55
66
56
67
57
68
{
@@ -84,11 +95,11 @@ Ideally you want the Datadog agent to load on one container on each EC2 instance
84
95
#### Create a new Amazon Linux instance
85
96
86
97
1. Log in to the AWS console and navigate to the EC2 section.
87
-
2. Create a new instance by clicking the **Launch Instance** button.
88
-
3. Click on Community AMIs. Visit [this page to see a list of current ECS optimized instances](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html). Choose the appropriate AMI for your region and copy the ID into the search box. Choose the AMI that comes up as a result of the search.
89
-
4. Follow the prompts as you normally would when setting up an instance.
90
-
5. On the third dialog, select the IAM role you created above.
91
-
6. Expand the Advanced Details section and copy the following script into the User Data section. Change cluster name to your cluster's name and task definition to the name you gave your task definition.
98
+
1. Create a new instance by clicking the **Launch Instance** button.
99
+
1. Click on Community AMIs. Visit [this page to see a list of current ECS optimized instances](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html). Choose the appropriate AMI for your region and copy the ID into the search box. Choose the AMI that comes up as a result of the search.
100
+
1. Follow the prompts as you normally would when setting up an instance.
101
+
1. On the third dialog, select the IAM role you created above.
102
+
1. Expand the Advanced Details section and copy the following script into the User Data section. Change cluster name to your cluster's name and task definition to the name you gave your task definition.
92
103
93
104
#!/bin/bash
94
105
cluster="cluster_name"
@@ -116,9 +127,9 @@ Ideally you want the Datadog agent to load on one container on each EC2 instance
116
127
#### Create a new CoreOS instance
117
128
118
129
1. Log in to the AWS console and navigate to the EC2 section.
119
-
2. Create a new instance as described in the instructions for a simple CoreOS ECS instance [here](https://coreos.com/os/docs/latest/booting-on-ecs.html)).
120
-
3. When you get to the Configure Instance Details step, select the IAM role you created above.
121
-
4. Paste the following block in User Data under Advanced Details, replace `CLUSTER_NAME` and `YOUR_API_KEY` with the ECS cluster that instance will join and your Datadog API key. This block declares two units with cloud-config, one for the ecs-agent container, used by Amazon ECS to administrate the ECS instance, and one for the dd-agent container, used by Datadog to collect metrics about the system and the tasks running on this ECS instance. Of course it can be modified to include your own tasks as well.
130
+
1. Create a new instance as described in the instructions for a simple CoreOS ECS instance [here](https://coreos.com/os/docs/latest/booting-on-ecs.html)).
131
+
1. When you get to the Configure Instance Details step, select the IAM role you created above.
132
+
1. Paste the following block in User Data under Advanced Details, replace `CLUSTER_NAME` and `YOUR_API_KEY` with the ECS cluster that instance will join and your Datadog API key. This block declares two units with cloud-config, one for the ecs-agent container, used by Amazon ECS to administrate the ECS instance, and one for the dd-agent container, used by Datadog to collect metrics about the system and the tasks running on this ECS instance. Of course it can be modified to include your own tasks as well.
0 commit comments