Created
April 4, 2018 13:51
-
-
Save DD-ScottBeamish/7014785f3c3c4cb22c8b60d79f099297 to your computer and use it in GitHub Desktop.
K8S 1.9 + Auto Discovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: datadog-config | |
namespace: default | |
data: | |
tomcat-autoconf.yaml: |- | |
ad_identifiers: | |
- tomcat | |
instances: | |
- host: %%host%% | |
port: %%port%% | |
init_config: | |
is_jmx: true | |
collect_default_metrics: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: datadog-agent | |
spec: | |
template: | |
metadata: | |
labels: | |
app: datadog-agent | |
name: datadog-agent | |
spec: | |
containers: | |
- image: datadog/agent:latest | |
imagePullPolicy: Always | |
name: datadog-agent | |
ports: | |
- containerPort: 8125 | |
name: dogstatsdport | |
protocol: UDP | |
env: | |
- name: DD_API_KEY | |
value: <YOUR_API_KEY> | |
- name: KUBERNETES | |
value: "yes" | |
- name: DD_KUBERNETES_KUBELET_HOST | |
valueFrom: | |
fieldRef: | |
fieldPath: status.hostIP | |
resources: | |
requests: | |
memory: "128Mi" | |
cpu: "100m" | |
limits: | |
memory: "512Mi" | |
cpu: "250m" | |
volumeMounts: | |
- name: dockersocket | |
mountPath: /var/run/docker.sock | |
- name: procdir | |
mountPath: /host/proc | |
readOnly: true | |
- name: cgroups | |
mountPath: /host/sys/fs/cgroup | |
readOnly: true | |
- name: tomcat-config | |
mountPath: /conf.d | |
livenessProbe: | |
exec: | |
command: | |
- ./probe.sh | |
initialDelaySeconds: 15 | |
periodSeconds: 5 | |
volumes: | |
- hostPath: | |
path: /var/run/docker.sock | |
name: dockersocket | |
- hostPath: | |
path: /proc | |
name: procdir | |
- hostPath: | |
path: /sys/fs/cgroup | |
name: cgroups | |
- name: tomcat-config | |
configMap: | |
name: datadog-config | |
items: | |
- key: tomcat-autoconf.yaml | |
path: tomcat-autoconf.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment