diff --git a/stable/datadog/README.md b/stable/datadog/README.md index 492b0d6b54..cac8166cbb 100644 --- a/stable/datadog/README.md +++ b/stable/datadog/README.md @@ -57,6 +57,8 @@ The following tables lists the configurable parameters of the Datadog chart and | `kubeStateMetrics.enabled` | If true, create kube-state-metrics | `true` | | `daemonset.podAnnotations` | Annotations to add to the DaemonSet's Pods | `nil` | | `daemonset.tolerations` | List of node taints to tolerate (requires Kubernetes >= 1.6) | `nil` | +| `daemonset.useHostNetwork` | If true, use the host's network | `nil` | +| `daemonset.useHostPort` | If true, use the same ports for both host and container | `nil` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/datadog/templates/daemonset.yaml b/stable/datadog/templates/daemonset.yaml index 12e2efc5e7..0268f564e7 100644 --- a/stable/datadog/templates/daemonset.yaml +++ b/stable/datadog/templates/daemonset.yaml @@ -17,6 +17,9 @@ spec: {{ toYaml .Values.daemonset.podAnnotations | indent 8 }} {{- end }} spec: + {{- if .Values.daemonset.useHostNetwork }} + hostNetwork: {{ .Values.daemonset.useHostNetwork }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -25,10 +28,16 @@ spec: {{ toYaml .Values.resources | indent 12 }} ports: - containerPort: 8125 + {{- if .Values.daemonset.useHostPort }} + hostPort: 8125 + {{- end }} name: dogstatsdport protocol: UDP {{- if .Values.datadog.apmEnabled }} - containerPort: 8126 + {{- if .Values.daemonset.useHostPort }} + hostPort: 8126 + {{- end }} name: traceport protocol: TCP - containerPort: 7777 diff --git a/stable/datadog/values.yaml b/stable/datadog/values.yaml index ca2da78ff4..2315b99053 100644 --- a/stable/datadog/values.yaml +++ b/stable/datadog/values.yaml @@ -12,6 +12,19 @@ image: # get guaranteed delivery of the metrics in Datadog-per-namespace setup! daemonset: enabled: true + ## Bind ports on the hostNetwork. Useful for CNI networking where hostPort might + ## not be supported. The ports will need to be available on all hosts. Can be + ## used for custom metrics instead of a service endpoint. + ## WARNING: Make sure that hosts using this are properly firewalled otherwise + ## metrics and traces will be accepted from any host able to connect to this host. + # useHostNetwork: true + + ## Sets the hostPort to the same value of the container port. Can be used as + ## for sending custom metrics. The ports will need to be available on all + ## hosts. + ## WARNING: Make sure that hosts using this are properly firewalled otherwise + ## metrics and traces will be accepted from any host able to connect to this host. + # useHostPort: true ## Annotations to add to the DaemonSet's Pods # podAnnotations: @@ -31,7 +44,7 @@ daemonset: deployment: enabled: false replicas: 1 - + ## deploy the kube-state-metrics deployment ## ref: https://github.com/kubernetes/charts/tree/master/stable/kube-state-metrics ##