Skip to content

Commit c6213b3

Browse files
author
charlyF
committed
first pass at the Datadog Workshop
1 parent 149cf9a commit c6213b3

File tree

21 files changed

+477
-6668
lines changed

21 files changed

+477
-6668
lines changed

02-path-working-with-clusters/201-cluster-monitoring/readme.adoc

Lines changed: 140 additions & 240 deletions
Large diffs are not rendered by default.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
apiVersion: extensions/v1beta1
2+
kind: DaemonSet
3+
metadata:
4+
name: dd-agent
5+
spec:
6+
template:
7+
metadata:
8+
labels:
9+
app: dd-agent
10+
name: dd-agent
11+
spec:
12+
containers:
13+
- image: datadog/agent:latest
14+
imagePullPolicy: Always
15+
name: dd-agent
16+
ports:
17+
- containerPort: 8125
18+
hostPort: 8125
19+
name: dogstatsdport
20+
protocol: UDP
21+
- containerPort: 8126
22+
name: traceport
23+
protocol: TCP
24+
env:
25+
- name: DD_API_KEY
26+
value: <DD_API_KEY>
27+
- name: KUBERNETES
28+
value: "yes"
29+
- name: DD_APM_ENABLED
30+
value: "true"
31+
- name: DD_PROCESS_AGENT_ENABLED
32+
value: "true"
33+
- name: DD_LOGS_ENABLED
34+
value: "true"
35+
- name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
36+
value: "true"
37+
- name: HOST_PROC
38+
value: /host/proc
39+
- name: HOST_SYS
40+
value: /host/sys
41+
volumeMounts:
42+
- name: dockersocket
43+
mountPath: /var/run/docker.sock
44+
- name: procdir
45+
mountPath: /host/proc
46+
readOnly: true
47+
- name: cgroups
48+
mountPath: /host/sys/fs/cgroup
49+
readOnly: true
50+
- name: passwd
51+
mountPath: /etc/passwd
52+
readOnly: true
53+
- name: pointerdir
54+
mountPath: /opt/datadog-agent/run
55+
volumes:
56+
- hostPath:
57+
path: /run/docker.sock
58+
name: dockersocket
59+
- hostPath:
60+
path: /proc
61+
name: procdir
62+
- hostPath:
63+
path: /sys/fs/cgroup
64+
name: cgroups
65+
- hostPath:
66+
path: /etc/passwd
67+
name: passwd
68+
- hostPath:
69+
path: /opt/datadog-agent/run
70+
name: pointerdir
71+
---
72+
apiVersion: v1
73+
kind: Service
74+
metadata:
75+
name: dd-agent
76+
labels:
77+
run: dd-agent
78+
spec:
79+
ports:
80+
- name: dogstatsdport
81+
port: 8125
82+
targetPort: 8125
83+
protocol: UDP
84+
- name: traceport
85+
port: 8126
86+
targetPort: 8126
87+
protocol: TCP
88+
targetPort: 8126
89+
protocol: TCP
90+
selector:
91+
app: dd-agent
92+
type: ClusterIP
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: datadog-agent
5+
rules:
6+
- apiGroups: # This is required by the agent to query the Kubelet API.
7+
- ""
8+
resources:
9+
- nodes/metrics
10+
- nodes/spec
11+
- nodes/proxy # Required to get /pods
12+
verbs:
13+
- get
14+
---
15+
kind: ServiceAccount
16+
apiVersion: v1
17+
metadata:
18+
name: datadog-agent
19+
namespace: default
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: ClusterRoleBinding
23+
metadata:
24+
name: datadog-agent
25+
roleRef:
26+
apiGroup: rbac.authorization.k8s.io
27+
kind: ClusterRole
28+
name: datadog-agent
29+
subjects:
30+
- kind: ServiceAccount
31+
name: datadog-agent
32+
namespace: default

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/grafana.yaml

Lines changed: 0 additions & 76 deletions
This file was deleted.

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/heapster-rbac.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/heapster.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/influxdb.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: mongo
6+
labels:
7+
name: mongo
8+
spec:
9+
ports:
10+
- port: 27017
11+
targetPort: 27017
12+
clusterIP: None
13+
selector:
14+
role: mongo
15+
---
16+
apiVersion: apps/v1beta1
17+
kind: StatefulSet
18+
metadata:
19+
name: mongo
20+
spec:
21+
serviceName: "mongo"
22+
replicas: 3
23+
template:
24+
metadata:
25+
annotations:
26+
ad.datadoghq.com/mongo.check_names: '["mongo"]'
27+
ad.datadoghq.com/mongo.init_configs: '[{}]'
28+
ad.datadoghq.com/mongo.instances: '[{"server": "mongodb://datadog:tndPhL3wrMEDuj4wLEHmbxbV@%%host%%:%%port%%"}]'
29+
labels:
30+
role: mongo
31+
environment: test
32+
spec:
33+
serviceAccountName: dca
34+
terminationGracePeriodSeconds: 10
35+
containers:
36+
- name: mongo
37+
image: mongo
38+
command:
39+
- mongod
40+
- "--replSet"
41+
- rs0
42+
- "--bind_ip"
43+
- 0.0.0.0
44+
- "--smallfiles"
45+
- "--noprealloc"
46+
ports:
47+
- containerPort: 27017
48+
volumeMounts:
49+
- name: mongo-persistent-storage
50+
mountPath: /data/db
51+
- name: mongo-sidecar
52+
image: cvallance/mongo-k8s-sidecar
53+
env:
54+
- name: MONGO_SIDECAR_POD_LABELS
55+
value: "role=mongo,environment=test"
56+
volumeClaimTemplates:
57+
- metadata:
58+
name: mongo-persistent-storage
59+
annotations:
60+
volume.beta.kubernetes.io/storage-class: "fast"
61+
spec:
62+
accessModes: [ "ReadWriteOnce" ]
63+
resources:
64+
requests:
65+
storage: 1Gi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: StorageClass
2+
apiVersion: storage.k8s.io/v1beta1
3+
metadata:
4+
name: fast
5+
provisioner: kubernetes.io/aws-ebs
6+
parameters:
7+
type: gp2

0 commit comments

Comments
 (0)