Skip to content

Instantly share code, notes, and snippets.

@bketelsen
Last active August 29, 2015 14:07
Show Gist options
  • Save bketelsen/f6a4d65180779fa3e844 to your computer and use it in GitHub Desktop.
Save bketelsen/f6a4d65180779fa3e844 to your computer and use it in GitHub Desktop.
DataDog agent as privileged Pod with Service - collects info on host, and all docker containers. Accepts statsd on port 8125 on every machine.
{
"id": "ddagent",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
"replicas": 3,
"replicaSelector": {"name": "ddagent"},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "xorpod",
"containers": [{
"name": "dogstatsd",
"image": "datadog/docker-dd-agent",
"ports": [{"containerPort": 8125, "protocol":"UDP",
"hostPort":8125}],
"env":[{"name":"API_KEY",
"value":"260a27722febb342b1439879b5a5240d"}],
"privileged":true,
"volumeMounts":[{"name":"dockersock",
"mountPath":"/var/run/docker.sock"},
{"name":"procmounts",
"mountPath":"/host/proc/mounts",
"readOnly":true},
{"name":"cgroups",
"mountPath":"/host/sys/fs/cgroup",
"readOnly":true}]
}],
"volumes":[{"name":"dockersock",
"hostDir":"/var/run/docker.sock"},
{"name":"procmounts",
"hostDir":"/proc/mounts"},
{"name":"cgroups",
"hostDir":"/sys/fs/cgroup/"}]
}
},
"labels": {"name": "ddagent"}
}},
"labels": {"name": "ddagent"}
}
@bketelsen
Copy link
Author

You can send metrics from any other docker container on the host to $SERVICE_HOST:8125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment