Created
July 25, 2018 01:38
-
-
Save DD-ScottBeamish/c8cdae5ced99670d94d06ee75c29deed to your computer and use it in GitHub Desktop.
This file contains hidden or 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: dd-agent-config | |
| namespace: myproject | |
| data: | |
| kubernetes.yaml: |- | |
| init_config: | |
| min_collection_interval: 300 | |
| instances: | |
| - port: 0 | |
| method: https | |
| kubelet_tls_verify: False |
This file contains hidden or 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: | |
| serviceAccountName: datadog-agent | |
| nodeSelector: | |
| label: local | |
| containers: | |
| - image: datadog/docker-dd-agent:latest | |
| imagePullPolicy: Always | |
| name: datadog-agent | |
| ports: | |
| - containerPort: 8125 | |
| name: dogstatsdport | |
| protocol: UDP | |
| - containerPort: 8126 | |
| name: traceport | |
| protocol: TCP | |
| securityContext: | |
| privileged: true | |
| env: | |
| - name: DD_API_KEY | |
| value: XXX | |
| - name: DD_COLLECT_KUBERNETES_EVENTS | |
| value: "true" | |
| - name: DD_LEADER_ELECTION | |
| value: "true" | |
| - name: KUBERNETES | |
| value: "yes" | |
| - name: DD_KUBERNETES_KUBELET_HOST | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: spec.nodeName | |
| 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 | |
| - mountPath: /etc/dd-agent/conf.d/kubernetes.yaml.example | |
| name: dd-agent-config | |
| subPath: kubernetes.yaml | |
| 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 | |
| - configMap: | |
| name: dd-agent-config | |
| name: dd-agent-config |
This file contains hidden or 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
| #!/bin/bash | |
| ./oc cluster up --image=registry.access.redhat.com/openshift3/ose --version=v3.5 | |
| ./oc login -u system:admin | |
| # you need to run ./oc get nodes to get the ip address of your local node and use it here | |
| ./oc label node 192.168.65.3 label=local | |
| ./oc create serviceaccount datadog-agent | |
| ./oc adm policy add-scc-to-user privileged system:serviceaccount:myproject:datadog-agent | |
| ./oc create -f configmap.yaml | |
| ./oc create -f dd-agent-daemonset.yaml |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions
Download the oc 1.5 client and extract 'oc' to same dir as these files.
Bring a cluster up on Openshift 3.5:
oc cluster up --image=registry.access.redhat.com/openshift3/ose --version=v3.5Login as Admin:
oc login -u system:adminLabel the node
oc get nodesoc label node 192.168.65.3 label=localCreate a serviceaccount
oc create serviceaccount datadog-agentAdd permissive policy to serviceaccount
oc adm policy add-scc-to-user privileged system:serviceaccount:myproject:datadog-agentCreate the config-map
oc create -f configmap.yamlRun Daemonset (as service account, with label selector and as a privileged pod)
oc create -f dd-agent-daemonset.yaml