Unverified Commit e870c8ab by Denise Committed by GitHub

Merge pull request #220 from guangbochen/datadog2.3

Bump datadog chart to v1.33.0
parents 97969130 686f95f2
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
apiVersion: v1
name: datadog
version: 1.33.0
appVersion: 6.13.0
description: DataDog Agent
keywords:
- monitoring
- alerting
- metric
home: https://www.datadoghq.com
icon: file://../dd_logo_70x75.png
sources:
- https://app.datadoghq.com/account/settings#agent/kubernetes
- https://github.com/DataDog/datadog-agent
maintainers:
- name: hkaj
email: haissam@datadoghq.com
- name: irabinovitch
email: ilan@datadoghq.com
- name: charlyf
email: charly@datadoghq.com
- name: mfpierre
email: pierre.margueritte@datadoghq.com
- name: clamoriniere
email: cedric.lamoriniere@datadoghq.com
- name: xlucas
email: xavier.lucas@datadoghq.com
approvers:
- hkaj
- irabinovitch
- charlyf
- mfpierre
- clamoriniere
- xlucas
reviewers:
- hkaj
- irabinovitch
- charlyf
- mfpierre
- clamoriniere
- xlucas
### Enabling the Datadog Cluster Agent
Read about the Datadog Cluster Agent in the [official documentation](https://docs.datadoghq.com/agent/kubernetes/cluster/).
Run the following if you want to deploy the chart with the Datadog Cluster Agent:
```bash
helm install --name datadog-monitoring \
--set datadog.apiKey=<DATADOG_API_KEY> \
--set datadog.appKey=<DATADOG_APP_KEY \
--set clusterAgent.enabled=true \
--set clusterAgent.metricsProvider.enabled=true \
stable/datadog
```
**Note**: Specifying `clusterAgent.metricsProvider.enabled=true` enables the External Metrics Server.
If you want to learn to use this feature, you can check out this [Datadog Cluster Agent walkthrough](https://github.com/DataDog/datadog-agent/blob/master/docs/cluster-agent/CUSTOM_METRICS_SERVER.md).
The Leader Election is enabled by default in the chart for the Cluster Agent. Only the Cluster Agent(s) participate in the election, in case you have several replicas configured (using `clusterAgent.replicas`.
#### Cluster Agent Token
You can specify the Datadog Cluster Agent token used to secure the communication between the Cluster Agent(s) and the Agents with `clusterAgent.token`.
**If you don't specify a token, a random one is generated at each deployment so you must use `--recreate-pods` to ensure all pod use the same token.** see[Datadog Chart notes](https://github.com/helm/charts/blob/57d3030941ad2ec2d6f97c86afdf36666658a884/stable/datadog/templates/NOTES.txt#L49-L59) to learn more.
### Upgrading
#### From 1.19.0 onwards
Version `1.19.0` introduces the use of release name as full name if it contains the chart name(`datadog` in this case).
E.g. with a release name of `datadog`, this renames the `DaemonSet` from `datadog-datadog` to `datadog`.
The suggested approach is to delete the release and reinstall it.
#### From 1.0.0 onwards
Starting with version 1.0.0, this chart does not support deploying Agent 5.x anymore. If you cannot upgrade to Agent 6.x, you can use a previous version of the chart by calling helm install with `--version 0.18.0`.
See [0.18.1's README](https://github.com/helm/charts/blob/847f737479bb78d89f8fb650db25627558fbe1f0/stable/datadog/README.md) to see which options were supported at the time.
### Uninstalling the Chart
To uninstall/delete the `<RELEASE_NAME>` deployment:
```bash
helm delete <RELEASE_NAME> --purge
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
As a best practice, a YAML file that specifies the values for the chart parameters should be provided to configure the chart:
1. **Copy the default [`datadog-values.yaml`](values.yaml) value file.**
2. Set the `apiKey` parameter with your [Datadog API key](https://app.datadoghq.com/account/settings#api).
3. Upgrade the Datadog Helm chart with the new `datadog-values.yaml` file:
```bash
helm upgrade -f datadog-values.yaml <RELEASE_NAME> stable/datadog --recreate-pods
```
See the [All configuration options](#all-configuration-options) section to discover all possibilities offered by the Datadog chart.
### Enabling Log Collection
Update your [datadog-values.yaml](values.yaml) file with the following log collection configuration:
```
datadog:
(...)
logsEnabled: true
logsConfigContainerCollectAll: true
```
then upgrade your Datadog Helm chart:
```bash
helm upgrade -f datadog-values.yaml <RELEASE_NAME> stable/datadog --recreate-pods
```
### Enabling Process Collection
Update your [datadog-values.yaml](values.yaml) file with the process collection configuration:
```
datadog:
(...)
processAgentEnabled: true
```
then upgrade your Datadog Helm chart:
```bash
helm upgrade -f datadog-values.yaml <RELEASE_NAME> stable/datadog --recreate-pods
```
### Kubernetes event collection
Use the [Datadog Cluster Agent](#enabling-the-datadog-cluster-agent) to collect Kubernetes events. Please read [the official documentation](https://docs.datadoghq.com/agent/kubernetes/event_collection/) for more context.
Alternatively set the `datadog.leaderElection`, `datadog.collectEvents` and `rbac.create` options to `true` in order to enable Kubernetes event collection.
### conf.d and checks.d
The Datadog [entrypoint](https://github.com/DataDog/datadog-agent/blob/master/Dockerfiles/agent/entrypoint/89-copy-customfiles.sh) copies files with a `.yaml` extension found in `/conf.d` and files with `.py` extension in `/check.d` to `/etc/datadog-agent/conf.d` and `/etc/datadog-agent/checks.d` respectively.
The keys for `datadog.confd` and `datadog.checksd` should mirror the content found in their respective ConfigMaps. Update your [datadog-values.yaml](values.yaml) file with the check configurations:
```yaml
datadog:
confd:
redisdb.yaml: |-
ad_identifiers:
- redis
- bitnami/redis
init_config:
instances:
- host: "%%host%%"
port: "%%port%%"
jmx.yaml: |-
ad_identifiers:
- openjdk
instance_config:
instances:
- host: "%%host%%"
port: "%%port_0%%"
redisdb.yaml: |-
init_config:
instances:
- host: "outside-k8s.example.com"
port: 6379
```
then upgrade your Datadog Helm chart:
```bash
helm upgrade -f datadog-values.yaml <RELEASE_NAME> stable/datadog --recreate-pods
```
For more details, please refer to [the documentation](https://docs.datadoghq.com/agent/kubernetes/integrations/).
### Kubernetes Labels and Annotations
To map Kubernetes pod labels and annotations to Datadog tags, provide a dictionary with kubernetes labels/annotations as keys and Datadog tags key as values in your [datadog-values.yaml](values.yaml) file:
```yaml
podAnnotationsAsTags:
iam.amazonaws.com/role: kube_iamrole
```
```yaml
podLabelsAsTags:
app: kube_app
release: helm_release
```
then upgrade your Datadog Helm chart:
```bash
helm upgrade -f datadog-values.yaml <RELEASE_NAME> stable/datadog --recreate-pods
```
### CRI integration
As of the version 6.6.0, the Datadog Agent supports collecting metrics from any container runtime interface used in your cluster. Configure the location path of the socket with `datadog.criSocketPath` and make sure you allow the socket to be mounted into the pod running the agent by setting `datadog.useCriSocketVolume` to `True`.
Standard paths are:
- Containerd socket: `/var/run/containerd/containerd.sock`
- Cri-o socket: `/var/run/crio/crio.sock`
## All configuration options
The following table lists the configurable parameters of the Datadog chart and their default values. Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
helm install --name <RELEASE_NAME> \
--set datadog.apiKey=<DATADOG_API_KEY>,datadog.logLevel=DEBUG \
stable/datadog
```
| Parameter | Description | Default |
| ----------------------------- | ------------------------------------ | ------------------------------------------- |
| `datadog.apiKey` | Your Datadog API key | `Nil` You must provide your own key |
| `datadog.apiKeyExistingSecret` | If set, use the secret with a provided name instead of creating a new one | `nil` |
| `datadog.appKey` | Datadog APP key required to use metricsProvider | `Nil` You must provide your own key |
| `datadog.appKeyExistingSecret` | If set, use the secret with a provided name instead of creating a new one | `nil` |
| `image.repository` | The image repository to pull from | `datadog/agent` |
| `image.tag` | The image tag to pull | `6.10.1` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Image pull secrets | `nil` |
| `nameOverride` | Override name of app | `nil` |
| `fullnameOverride` | Override full name of app | `nil` |
| `rbac.create` | If true, create & use RBAC resources | `true` |
| `rbac.serviceAccountName` | existing ServiceAccount to use (ignored if rbac.create=true) | `default` |
| `daemonset.podLabels` | labels to add to each pod | `nil` |
| `datadog.name` | Container name if Daemonset or Deployment | `datadog` |
| `datadog.site` | Site ('datadoghq.com' or 'datadoghq.eu') | `nil` |
| `datadog.dd_url` | Datadog intake server | `nil` |
| `datadog.env` | Additional Datadog environment variables | `nil` |
| `datadog.logLevel` | Agent log verbosity (possible values: trace, debug, info, warn, error, critical, and off) | `INFO` |
| `datadog.logsEnabled` | Enable log collection | `nil` |
| `datadog.logsConfigContainerCollectAll` | Collect logs from all containers | `nil` |
| `datadog.logsPointerHostPath` | Host path to store the log tailing state in | `/var/lib/datadog-agent/logs` |
| `datadog.apmEnabled` | Enable tracing from the host | `nil` |
| `datadog.processAgentEnabled` | Enable live process monitoring | `nil` |
| `datadog.checksd` | Additional custom checks as python code | `nil` |
| `datadog.confd` | Additional check configurations (static and Autodiscovery) | `nil` |
| `datadog.criSocketPath` | Path to the container runtime socket (if different from Docker) | `nil` |
| `datadog.tags` | Set host tags | `nil` |
| `datadog.nonLocalTraffic` | Enable statsd reporting from any external ip | `False` |
| `datadog.useCriSocketVolume` | Enable mounting the container runtime socket in Agent containers | `True` |
| `datadog.dogstatsdOriginDetection` | Enable origin detection for container tagging | `False` |
| `datadog.useDogStatsDSocketVolume` | Enable dogstatsd over Unix Domain Socket | `False` |
| `datadog.dogStatsDSocketPath` | Custom path to the socket, has to be located in the `/var/run/datadog` folder path | `/var/run/datadog/dsd.socket` |
| `datadog.volumes` | Additional volumes for the daemonset or deployment | `nil` |
| `datadog.volumeMounts` | Additional volumeMounts for the daemonset or deployment | `nil` |
| `datadog.podAnnotationsAsTags` | Kubernetes Annotations to Datadog Tags mapping | `nil` |
| `datadog.podLabelsAsTags` | Kubernetes Labels to Datadog Tags mapping | `nil` |
| `datadog.resources.requests.cpu` | CPU resource requests | `200m` |
| `datadog.resources.limits.cpu` | CPU resource limits | `200m` |
| `datadog.resources.requests.memory` | Memory resource requests | `256Mi` |
| `datadog.resources.limits.memory` | Memory resource limits | `256Mi` |
| `datadog.securityContext` | Allows you to overwrite the default securityContext applied to the container | `nil` |
| `datadog.livenessProbe` | Overrides the default liveness probe | http port 5555 |
| `datadog.hostname` | Set the hostname (write it in datadog.conf) | `nil` |
| `datadog.acInclude` | Include containers based on image name | `nil` |
| `datadog.acExclude` | Exclude containers based on image name | `nil` |
| `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.nodeSelector` | Node selectors | `nil` |
| `daemonset.affinity` | Node affinities | `nil` |
| `daemonset.useHostNetwork` | If true, use the host's network | `nil` |
| `daemonset.useHostPID`. | If true, use the host's PID namespace | `nil` |
| `daemonset.useHostPort` | If true, use the same ports for both host and container | `nil` |
| `daemonset.useDedicatedContainers` | If true, each Datadog agent will run in a separate container | `nil` |
| `daemonset.containers.agent.env` | Additional list of environment variables to use in the agent container | `nil` |
| `daemonset.containers.agent.logLevel` | Agent log verbosity | `INFO` |
| `daemonset.containers.agent.resources.limits.cpu` | CPU resource limits for the agent container | `200m` |
| `daemonset.containers.agent.resources.requests.cpu` | CPU resource requests for the agent container | `200m` |
| `daemonset.containers.agent.resources.limits.memory` | Memory resource limits for the agent container | `256Mi` |
| `daemonset.containers.agent.resources.requests.memory` | Memory resource requests for the agent container | `256Mi` |
| `daemonset.containers.processAgent.env` | Additional list of environment variables to use in the process-agent container | `nil` |
| `daemonset.containers.processAgent.logLevel` | Process agent log verbosity | `INFO` |
| `daemonset.containers.processAgent.resources.limits.cpu` | CPU resource limits for the process-agent container | `100m` |
| `daemonset.containers.processAgent.resources.requests.cpu` | CPU resource requests for the process-agent container | `100m` |
| `daemonset.containers.processAgent.resources.limits.memory` | Memory resource limits for the process-agent container | `200Mi` |
| `daemonset.containers.processAgent.resources.requests.memory` | Memory resource requests for the process-agent container | `200Mi` |
| `daemonset.containers.traceAgent.env` | Additional list of environment variables to use in the trace-agent container | `nil` |
| `daemonset.containers.traceAgent.logLevel` | Trace agent log verbosity | `INFO` |
| `daemonset.containers.traceAgent.resources.limits.cpu` | CPU resource limits for the trace-agent container | `100m` |
| `daemonset.containers.traceAgent.resources.requests.cpu` | CPU resource requests for the trace-agent container | `100m` |
| `daemonset.containers.traceAgent.resources.limits.memory` | Memory resource limits for the trace-agent container | `200Mi` |
| `daemonset.containers.traceAgent.resources.requests.memory` | Memory resource requests for the trace-agent container | `200Mi` |
| `daemonset.priorityClassName` | Which Priority Class to associate with the daemonset | `nil` |
| `datadog.leaderElection` | Enable the leader Election feature | `false` |
| `datadog.leaderLeaseDuration` | The duration for which a leader stays elected. | 60 sec, 15 if Cluster Checks enabled |
| `datadog.collectEvents` | Enable Kubernetes event collection. Requires leader election. | `false` |
| `deployment.affinity` | Node / Pod affinities | `{}` |
| `deployment.tolerations` | List of node taints to tolerate | `[]` |
| `deployment.priorityClassName` | Which Priority Class to associate with the deployment | `nil` |
| `kubeStateMetrics.enabled` | If true, create kube-state-metrics | `true` |
| `kube-state-metrics.rbac.create` | If true, create & use RBAC resources for kube-state-metrics | `true` |
| `kube-state-metrics.serviceAccount.create` | If true, create & use serviceAccount | `true` |
| `kube-state-metrics.serviceAccount.name` | If not set & create is true, use template fullname | |
| `kube-state-metrics.resources` | Overwrite the default kube-state-metrics container resources (Optional) | |
| `clusterAgent.enabled` | Use the cluster-agent for cluster metrics (Kubernetes 1.10+ only) | `false` |
| `clusterAgent.token` | A cluster-internal secret for agent-to-agent communication. Must be 32+ characters a-zA-Z | Generates a random value |
| `clusterAgent.tokenExistingSecret` | If set, use the secret with a provided name instead of creating a new one | `nil` |
| `clusterAgent.containerName` | The container name for the Cluster Agent | `cluster-agent` |
| `clusterAgent.image.repository` | The image repository for the cluster-agent | `datadog/cluster-agent` |
| `clusterAgent.image.tag` | The image tag to pull | `1.2.0` |
| `clusterAgent.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `clusterAgent.image.pullSecrets` | Image pull secrets | `nil` |
| `clusterAgent.metricsProvider.enabled` | Enable Datadog metrics as a source for HPA scaling | `false` |
| `clusterAgent.clusterChecks.enabled` | Enable Cluster Checks on both the Cluster Agent and the Agent daemonset | `false` |
| `clusterAgent.confd` | Additional check configurations (static and Autodiscovery) | `nil` |
| `clusterAgent.podAnnotations` | Annotations to add to the Cluster Agent Pod(s) | `nil` |
| `clusterAgent.priorityClassName` | Name of the priorityClass to apply to the Cluster Agent | `nil` |
| `clusterAgent.resources.requests.cpu` | CPU resource requests | `200m` |
| `clusterAgent.resources.limits.cpu` | CPU resource limits | `200m` |
| `clusterAgent.resources.requests.memory` | Memory resource requests | `256Mi` |
| `clusterAgent.resources.limits.memory` | Memory resource limits | `256Mi` |
| `clusterAgent.tolerations` | List of node taints to tolerate | `[]` |
| `clusterAgent.livenessProbe` | Overrides the default liveness probe | http port 443 if external metrics enabled |
| `clusterAgent.readinessProbe` | Overrides the default readiness probe | http port 443 if external metrics enabled |
| `clusterchecksDeployment.enabled` | Enable Datadog agent deployment dedicated for running Cluster Checks. It allows having different resources (Request/Limit) for Cluster Checks agent pods. | `false` |
| `clusterchecksDeployment.env` | Additional Datadog environment variables for Cluster Checks Deployment | `nil` |
| `clusterchecksDeployment.resources.requests.cpu` | CPU resource requests | `200m` |
| `clusterchecksDeployment.resources.limits.cpu` | CPU resource limits | `200m` |
| `clusterchecksDeployment.resources.requests.memory` | Memory resource requests | `256Mi` |
| `clusterchecksDeployment.resources.limits.memory` | Memory resource limits | `256Mi` |
| `clusterchecksDeployment.nodeSelector` | Node selectors | `nil` |
| `clusterchecksDeployment.tolerations` | List of node taints to tolerate | `nil` |
| `clusterchecksDeployment.affinity` | Node affinities | avoid running pods on the same node |
| `clusterchecksDeployment.livenessProbe` | Overrides the default liveness probe | http port 5555 |
| `clusterchecksDeployment.rbac.dedicated` | If true, use dedicated RBAC resources for clusterchecks agent's pods | `false` |
| `clusterchecksDeployment.rbac.serviceAccount` | existing ServiceAccount to use (ignored if rbac.create=true) for clusterchecks | `default` |
# Datadog
[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/kubernetes/charts/tree/master/stable/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).
Datadog [offers two variants](https://hub.docker.com/r/datadog/agent/tags/), switch to a `-jmx` tag if you need to run JMX/java integrations. The chart also supports running [the standalone dogstatsd image](https://hub.docker.com/r/datadog/dogstatsd/tags/).
See the [Datadog JMX integration](https://docs.datadoghq.com/integrations/java/) to learn more.
## Prerequisites
Kubernetes 1.4+ or OpenShift 3.4+, note that:
* the Datadog Agent supports Kubernetes 1.3+
* The Datadog chart's defaults are tailored to Kubernetes 1.7.6+, see [Datadog Agent legacy Kubernetes versions documentation](https://github.com/DataDog/datadog-agent/tree/master/Dockerfiles/agent#legacy-kubernetes-versions) for adjustments you might need to make for older versions
## Quick start
By default, the Datadog Agent runs in a DaemonSet. It can alternatively run inside a Deployment for special use cases.
**Note:** simultaneous DaemonSet + Deployment installation within a single release will be deprecated in a future version, requiring two releases to achieve this.
### Installing the Datadog Chart
To install the chart with the release name `<RELEASE_NAME>`, retrieve your Datadog API key from your [Agent Installation Instructions](https://app.datadoghq.com/account/settings#agent/kubernetes) and run:
```bash
helm install --name <RELEASE_NAME> \
--set datadog.apiKey=<DATADOG_API_KEY> stable/datadog
```
By default, this Chart creates a Secret and puts an API key in that Secret.
However, you can use manually created secret by setting the `datadog.apiKeyExistingSecret` value. After a few minutes, you should see hosts and metrics being reported in Datadog.
labels:
io.cattle.role: cluster # options are cluster/project
rancher_min_version: 2.3.0
questions:
#image configurations
- variable: defaultImage
default: true
description: "Use default Datadog image or specify a custom one"
label: Use Default Datadog Image
type: boolean
show_subquestion_if: false
group: "Container Images"
subquestions:
- variable: image.repository
default: "ranchercharts/datadog-agent"
description: "Datadog image name"
type: string
label: Datadog Image Name
- variable: image.tag
default: "6.13.0"
description: "Datadog Image Tag"
type: string
label: Datadog Image Tag
- variable: clusterAgent.image.repository
default: "ranchercharts/datadog-cluster-agent"
description: "Datadog clusterAgent image name"
type: string
label: Datadog ClusterAgent Image Name
- variable: clusterAgent.image.tag
default: "1.3.2"
description: "Datadog ClusterAgent Image Tag"
type: string
label: Datadog ClusterAgent Image Tag
- variable: kube-state-metrics.image.repository
default: "ranchercharts/coreos-kube-state-metrics"
description: "KubeState image name"
type: string
label: KubeState Image Name
show_if: "kubeStateMetrics.enabled=true&&defaultImage=false"
- variable: kube-state-metrics.image.tag
default: "v1.7.2"
description: "KubeState Image Tag"
type: string
label: KubeState Image Tag
show_if: "kubeStateMetrics.enabled=true&&defaultImage=false"
#cluster agent configurations
- variable: clusterAgent.enabled
default: false
description: "Use the cluster-agent for cluster metrics (Kubernetes 1.10+ only), https://docs.datadoghq.com/agent/kubernetes/cluster/"
type: boolean
label: Enable Cluster Agent Metrics(Kubernetes 1.10+ only)
group: "Cluster Agent"
- variable: clusterAgent.metricsProvider.enabled
default: true
description: "Enable the metricsProvider to be able to scale based on metrics in Datadog"
type: boolean
label: Enable the metricsProvider
show_if: "clusterAgent.enabled=true"
group: "Cluster Agent"
- variable: datadog.appKey
default: ""
description: "Datadog App key required to use metricsProvider"
type: string
required: true
label: Datadog Metrics App Key
group: "Cluster Agent"
show_if: "clusterAgent.enabled=true&&clusterAgent.metricsProvider.enabled=true&&datadog.appKeyExistingSecret="
- variable: datadog.appKeyExistingSecret
default: ""
description: "If set, use the secret with a provided name instead of creating a new appKey secret."
type: secret
label: Select Existing Datadog App Key(Secret)
group: "Cluster Agent"
show_if: "clusterAgent.enabled=true&&clusterAgent.metricsProvider.enabled=true&&datadog.appKey="
#datadog agent configurations
- variable: datadog.apiKey
default: ""
description: "Enter your Datadog API Key."
type: string
label: Datadog API Key
group: "Agent Configuration"
required: true
show_if: "datadog.apiKeyExistingSecret="
- variable: datadog.apiKeyExistingSecret
default: ""
description: "If set, use the secret with a provided name instead of creating a new apiKey secret."
type: secret
label: Select Existing Datadog API Key(Secret)
group: "Agent Configuration"
show_if: "datadog.apiKey="
- variable: datadog.site
default: "datadoghq.com"
description: "The site of the Datadog intake to send Agent data to"
type: enum
label: Datadog Site URL
group: "Agent Configuration"
required: true
options:
- "datadoghq.com"
- "datadoghq.eu"
- "custom"
- variable: datadog.dd_url
required: true
default: ""
description: "The host of the Datadog intake server to send Agent data to, only set this option if you need the Agent to send data to a custom URL"
type: string
label: Datadog Custom Site URL
group: "Agent Configuration"
show_if: "datadog.site=custom"
- variable: datadog.logLevel
default: "warn"
description: "Set Agent logging verbosity"
type: enum
options:
- "trace"
- "debug"
- "info"
- "warn"
- "error"
- "critical"
- "off"
label: Log Level
group: "Agent Configuration"
- variable: datadog.tags
default: ""
description: "Host tags, separated by spaces. For example: 'simple-tag-0 tag-key-1:tag-value-1'"
type: string
label: Host Tags
group: "Agent Configuration"
- variable: datadog.useCriSocketVolume
default: true
description: "Enable container runtime socket volume mounting"
type: boolean
label: Enable Mounting The Container Runtime Socket In Agent Containers
group: "Agent Configuration"
- variable: datadog.criSocketPath
default: ""
description: "Path to the container runtime socket (if different from Docker), default to `/var/run/docker.sock`"
type: string
label: Path To The Container Runtime Socket(Optional)
group: "Agent Configuration"
show_if: "datadog.useCriSocketVolume=true"
- variable: datadog.nonLocalTraffic
default: false
description: "Whether DogStatsD should listen to non local UDP traffic, required to send custom metrics"
type: boolean
label: DogStatsD Non-Local Traffic
group: "Agent Configuration"
- variable: datadog.collectEvents
default: false
description: "Enable event collection from the kubernetes API"
type: boolean
label: Collect Events
group: "Agent Configuration"
# Datadog Tagging
- variable: datadog.podLabelsAsTags
default: ""
description: "Specify a JSON map, where the map key is the source label name and the map value the datadog tag name. E.g: '{\"app\":\"kube_app\",\"release\":\"helm_release\"}'"
type: string
label: Extract Pod Labels as Tags
group: "Datadog Tagging"
- variable: datadog.podAnnotationsAsTags
default: ""
description: "Specify a JSON map, where the map key is the source label name and the map value the datadog tag name. E.g: '{\"app\":\"kube_app\",\"release\":\"helm_release\"}'"
type: string
label: Extract Pod Annotations as Tags
group: "Datadog Tagging"
- variable: datadog.nodeLabelsAsTags
default: ""
description: "Specify a JSON map, where the map key is the source label name and the map value the datadog tag name. E.g: '{\"app\":\"kube_app\",\"release\":\"helm_release\"}'"
type: string
label: Extract Node Labels As Tags
group: "Datadog Tagging"
# DaemonSet configurations
- variable: daemonset.rkeETCDControlPlane
default: true
description: "Configure Datadog Agent pods with the required tolerations to be deployed on the RKE etcd and control plane."
type: boolean
label: Run datadog pod on RKE Control Plane Nodes
group: "Daemonset Configuration"
- variable: daemonset.useHostNetwork
default: false
description: "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"
type: boolean
label: Use HostNetwork
group: "Daemonset Configuration"
- variable: daemonset.useHostPort
default: false
description: "Sets the hostPort to the same value of the container port"
type: boolean
label: Use HostPort
group: "Daemonset Configuration"
- variable: daemonset.useHostPID
default: false
description: "Run the agent in the host's PID namespace"
type: boolean
label: Use HostPID
group: "Daemonset Configuration"
#proxy configurations
- variable: datadog.httpProxy
default: ""
description: "An http URL to use as a proxy for http requests"
type: string
label: Datadog Proxy for HTTP Requests
group: "Proxy Configuration"
- variable: datadog.httpsProxy
default: ""
description: "An http URL to use as a proxy for https requests"
type: string
label: Datadog Proxy for HTTPS Requests
group: "Proxy Configuration"
- variable: datadog.noProxy
default: ""
description: "a space-separated list of URLs for which no proxy should be used"
type: string
label: Datadog No-Proxy List(separated by a space)
group: "Proxy Configuration"
# Optional Collection agents
- variable: datadog.apmEnabled
default: false
description: "Run the trace-agent along with the infrastructure agent, allowing the container to accept traces on 8126/tcp"
type: boolean
label: Enable APM
group: "Optional Collection Agents"
- variable: datadog.apmNonLocalTraffic
default: false
description: "Allow non-local traffic when tracing from other containers"
type: boolean
label: Allow APM Non-local Traffic
group: "Optional Collection Agents"
- variable: datadog.processAgentEnabled
default: false
description: "Enable live process collection in the process-agent"
type: boolean
label: Enable Live Process Agent
group: "Optional Collection Agents"
- variable: datadog.logsEnabled
default: false
description: "Run the log-agent along with the infrastructure agent"
type: boolean
label: Collect Logs
group: "Optional Collection Agents"
#Kube State Metrics
- variable: kubeStateMetrics.enabled
default: true
description: "Create a kube-state-metrics deployment"
type: boolean
label: Deployment KubeState Metrics Deployment
group: "Kube-State-Metrics"
dependencies:
- name: kube-state-metrics
repository: https://kubernetes-charts.storage.googleapis.com/
version: 2.2.3
digest: sha256:28fd41002af09316b9f614d320ea4171db39a144b595c68f616c546dd5292709
generated: "2019-08-13T09:53:34.977562+02:00"
dependencies:
- name: kube-state-metrics
version: ~2.2.3
repository: https://kubernetes-charts.storage.googleapis.com/
condition: kubeStateMetrics.enabled
{{- if (or (.Values.datadog.apiKeyExistingSecret) (.Values.datadog.apiKey)) }}
DataDog agents are spinning up on each node in your cluster. After a few
minutes, you should see your agents starting in your event stream:
https://app.datadoghq.com/event/stream
{{- if .Values.datadog.apiKeyExistingSecret }}
You disabled creation of Secret containing API key, therefore it is expected
that you create Secret named '{{ .Values.datadog.apiKeyExistingSecret }}' which includes a key called 'api-key' containing the API key.
{{- else if (.Values.datadog.apiKey) }}
{{- end }}
{{- else }}
##############################################################################
#### ERROR: You did not set a datadog.apiKey. ####
##############################################################################
This deployment will be incomplete until you get your API key from Datadog.
One can sign up for a free Datadog trial at https://app.datadoghq.com/signup
Once registered you can request an API key at:
https://app.datadoghq.com/account/settings#agent/kubernetes
Then run:
helm upgrade {{ .Release.Name }} \
--set datadog.apiKey=YOUR-KEY-HERE stable/datadog
{{- end }}
{{- if .Values.clusterAgent.enabled }}
{{- if .Values.clusterAgent.metricsProvider.enabled }}
{{- if .Values.datadog.appKeyExistingSecret }}
You disabled creation of Secret containing APP key, therefore it is expected
that you create a Secret named '{{ .Values.datadog.appKeyExistingSecret }}' which includes a key called 'app-key' containing the APP key.
{{- else if (.Values.datadog.appKey) }}
{{- else }}
##############################################################################
#### ERROR: You did not set a datadog.appKey. ####
##############################################################################
This deployment will be incomplete until you get your APP key from Datadog.
Create an application key at https://app.datadoghq.com/account/settings#api
{{- end }}
{{- end }}
{{- if and (not .Values.clusterAgent.token) (not .Values.clusterAgent.tokenExistingSecret) }}
##############################################################################
#### INFO: You did not set a clusterAgent.token ####
##############################################################################
Because you enabled the Cluster Agent but did not either provide a token or a reference to an existing token via '{{ .Values.clusterAgent.tokenExistingSecret }}', a random token was generated.
This token is used to secure the communication between the Agents and the Cluster Agent.
Make sure to recreate all pods on upgrade (with the --recreate-pods flag) to ensure all
agents use the same shared token.
{{- end }}
{{- end }}
{{- if .Values.datadog.apmEnabled }}
The datadog agent is listening on port 8126.
{{- end }}
{{- if (and (.Values.daemonset.enabled) (.Values.deployment.enabled)) }}
#################################################################
#### WARNING: Deprecation notice ####
#################################################################
Simultaneous DaemonSet + Deployment installation within a single
release will be deprecated in a future version. You will still be
able to run both as separate releases with separate value files.
Running as a Deployment is not necessary for event collection
anymore, thanks to the leader election feature.
We encourage you to migrate to a single DaemonSet, or split your
chart if your use case still requires a separate Deployment.
{{- end }}
{{- if .Values.datadog.autoconf }}
#################################################################
#### WARNING: Deprecation notice ####
#################################################################
The autoconf value is deprecated, Autodiscovery templates can now
be safely moved to the confd value. As a temporary measure, both
values were merged into the {{ template "datadog.fullname" . }}-confd configmap,
but this will be removed in a future chart release.
Please note that duplicate file names may have conflicted during
the merge. In that case, the confd entry will take precedence.
{{- end }}
{{- if eq .Values.image.repository "datadog/docker-dd-agent" }}
######################################################################
#### ERROR: Unsupported agent version ####
######################################################################
This version of the chart does not support deploying Agent 5.x.
If you cannot upgrade to Agent 6.x, you can use a previous version
of the chart by calling helm install with `--version 0.18.0`.
{{- end }}
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "datadog.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
And depending on the resources the name is completed with an extension.
If release name contains chart name it will be used as a full name.
*/}}
{{- define "datadog.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "datadog.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Return secret name to be used based on provided values.
*/}}
{{- define "datadog.apiSecretName" -}}
{{- $fullName := include "datadog.fullname" . -}}
{{- default $fullName .Values.datadog.apiKeyExistingSecret | quote -}}
{{- end -}}
{{/*
Return secret name to be used based on provided values.
*/}}
{{- define "datadog.appKeySecretName" -}}
{{- $fullName := printf "%s-appkey" (include "datadog.fullname" .) -}}
{{- default $fullName .Values.datadog.appKeyExistingSecret | quote -}}
{{- end -}}
{{/*
Return secret name to be used based on provided values.
*/}}
{{- define "clusterAgent.tokenSecretName" -}}
{{- if not .Values.clusterAgent.tokenExistingSecret -}}
{{- include "datadog.fullname" . -}}-cluster-agent
{{- else -}}
{{- .Values.clusterAgent.tokenExistingSecret -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for RBAC APIs.
*/}}
{{- define "rbac.apiVersion" -}}
{{- if semverCompare "^1.8-0" .Capabilities.KubeVersion.GitVersion -}}
"rbac.authorization.k8s.io/v1"
{{- else -}}
"rbac.authorization.k8s.io/v1beta1"
{{- end -}}
{{- end -}}
{{- if and .Values.rbac.create .Values.clusterAgent.enabled .Values.clusterAgent.metricsProvider.enabled -}}
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1beta1.external.metrics.k8s.io
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
spec:
service:
name: {{ template "datadog.fullname" . }}-cluster-agent-metrics-api
namespace: {{ .Release.Namespace }}
version: v1beta1
insecureSkipTLSVerify: true
group: external.metrics.k8s.io
groupPriorityMinimum: 100
versionPriority: 100
{{- end -}}
{{- if and .Values.clusterAgent.enabled .Values.clusterAgent.clusterChecks.enabled .Values.clusterchecksDeployment.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "datadog.fullname" . }}-clusterchecks
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
selector:
matchLabels:
app: {{ template "datadog.fullname" . }}-clusterchecks
replicas: {{ .Values.clusterchecksDeployment.replicas }}
template:
metadata:
labels:
app: {{ template "datadog.fullname" . }}-clusterchecks
name: {{ template "datadog.fullname" . }}-clusterchecks
spec:
{{- if .Values.clusterchecksDeployment.rbac.dedicated }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "datadog.fullname" . }}-cluster-checks{{ else }}"{{ .Values.clusterchecksDeployment.rbac.serviceAccountName }}"{{ end }}
{{- else }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "datadog.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
{{- end }}
containers:
- name: {{ default .Chart.Name .Values.datadog.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.apiSecretName" . }}
key: api-key
- name: DD_EXTRA_CONFIG_PROVIDERS
value: "clusterchecks"
- {name: DD_HEALTH_PORT, value: "5555"}
# Cluster checks
- name: DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME
value: {{ template "datadog.fullname" . }}-cluster-agent
- name: DD_CLUSTER_AGENT_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "clusterAgent.tokenSecretName" . }}
key: token
- name: DD_CLUSTER_AGENT_ENABLED
value: {{ .Values.clusterAgent.enabled | quote }}
- {name: DD_EXTRA_CONFIG_PROVIDERS, value: "clusterchecks"}
# Remove unused features
- {name: DD_APM_ENABLED, value: "false"}
- {name: DD_PROCESS_AGENT_ENABLED, value: "false"}
- {name: DD_LOGS_ENABLED, value: "false"}
# Safely run alongside the daemonset
- {name: DD_ENABLE_METADATA_COLLECTION, value: "false"}
- name: DD_HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- if .Values.clusterchecksDeployment.env }}
{{ toYaml .Values.clusterchecksDeployment.env | indent 10 }}
{{- end }}
resources:
{{ toYaml .Values.clusterchecksDeployment.resources | indent 10 }}
volumeMounts:
- {name: s6-run, mountPath: /var/run/s6}
- {name: remove-corechecks, mountPath: /etc/datadog-agent/conf.d}
{{- if .Values.clusterchecksDeployment.livenessProbe }}
livenessProbe:
{{ toYaml .Values.clusterchecksDeployment.livenessProbe | indent 10 }}
{{- else }}
livenessProbe:
httpGet:
path: /health
port: 5555
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
{{- end }}
volumes:
- {name: s6-run, emptyDir: {}}
- {name: remove-corechecks, emptyDir: {}}
affinity:
{{- if .Values.clusterchecksDeployment.affinity }}
{{ toYaml .Values.clusterchecksDeployment.affinity | indent 8 }}
{{- else }}
# Ensure we only run one worker per node, to avoid name collisions
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: {{ template "datadog.fullname" . }}-clusterchecks
topologyKey: kubernetes.io/hostname
{{- end }}
{{- if .Values.clusterchecksDeployment.nodeSelector }}
nodeSelector:
{{ toYaml .Values.clusterchecksDeployment.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.clusterchecksDeployment.tolerations }}
tolerations:
{{ toYaml .Values.clusterchecksDeployment.tolerations | indent 8 }}
{{- end }}
{{ end }}
{{- if and .Values.rbac.create .Values.clusterAgent.enabled .Values.clusterAgent.clusterChecks.enabled .Values.clusterchecksDeployment.enabled -}}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: {{ template "datadog.fullname" . }}-cluster-checks
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "datadog.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-checks
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}-cluster-checks
{{- end -}}
{{- if and .Values.rbac.create .Values.clusterAgent.enabled -}}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRole
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent
rules:
- apiGroups:
- ""
resources:
- services
- events
- endpoints
- pods
- nodes
- componentstatuses
verbs:
- get
- list
- watch
- apiGroups: ["quota.openshift.io"]
resources:
- clusterresourcequotas
verbs:
- get
- list
- apiGroups:
- "autoscaling"
resources:
- horizontalpodautoscalers
verbs:
- list
- watch
{{- if .Values.datadog.collectEvents }}
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- datadogtoken # Kubernetes event collection state
verbs:
- get
- update
{{- end }}
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- datadog-leader-election # Leader election token
{{- if .Values.clusterAgent.metricsProvider.enabled }}
- datadog-custom-metrics
- extension-apiserver-authentication
{{- end }}
verbs:
- get
- update
- apiGroups: # To create the leader election token
- ""
resources:
- configmaps
verbs:
- create
- nonResourceURLs:
- "/version"
- "/healthz"
verbs:
- get
---
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "datadog.fullname" . }}-cluster-agent
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-agent
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent
{{- end }}
{{- if and .Values.rbac.create .Values.clusterAgent.enabled .Values.clusterAgent.metricsProvider.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent:system:auth-delegator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-agent
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- if not .Values.clusterAgent.tokenExistingSecret }}
{{- if .Values.clusterAgent.enabled -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "datadog.fullname" . }}-cluster-agent
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
type: Opaque
data:
{{ if .Values.clusterAgent.token -}}
token: {{ .Values.clusterAgent.token | b64enc | quote }}
{{ else -}}
token: {{ randAlphaNum 32 | b64enc | quote }}
{{ end }}
{{- end }}
{{ end }}
\ No newline at end of file
{{- if .Values.clusterAgent.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "datadog.fullname" . }}-cluster-agent
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
type: ClusterIP
selector:
app: {{ template "datadog.fullname" . }}-cluster-agent
ports:
- port: 5005
name: agentport
protocol: TCP
{{ end }}
{{- if and .Values.clusterAgent.enabled .Values.clusterAgent.metricsProvider.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "datadog.fullname" . }}-cluster-agent-metrics-api
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
type: ClusterIP
selector:
app: {{ template "datadog.fullname" . }}-cluster-agent
ports:
- port: 443
name: metricsapi
protocol: TCP
{{ end }}
{{- if .Values.datadog.checksd }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "datadog.fullname" . }}-checksd
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
annotations:
checksum/checksd-config: {{ tpl (toYaml .Values.datadog.checksd) . | sha256sum }}
data:
{{ tpl (toYaml .Values.datadog.checksd) . | indent 2 }}
{{- end -}}
{{- if .Values.clusterAgent.confd }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "datadog.fullname" . }}-cluster-agent-confd
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
annotations:
checksum/confd-config: {{ tpl (toYaml .Values.clusterAgent.confd) . | sha256sum }}
data:
{{ tpl (toYaml .Values.clusterAgent.confd) . | indent 2 }}
{{- end -}}
{{- if .Values.clusterAgent.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "datadog.fullname" . }}-cluster-agent
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
replicas: {{ .Values.clusterAgent.replicas }}
selector:
matchLabels:
app: {{ template "datadog.fullname" . }}-cluster-agent
release: {{ .Release.Name | quote }}
template:
metadata:
labels:
app: {{ template "datadog.fullname" . }}-cluster-agent
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent
annotations:
ad.datadoghq.com/{{ .Values.clusterAgent.containerName }}.check_names: '["prometheus"]'
ad.datadoghq.com/{{ .Values.clusterAgent.containerName }}.init_configs: '[{}]'
ad.datadoghq.com/{{ .Values.clusterAgent.containerName }}.instances: |
[{
"prometheus_url": "http://%%host%%:5000/metrics",
"namespace": "datadog.cluster_agent",
"metrics": [
"go_goroutines", "go_memstats_*", "process_*",
"api_requests",
"datadog_requests", "external_metrics",
"cluster_checks_*"
]
}]
{{- if .Values.clusterAgent.podAnnotations }}
{{ toYaml .Values.clusterAgent.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- if .Values.clusterAgent.priorityClassName }}
priorityClassName: "{{ .Values.clusterAgent.priorityClassName }}"
{{- end }}
{{- if .Values.clusterAgent.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.clusterAgent.image.pullSecrets | indent 8 }}
{{- end }}
containers:
- name: {{ .Values.clusterAgent.containerName }}
image: "{{ .Values.clusterAgent.image.repository }}:{{ .Values.clusterAgent.image.tag }}"
imagePullPolicy: {{ .Values.clusterAgent.image.pullPolicy }}
resources:
{{ toYaml .Values.clusterAgent.resources | indent 10 }}
ports:
- containerPort: 5005
name: agentport
protocol: TCP
{{- if .Values.clusterAgent.metricsProvider.enabled }}
- containerPort: 443
name: metricsapi
protocol: TCP
{{- end }}
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.apiSecretName" . }}
key: api-key
{{- if .Values.clusterAgent.metricsProvider.enabled }}
- name: DD_EXTERNAL_METRICS_PROVIDER_ENABLED
value: {{ .Values.clusterAgent.metricsProvider.enabled | quote }}
- name: DD_APP_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.appKeySecretName" . }}
key: app-key
{{- end }}
{{- if .Values.clusterAgent.clusterChecks.enabled }}
- name: DD_CLUSTER_CHECKS_ENABLED
value: {{ .Values.clusterAgent.clusterChecks.enabled | quote }}
- name: DD_EXTRA_CONFIG_PROVIDERS
value: "kube_services"
- name: DD_EXTRA_LISTENERS
value: "kube_services"
{{- end }}
{{- if .Values.datadog.clusterName }}
- name: DD_CLUSTER_NAME
value: {{ .Values.datadog.clusterName | quote }}
{{- end }}
{{- if .Values.datadog.site }}
- name: DD_SITE
value: {{ .Values.datadog.site | quote }}
{{- end }}
{{- if .Values.datadog.dd_url }}
- name: DD_DD_URL
value: {{ .Values.datadog.dd_url | quote }}
{{- end }}
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.datadog.logLevel | quote }}
{{- end }}
- name: DD_LEADER_ELECTION
value: {{ .Values.datadog.leaderElection | default "true" | quote}}
{{- if .Values.datadog.leaderLeaseDuration }}
- name: DD_LEADER_LEASE_DURATION
value: {{ .Values.datadog.leaderLeaseDuration | quote }}
{{- else if .Values.clusterAgent.clusterChecks.enabled }}
- name: DD_LEADER_LEASE_DURATION
value: "15"
{{- end }}
{{- if .Values.datadog.collectEvents }}
- name: DD_COLLECT_KUBERNETES_EVENTS
value: {{ .Values.datadog.collectEvents | quote}}
- name: DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME
value: {{ template "datadog.fullname" . }}-cluster-agent
{{- end }}
- name: DD_CLUSTER_AGENT_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "clusterAgent.tokenSecretName" . }}
key: token
- name: DD_KUBE_RESOURCES_NAMESPACE
value: {{ .Release.Namespace }}
{{- if .Values.clusterAgent.env }}
{{ toYaml .Values.clusterAgent.env | indent 10 }}
{{- end }}
{{- if .Values.clusterAgent.livenessProbe }}
livenessProbe:
{{ toYaml .Values.clusterAgent.livenessProbe | indent 10 }}
{{- else if .Values.clusterAgent.metricsProvider.enabled }}
livenessProbe:
httpGet:
port: 443
path: /healthz
scheme: HTTPS
{{- end }}
{{- if .Values.clusterAgent.readinessProbe }}
readinessProbe:
{{ toYaml .Values.clusterAgent.readinessProbe | indent 10 }}
{{- else if .Values.clusterAgent.metricsProvider.enabled}}
readinessProbe:
httpGet:
port: 443
path: /healthz
scheme: HTTPS
{{- end }}
{{- if .Values.clusterAgent.confd }}
volumeMounts:
- name: confd
mountPath: /conf.d
readOnly: true
volumes:
- name: confd
configMap:
name: {{ template "datadog.fullname" . }}-cluster-agent-confd
{{- end }}
{{- if .Values.clusterAgent.tolerations }}
tolerations:
{{ toYaml .Values.clusterAgent.tolerations | indent 8 }}
{{- end }}
{{- if .Values.clusterAgent.affinity }}
affinity:
{{ toYaml .Values.clusterAgent.affinity | indent 8 }}
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "datadog.fullname" . }}-cluster-agent{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
{{ end }}
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "datadog.fullname" . }}-confd
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
annotations:
checksum/confd-config: {{ tpl (toYaml .Values.datadog.confd) . | sha256sum }}
checksum/autoconf-config: {{ tpl (toYaml .Values.datadog.autoconf) . | sha256sum }}
data:
{{/*
Merge the legacy autoconf dict before so confd static configurations
override duplicates
*/}}
{{- if .Values.datadog.autoconf }}
{{ tpl (toYaml .Values.datadog.autoconf) . | indent 2 }}
{{- end }}
{{- if .Values.datadog.confd }}
{{ tpl (toYaml .Values.datadog.confd) . | indent 2 }}
{{- end }}
{{- end -}}
{{- define "container-agent" -}}
- name: agent
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["agent", "start"]
resources:
{{ toYaml .Values.daemonset.containers.agent.resources | indent 4 }}
ports:
- containerPort: 8125
{{- if .Values.daemonset.useHostPort }}
hostPort: 8125
{{- end }}
name: dogstatsdport
protocol: UDP
env:
{{- include "containers-common-env" . | nindent 4 }}
{{- if .Values.datadog.clusterName }}
- name: DD_CLUSTER_NAME
value: {{ .Values.datadog.clusterName | quote }}
{{- end }}
{{- if .Values.datadog.site }}
- name: DD_SITE
value: {{ .Values.datadog.site | quote }}
{{- end }}
{{- if .Values.datadog.dd_url }}
- name: DD_DD_URL
value: {{ .Values.datadog.dd_url | quote }}
{{- end }}
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.daemonset.containers.agent.logLevel | default .Values.datadog.logLevel | quote }}
{{- end }}
{{- if .Values.datadog.nonLocalTraffic }}
- name: DD_DOGSTATSD_NON_LOCAL_TRAFFIC
value: {{ .Values.datadog.nonLocalTraffic | quote }}
{{- end }}
{{- if .Values.datadog.dogstatsdOriginDetection }}
- name: DD_DOGSTATSD_ORIGIN_DETECTION
value: {{ .Values.datadog.dogstatsdOriginDetection | quote }}
{{- end }}
{{- if .Values.datadog.acInclude }}
- name: DD_AC_INCLUDE
value: {{ .Values.datadog.acInclude | quote }}
{{- end }}
{{- if .Values.datadog.acExclude }}
- name: DD_AC_EXCLUDE
value: {{ .Values.datadog.acExclude | quote }}
{{- end }}
{{- if not .Values.clusterAgent.enabled }}
{{- if .Values.datadog.leaderElection }}
- name: DD_LEADER_ELECTION
value: {{ .Values.datadog.leaderElection | quote}}
{{- end }}
{{- if .Values.datadog.leaderLeaseDuration }}
- name: DD_LEADER_LEASE_DURATION
value: {{ .Values.datadog.leaderLeaseDuration | quote }}
{{- end }}
{{- if .Values.datadog.collectEvents }}
- name: DD_COLLECT_KUBERNETES_EVENTS
value: {{.Values.datadog.collectEvents | quote}}
{{- end }}
{{- else }}
- name: DD_CLUSTER_AGENT_ENABLED
value: {{ .Values.clusterAgent.enabled | quote }}
- name: DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME
value: {{ template "datadog.fullname" . }}-cluster-agent
- name: DD_CLUSTER_AGENT_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "clusterAgent.tokenSecretName" . }}
key: token
{{- end }}
{{- if .Values.datadog.podLabelsAsTags }}
- name: DD_KUBERNETES_POD_LABELS_AS_TAGS
value: '{{ toJson .Values.datadog.podLabelsAsTags }}'
{{- end }}
{{- if .Values.datadog.podAnnotationsAsTags }}
- name: DD_KUBERNETES_POD_ANNOTATIONS_AS_TAGS
value: '{{ toJson .Values.datadog.podAnnotationsAsTags }}'
{{- end }}
{{- if .Values.datadog.logsEnabled }}
- name: DD_LOGS_ENABLED
value: {{.Values.datadog.logsEnabled | quote}}
{{- end }}
{{- if .Values.datadog.logsConfigContainerCollectAll }}
- name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
value: {{.Values.datadog.logsConfigContainerCollectAll | quote}}
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: DD_CRI_SOCKET_PATH
value: {{ .Values.datadog.criSocketPath | quote }}
{{- end }}
{{- if not .Values.datadog.livenessProbe }}
- name: DD_HEALTH_PORT
value: "5555"
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: DD_DOGSTATSD_SOCKET
value: {{ default "/var/run/datadog/dsd.socket" .Values.datadog.dogStatsDSocketPath | quote }}
{{- end }}
{{- if and .Values.clusterAgent.clusterChecks.enabled (not .Values.clusterchecksDeployment.enabled) }}
- name: DD_EXTRA_CONFIG_PROVIDERS
value: "clusterchecks"
{{- end }}
{{- if .Values.datadog.httpProxy }}
- name: DD_PROXY_HTTP
value: {{ .Values.datadog.httpProxy | quote }}
{{- end }}
{{- if .Values.datadog.httpsProxy }}
- name: DD_PROXY_HTTPS
value: {{ .Values.datadog.httpsProxy | quote }}
{{- end }}
{{- if .Values.datadog.noProxy }}
- name: DD_PROXY_NO_PROXY
value: {{ .Values.datadog.noProxy | quote }}
{{- end }}
{{- if .Values.datadog.apmNonLocalTraffic }}
- name: DD_APM_NON_LOCAL_TRAFFIC
value: {{ .Values.datadog.apmNonLocalTraffic | quote }}
{{- end }}
{{- if .Values.daemonset.containers.agent.env }}
{{ toYaml .Values.daemonset.containers.agent.env | indent 4 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
{{- if .Values.datadog.useCriSocketVolume }}
- name: runtimesocket
mountPath: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
readOnly: true
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: dsdsocket
mountPath: "/var/run/datadog"
{{- end }}
- name: procdir
mountPath: /host/proc
readOnly: true
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
{{- if .Values.datadog.logsEnabled }}
- name: pointerdir
mountPath: /opt/datadog-agent/run
- name: logpodpath
mountPath: /var/log/pods
readOnly: true
{{- if .Values.datadog.containerLogsPath }}
- name: logcontainerpath
mountPath: {{ .Values.datadog.containerLogsPath | quote }}
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.datadog.volumeMounts }}
{{ toYaml .Values.datadog.volumeMounts | indent 4 }}
{{- end }}
{{- if .Values.datadog.livenessProbe }}
livenessProbe:
{{ toYaml .Values.datadog.livenessProbe | indent 4 }}
{{- else }}
livenessProbe:
httpGet:
path: /health
port: 5555
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
{{- end }}
{{- end -}}
{{- define "container-agents" -}}
- name: {{ default .Chart.Name .Values.datadog.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.datadog.resources | indent 4 }}
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
{{- end }}
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.apiSecretName" . }}
key: api-key
{{- if .Values.datadog.clusterName }}
- name: DD_CLUSTER_NAME
value: {{ .Values.datadog.clusterName | quote }}
{{- end }}
{{- if .Values.datadog.site }}
- name: DD_SITE
value: {{ .Values.datadog.site | quote }}
{{- end }}
{{- if .Values.datadog.dd_url }}
- name: DD_DD_URL
value: {{ .Values.datadog.dd_url | quote }}
{{- end }}
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.datadog.logLevel | quote }}
{{- end }}
{{- if .Values.datadog.nonLocalTraffic }}
- name: DD_DOGSTATSD_NON_LOCAL_TRAFFIC
value: {{ .Values.datadog.nonLocalTraffic | quote }}
{{- end }}
{{- if .Values.datadog.dogstatsdOriginDetection }}
- name: DD_DOGSTATSD_ORIGIN_DETECTION
value: {{ .Values.datadog.dogstatsdOriginDetection | quote }}
{{- end }}
{{- if .Values.datadog.tags }}
- name: DD_TAGS
value: {{ .Values.datadog.tags | quote }}
{{- end }}
{{- if .Values.datadog.apmEnabled }}
- name: DD_APM_ENABLED
value: {{ .Values.datadog.apmEnabled | quote }}
{{- end }}
{{- if .Values.datadog.processAgentEnabled }}
- name: DD_PROCESS_AGENT_ENABLED
value: {{ .Values.datadog.processAgentEnabled | quote }}
{{- end }}
{{- if .Values.datadog.hostname }}
- name: DD_HOSTNAME
value: {{ .Values.datadog.hostname | quote }}
{{- end }}
{{- if .Values.datadog.acInclude }}
- name: DD_AC_INCLUDE
value: {{ .Values.datadog.acInclude | quote }}
{{- end }}
{{- if .Values.datadog.acExclude }}
- name: DD_AC_EXCLUDE
value: {{ .Values.datadog.acExclude | quote }}
{{- end }}
{{- if not .Values.clusterAgent.enabled }}
{{- if .Values.datadog.leaderElection }}
- name: DD_LEADER_ELECTION
value: {{ .Values.datadog.leaderElection | quote}}
{{- end }}
{{- if .Values.datadog.leaderLeaseDuration }}
- name: DD_LEADER_LEASE_DURATION
value: {{ .Values.datadog.leaderLeaseDuration | quote }}
{{- end }}
{{- if .Values.datadog.collectEvents }}
- name: DD_COLLECT_KUBERNETES_EVENTS
value: {{.Values.datadog.collectEvents | quote}}
{{- end }}
{{- else }}
- name: DD_CLUSTER_AGENT_ENABLED
value: {{ .Values.clusterAgent.enabled | quote }}
- name: DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME
value: {{ template "datadog.fullname" . }}-cluster-agent
- name: DD_CLUSTER_AGENT_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "clusterAgent.tokenSecretName" . }}
key: token
{{- end }}
- name: KUBERNETES
value: "yes"
{{- if .Values.datadog.podLabelsAsTags }}
- name: DD_KUBERNETES_POD_LABELS_AS_TAGS
value: '{{ toJson .Values.datadog.podLabelsAsTags }}'
{{- end }}
{{- if .Values.datadog.podAnnotationsAsTags }}
- name: DD_KUBERNETES_POD_ANNOTATIONS_AS_TAGS
value: '{{ toJson .Values.datadog.podAnnotationsAsTags }}'
{{- end }}
{{- if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion }}
- name: DD_KUBERNETES_KUBELET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end }}
{{- if .Values.datadog.logsEnabled }}
- name: DD_LOGS_ENABLED
value: {{.Values.datadog.logsEnabled | quote}}
{{- end }}
{{- if .Values.datadog.logsConfigContainerCollectAll }}
- name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
value: {{.Values.datadog.logsConfigContainerCollectAll | quote}}
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: DD_CRI_SOCKET_PATH
value: {{ .Values.datadog.criSocketPath | quote }}
{{- end }}
{{- if not .Values.datadog.livenessProbe }}
- name: DD_HEALTH_PORT
value: "5555"
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: DD_DOGSTATSD_SOCKET
value: {{ default "/var/run/datadog/dsd.socket" .Values.datadog.dogStatsDSocketPath | quote }}
{{- end }}
{{- if and .Values.clusterAgent.clusterChecks.enabled (not .Values.clusterchecksDeployment.enabled) }}
- name: DD_EXTRA_CONFIG_PROVIDERS
value: "clusterchecks"
{{- end }}
{{- if .Values.datadog.httpProxy }}
- name: DD_PROXY_HTTP
value: {{ .Values.datadog.httpProxy | quote }}
{{- end }}
{{- if .Values.datadog.httpsProxy }}
- name: DD_PROXY_HTTPS
value: {{ .Values.datadog.httpsProxy | quote }}
{{- end }}
{{- if .Values.datadog.noProxy }}
- name: DD_PROXY_NO_PROXY
value: {{ .Values.datadog.noProxy | quote }}
{{- end }}
{{- if .Values.datadog.apmNonLocalTraffic }}
- name: DD_APM_NON_LOCAL_TRAFFIC
value: {{ .Values.datadog.apmNonLocalTraffic | quote }}
{{- end }}
{{- if .Values.datadog.env }}
{{ toYaml .Values.datadog.env | indent 4 }}
{{- end }}
volumeMounts:
{{- if .Values.datadog.useCriSocketVolume }}
- name: runtimesocket
mountPath: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
readOnly: true
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: dsdsocket
mountPath: "/var/run/datadog"
{{- end }}
- name: procdir
mountPath: /host/proc
readOnly: true
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
- name: s6-run
mountPath: /var/run/s6
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
- name: confd
mountPath: /conf.d
readOnly: true
{{- end }}
{{- if .Values.datadog.checksd }}
- name: checksd
mountPath: /checks.d
readOnly: true
{{- end }}
{{- if .Values.datadog.logsEnabled }}
- name: pointerdir
mountPath: /opt/datadog-agent/run
- name: logpodpath
mountPath: /var/log/pods
readOnly: true
{{- if .Values.datadog.containerLogsPath }}
- name: logcontainerpath
mountPath: {{ .Values.datadog.containerLogsPath | quote }}
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.datadog.processAgentEnabled }}
- name: passwd
mountPath: /etc/passwd
readOnly: true
{{- end }}
{{- if .Values.daemonset.useConfigMap }}
- name: {{ template "datadog.fullname" . }}-datadog-yaml
mountPath: /etc/datadog-agent/datadog.yaml
subPath: datadog.yaml
{{- end }}
{{- if .Values.datadog.volumeMounts }}
{{ toYaml .Values.datadog.volumeMounts | indent 4 }}
{{- end }}
{{- if .Values.datadog.livenessProbe }}
livenessProbe:
{{ toYaml .Values.datadog.livenessProbe | indent 4 }}
{{- else }}
livenessProbe:
httpGet:
path: /health
port: 5555
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
{{- end }}
{{- end -}}
{{- define "container-process-agent" -}}
- name: process-agent
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["process-agent", "-config=/etc/datadog-agent/datadog.yaml"]
resources:
{{ toYaml .Values.daemonset.containers.processAgent.resources | indent 4 }}
env:
{{- include "containers-common-env" . | nindent 4 }}
- name: DD_PROCESS_AGENT_ENABLED
value: {{ .Values.datadog.processAgentEnabled | quote }}
- name: DD_LOG_LEVEL
value: {{ .Values.daemonset.containers.processAgent.logLevel | default .Values.datadog.logLevel | quote }}
{{- if .Values.daemonset.containers.processAgent.env }}
{{ toYaml .Values.daemonset.containers.processAgent.env | indent 4 }}
{{- end }}
volumeMounts:
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
- name: config
mountPath: /etc/datadog-agent
- name: passwd
mountPath: /etc/passwd
- name: procdir
mountPath: /host/proc
readOnly: true
{{- if .Values.datadog.useCriSocketVolume }}
- name: runtimesocket
mountPath: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
readOnly: true
{{- end }}
{{- end -}}
{{- define "container-trace-agent" -}}
- name: trace-agent
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["trace-agent", "--config=/etc/datadog-agent/datadog.yaml"]
resources:
{{ toYaml .Values.daemonset.containers.traceAgent.resources | indent 4 }}
ports:
- containerPort: 8126
{{- if .Values.daemonset.useHostPort }}
hostPort: 8126
{{- end }}
name: traceport
protocol: TCP
env:
{{- include "containers-common-env" . | nindent 4 }}
- name: DD_APM_ENABLED
value: {{ .Values.datadog.apmEnabled | quote }}
- name: DD_LOG_LEVEL
value: {{ .Values.daemonset.containers.traceAgent.logLevel | default .Values.datadog.logLevel | quote }}
{{- if .Values.daemonset.containers.traceAgent.env }}
{{ toYaml .Values.daemonset.containers.traceAgent.env | indent 4 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
livenessProbe:
tcpSocket:
port: 8126
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
{{- end -}}
# The purpose of this template is to define a minimal set of environment
# variables required to operate dedicated containers in the daemonset.
{{- define "containers-common-env" -}}
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.apiSecretName" . }}
key: api-key
{{- if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion }}
- name: DD_KUBERNETES_KUBELET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end }}
{{- if .Values.datadog.hostname }}
- name: DD_HOSTNAME
value: {{ .Values.datadog.hostname | quote }}
{{- end }}
{{- if .Values.datadog.tags }}
- name: DD_TAGS
value: {{ .Values.datadog.tags | quote }}
{{- end }}
- name: KUBERNETES
value: "yes"
{{- end -}}
{{- define "containers-init" -}}
- name: init-volume
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["bash", "-c"]
args:
- cp -r /etc/datadog-agent /opt
volumeMounts:
- name: config
mountPath: /opt/datadog-agent
- name: init-config
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["bash", "-c"]
args:
- for script in $(find /etc/cont-init.d/ -type f -name '*.sh' | sort) ; do bash $script ; done
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
- name: confd
mountPath: /conf.d
readOnly: true
{{- end }}
{{- if .Values.datadog.checksd }}
- name: checksd
mountPath: /checks.d
readOnly: true
{{- end }}
- name: procdir
mountPath: /host/proc
readOnly: true
{{- if .Values.datadog.useCriSocketVolume }}
- name: runtimesocket
mountPath: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
readOnly: true
{{- end }}
env:
{{- include "containers-common-env" . | nindent 4 }}
{{- if .Values.datadog.env }}
{{ toYaml .Values.datadog.env | nindent 4 }}
{{- end }}
{{- end -}}
{{- if .Values.daemonset.enabled }}
{{- if (or (.Values.datadog.apiKeyExistingSecret) (.Values.datadog.apiKey)) }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "datadog.fullname" . }}
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
selector:
matchLabels:
app: {{ template "datadog.fullname" . }}
template:
metadata:
labels:
app: {{ template "datadog.fullname" . }}
{{- if .Values.daemonset.podLabels }}
{{ toYaml .Values.daemonset.podLabels | indent 8 }}
{{- end }}
name: {{ template "datadog.fullname" . }}
annotations:
checksum/autoconf-config: {{ tpl (toYaml .Values.datadog.autoconf) . | sha256sum }}
checksum/confd-config: {{ tpl (toYaml .Values.datadog.confd) . | sha256sum }}
checksum/checksd-config: {{ tpl (toYaml .Values.datadog.checksd) . | sha256sum }}
{{- if .Values.daemonset.podAnnotations }}
{{ toYaml .Values.daemonset.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- if .Values.datadog.securityContext }}
securityContext:
{{ toYaml .Values.datadog.securityContext | indent 8 }}
{{- end }}
{{- if .Values.daemonset.useHostNetwork }}
hostNetwork: {{ .Values.daemonset.useHostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- if .Values.daemonset.useHostPID }}
hostPID: {{ .Values.daemonset.useHostPID }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 8 }}
{{- end }}
{{- if .Values.daemonset.priorityClassName }}
priorityClassName: {{ .Values.daemonset.priorityClassName }}
{{- end }}
containers:
{{- if .Values.daemonset.useDedicatedContainers }}
{{- include "container-agent" . | nindent 8 }}
{{- if .Values.datadog.apmEnabled }}
{{- include "container-trace-agent" . | nindent 8 }}
{{- end }}
{{- if .Values.datadog.processAgentEnabled }}
{{- include "container-process-agent" . | nindent 8 }}
{{- end }}
initContainers:
{{ include "containers-init" . | nindent 8 }}
{{- else }}
{{- include "container-agents" . | nindent 8 }}
{{- end}}
volumes:
{{- if .Values.daemonset.useDedicatedContainers }}
- name: config
emptyDir: {}
{{- end }}
{{- if .Values.datadog.useCriSocketVolume }}
- hostPath:
path: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
name: runtimesocket
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- hostPath:
path: "/var/run/datadog/"
name: dsdsocket
{{- end }}
- hostPath:
path: /proc
name: procdir
- hostPath:
path: /sys/fs/cgroup
name: cgroups
- name: s6-run
emptyDir: {}
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
- name: confd
configMap:
name: {{ template "datadog.fullname" . }}-confd
{{- end }}
{{- if .Values.datadog.checksd }}
- name: checksd
configMap:
name: {{ template "datadog.fullname" . }}-checksd
{{- end }}
{{- if .Values.datadog.logsEnabled }}
- hostPath:
path: {{ default "/var/lib/datadog-agent/logs" .Values.datadog.logsPointerHostPath | quote }}
name: pointerdir
- hostPath:
path: /var/log/pods
name: logpodpath
{{- if .Values.datadog.containerLogsPath }}
- hostPath:
path: {{ .Values.datadog.containerLogsPath | quote }}
name: logcontainerpath
{{- end }}
{{- end }}
{{- if .Values.datadog.processAgentEnabled }}
- hostPath:
path: /etc/passwd
name: passwd
{{- end }}
{{- if .Values.daemonset.useConfigMap }}
- name: {{ template "datadog.fullname" . }}-datadog-yaml
configMap:
name: {{ template "datadog.fullname" . }}-datadog-yaml
{{- end }}
{{- if .Values.datadog.volumes }}
{{ toYaml .Values.datadog.volumes | indent 8 }}
{{- end }}
{{- if .Values.daemonset.tolerations }}
tolerations:
{{- if .Values.daemonset.rkeETCDControlPlane }}
- key: "node-role.kubernetes.io/etcd"
value: "true"
- key: "node-role.kubernetes.io/controlplane"
value: "true"
{{- end }}
{{ toYaml .Values.daemonset.tolerations | indent 8 }}
{{- end }}
{{- if .Values.daemonset.affinity }}
affinity:
{{ toYaml .Values.daemonset.affinity | indent 8 }}
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "datadog.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
{{- if .Values.daemonset.nodeSelector }}
nodeSelector:
{{ toYaml .Values.daemonset.nodeSelector | indent 8 }}
{{- end }}
updateStrategy:
type: {{ default "RollingUpdate" .Values.daemonset.updateStrategy | quote }}
{{ end }}
{{ end }}
{{- if .Values.daemonset.useConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "datadog.fullname" . }}-datadog-yaml
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
annotations:
data:
datadog.yaml: |
## Provides autodetected defaults, for kubernetes environments,
## please see datadog.yaml.example for all supported options
# Autodiscovery for Kubernetes
listeners:
- name: kubelet
config_providers:
- name: kubelet
polling: true
# Enable APM by setting the DD_APM_ENABLED envvar to true, or override this configuration
apm_config:
enabled: false
apm_non_local_traffic: true
# Use java cgroup memory awareness
jmx_use_cgroup_memory_limit: true
{{- end }}
{{- if .Values.deployment.enabled }}
{{- if (or (.Values.datadog.apiKeyExistingSecret) (.Values.datadog.apiKey)) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "datadog.fullname" . }}
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
selector:
matchLabels:
app: {{ template "datadog.fullname" . }}
type: deployment
replicas: {{ .Values.deployment.replicas }}
template:
metadata:
labels:
app: {{ template "datadog.fullname" . }}
type: deployment
name: {{ template "datadog.fullname" . }}
annotations:
checksum/autoconf-config: {{ tpl (toYaml .Values.datadog.autoconf) . | sha256sum }}
checksum/confd-config: {{ tpl (toYaml .Values.datadog.confd) . | sha256sum }}
checksum/checksd-config: {{ tpl (toYaml .Values.datadog.checksd) . | sha256sum }}
spec:
{{- if .Values.datadog.securityContext }}
securityContext:
{{ toYaml .Values.datadog.securityContext | indent 8 }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 8 }}
{{- end }}
{{- if .Values.deployment.priorityClassName }}
priorityClassName: {{ .Values.deployment.priorityClassName }}
{{- end }}
containers:
- name: {{ default .Chart.Name .Values.datadog.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.datadog.resources | indent 10 }}
ports:
- containerPort: 8125
name: dogstatsdport
protocol: UDP
{{- if .Values.datadog.apmEnabled }}
- containerPort: 8126
name: traceport
protocol: TCP
{{- end }}
env:
- name: DD_API_KEY
valueFrom:
secretKeyRef:
name: {{ template "datadog.apiSecretName" . }}
key: api-key
{{- if .Values.datadog.site }}
- name: DD_SITE
value: {{ .Values.datadog.site | quote }}
{{- end }}
{{- if .Values.datadog.dd_url }}
- name: DD_DD_URL
value: {{ .Values.datadog.dd_url | quote }}
{{- end }}
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.datadog.logLevel | quote }}
{{- end }}
{{- if .Values.datadog.nonLocalTraffic }}
- name: DD_DOGSTATSD_NON_LOCAL_TRAFFIC
value: {{ .Values.datadog.nonLocalTraffic | quote }}
{{- end }}
{{- if .Values.datadog.dogstatsdOriginDetection }}
- name: DD_DOGSTATSD_ORIGIN_DETECTION
value: {{ .Values.datadog.dogstatsdOriginDetection | quote }}
{{- end }}
{{- if .Values.datadog.tags }}
- name: DD_TAGS
value: {{ .Values.datadog.tags | quote }}
{{- end }}
{{- if .Values.datadog.apmEnabled }}
- name: DD_APM_ENABLED
value: {{ .Values.datadog.apmEnabled | quote }}
{{- end }}
- name: KUBERNETES
value: "yes"
{{- if .Values.datadog.collectEvents }}
- name: KUBERNETES_COLLECT_EVENTS
value: "yes"
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: DD_CRI_SOCKET_PATH
value: {{ .Values.datadog.criSocketPath | quote }}
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: DD_DOGSTATSD_SOCKET
value: {{ default "/var/run/datadog/dsd.socket" .Values.datadog.dogStatsDSocketPath | quote }}
{{- end }}
{{- if .Values.datadog.env }}
{{ toYaml .Values.datadog.env | indent 10 }}
{{- end }}
volumeMounts:
{{- if .Values.datadog.useCriSocketVolume }}
- name: runtimesocket
mountPath: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
readOnly: true
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- name: dsdsocket
mountPath: "/var/run/datadog"
{{- end }}
- name: procdir
mountPath: /host/proc
readOnly: true
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
- name: confd
mountPath: /conf.d
readOnly: true
{{- end }}
{{- if .Values.datadog.checksd }}
- name: checksd
mountPath: /checks.d
readOnly: true
{{- end }}
{{- if .Values.datadog.volumeMounts }}
{{ toYaml .Values.datadog.volumeMounts | indent 10 }}
{{- end }}
{{- if .Values.datadog.livenessProbe }}
livenessProbe:
{{ toYaml .Values.datadog.livenessProbe | indent 10 }}
{{- else }}
livenessProbe:
exec:
command:
- ./probe.sh
initialDelaySeconds: 15
periodSeconds: 5
failureThreshold: 6
{{- end }}
volumes:
{{- if .Values.datadog.useCriSocketVolume }}
- hostPath:
path: {{ default "/var/run/docker.sock" .Values.datadog.criSocketPath | quote }}
name: runtimesocket
{{- end }}
{{- if .Values.datadog.useDogStatsDSocketVolume }}
- hostPath:
path: "/var/run/datadog/"
name: dsdsocket
{{- end }}
- hostPath:
path: /proc
name: procdir
- hostPath:
path: /sys/fs/cgroup
name: cgroups
{{- if (or (.Values.datadog.confd) (.Values.datadog.autoconf)) }}
- name: confd
configMap:
name: {{ template "datadog.fullname" . }}-confd
{{- end }}
{{- if .Values.datadog.checksd }}
- name: checksd
configMap:
name: {{ template "datadog.fullname" . }}-checksd
{{- end }}
{{- if .Values.datadog.volumes }}
{{ toYaml .Values.datadog.volumes | indent 8 }}
{{- end }}
{{- if .Values.deployment.tolerations }}
tolerations:
{{ toYaml .Values.deployment.tolerations | indent 8 }}
{{- end }}
{{- if .Values.deployment.affinity }}
affinity:
{{ toYaml .Values.deployment.affinity | indent 8 }}
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "datadog.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
{{ end }}
{{ end }}
{{- if and .Values.rbac.create .Values.clusterAgent.enabled .Values.clusterAgent.metricsProvider.enabled -}}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRole
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent-external-metrics-reader
rules:
- apiGroups:
- "external.metrics.k8s.io"
resources:
- "*"
verbs:
- list
- get
- watch
---
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: {{ template "datadog.fullname" . }}-cluster-agent-external-metrics-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "datadog.fullname" . }}-cluster-agent-external-metrics-reader
subjects:
- kind: ServiceAccount
name: horizontal-pod-autoscaler
namespace: kube-system
---
apiVersion: {{ template "rbac.apiVersion" . }}
kind: RoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: "{{ template "datadog.fullname" . }}-cluster-agent"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-agent
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- if .Values.rbac.create -}}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRole
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}
rules:
{{- if not .Values.clusterAgent.enabled }}
- apiGroups:
- ""
resources:
- services
- events
- endpoints
- pods
- nodes
- componentstatuses
verbs:
- get
- list
- watch
- apiGroups: ["quota.openshift.io"]
resources:
- clusterresourcequotas
verbs:
- get
- list
{{- if .Values.datadog.collectEvents }}
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- datadogtoken # Kubernetes event collection state
verbs:
- get
- update
{{- end }}
{{- if .Values.datadog.leaderElection }}
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- datadog-leader-election # Leader election token
verbs:
- get
- update
- apiGroups: # To create the leader election token
- ""
resources:
- configmaps
verbs:
- create
{{- end }}
- nonResourceURLs:
- "/version"
- "/healthz"
verbs:
- get
{{- end }}
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups: # Kubelet connectivity
- ""
resources:
- nodes/metrics
- nodes/spec
- nodes/proxy
verbs:
- get
- apiGroups: # leader election check
- ""
resources:
- endpoints
verbs:
- get
---
{{- if not .Values.clusterchecksDeployment.rbac.dedicated }}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
name: {{ template "datadog.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "datadog.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "datadog.fullname" . }}
{{- end -}}
# API Key
{{- if not .Values.datadog.apiKeyExistingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "datadog.fullname" . }}
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
type: Opaque
data:
api-key: {{ default "MISSING" .Values.datadog.apiKey | b64enc | quote }}
{{- end }}
# APP Key
{{- if not .Values.datadog.appKeyExistingSecret }}
{{- if and .Values.clusterAgent.enabled .Values.clusterAgent.metricsProvider.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "datadog.appKeySecretName" . }}
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
type: Opaque
data:
app-key: {{ default "MISSING" .Values.datadog.appKey | b64enc | quote }}
{{- end }}
{{- end }}
{{ if .Values.deployment.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "datadog.fullname" . }}
labels:
app: "{{ template "datadog.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
{{- if .Values.deployment.service.annotations }}
annotations:
{{ toYaml .Values.deployment.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.deployment.service.type }}
selector:
app: {{ template "datadog.fullname" . }}
type: deployment
ports:
- port: 8125
name: dogstatsdport
protocol: UDP
{{- if .Values.deployment.dogstatsdNodePort }}
nodePort: {{ .Values.deployment.dogstatsdNodePort }}
{{- end }}
{{- if .Values.datadog.apmEnabled }}
- port: 8126
name: traceport
protocol: TCP
{{- if .Values.deployment.traceNodePort }}
nodePort: {{ .Values.deployment.traceNodePort }}
{{- end }}
{{- end }}
{{ end }}
## Default values for Datadog Agent
## See Datadog helm documentation to learn more:
## https://docs.datadoghq.com/agent/kubernetes/helm/
## @param image - object - required
## Define the Datadog image to work with.
#
image:
## @param repository - string - required
## Define the repository to use:
## use "datadog/agent" for Datadog Agent 6
## use "datadog/dogstatsd" for Standalone Datadog Agent DogStatsD6
# repository: datadog/agent
repository: ranchercharts/datadog-agent
## @param tag - string - required
## Define the Agent version to use.
## Use 6.13.0-jmx to enable jmx fetch collection
#
tag: 6.13.0
## @param pullPolicy - string - required
## The Kubernetes pull policy.
#
pullPolicy: IfNotPresent
## @param pullSecrets - list of key:value strings - optional
## It is possible to specify docker registry credentials
## See https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
#
# pullSecrets:
# - name: "<REG_SECRET>"
nameOverride: ""
fullnameOverride: ""
datadog:
## @param apiKey - string - required
## Set this to your Datadog API key before the Agent runs.
## ref: https://app.datadoghq.com/account/settings#agent/kubernetes
#
apiKey: <DATADOG_API_KEY>
## @param apiKeyExistingSecret - string - optional
## Use existing Secret which stores API key instead of creating a new one.
## If set, this parameter takes precedence over "apiKey".
#
# apiKeyExistingSecret: <DATADOG_API_KEY_SECRET>
## @param appKey - string - optional
## If you are using clusterAgent.metricsProvider.enabled = true, you must set
## a Datadog application key for read access to your metrics.
#
# appKey: <DATADOG_APP_KEY>
## @param appKeyExistingSecret - string - optional
## Use existing Secret which stores APP key instead of creating a new one
## If set, this parameter takes precedence over "appKey".
#
# appKeyExistingSecret: <DATADOG_APP_KEY_SECRET>
## @param securityContext - object - optional
## You can modify the security context used to run the containers by
## modifying the label type below:
#
# securityContext:
# seLinuxOptions:
# seLinuxLabel: "spc_t"
## @param clusterName - string - optional
## Set a unique cluster name to allow scoping hosts and Cluster Checks easily
#
# clusterName: <CLUSTER_NAME>
## @param name - string - required
## Daemonset/Deployment container name
## See clusterAgent.containerName if clusterAgent.enabled = true
#
name: datadog
## @param site - string - optional - default: 'datadoghq.com'
## The site of the Datadog intake to send Agent data to.
## Set to 'datadoghq.eu' to send data to the EU site.
#
# site: datadoghq.com
## @param dd_url - string - optional - default: 'https://app.datadoghq.com'
## The host of the Datadog intake server to send Agent data to, only set this option
## if you need the Agent to send data to a custom URL.
## Overrides the site setting defined in "site".
#
# dd_url: https://app.datadoghq.com
## @param logLevel - string - required
## Set logging verbosity, valid log levels are:
## trace, debug, info, warn, error, critical, and off
#
logLevel: INFO
## @param podLabelsAsTags - list of key:value strings - optional
## Provide a mapping of Kubernetes Labels to Datadog Tags.
#
# podLabelsAsTags:
# app: kube_app
# release: helm_release
# <KUBERNETES_LABEL>: <DATADOG_TAG_KEY>
## @param podAnnotationsAsTags - list of key:value strings - optional
## Provide a mapping of Kubernetes Annotations to Datadog Tags
#
# podAnnotationsAsTags:
# iam.amazonaws.com/role: kube_iamrole
# <KUBERNETES_ANNOTATIONS>: <DATADOG_TAG_KEY>
## @param tags - list of key:value elements - optional
## List of tags to attach to every metric, event and service check collected by this Agent.
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>
## @param useCriSocketVolume - boolean - required
## Enable container runtime socket volume mounting
#
useCriSocketVolume: true
## @param dogstatsdOriginDetection - boolean - optional
## Enable origin detection for container tagging
## https://docs.datadoghq.com/developers/dogstatsd/unix_socket/#using-origin-detection-for-container-tagging
#
# dogstatsdOriginDetection: true
## @param useDogStatsDSocketVolume - boolean - optional
## Enable dogstatsd over Unix Domain Socket
## ref: https://docs.datadoghq.com/developers/dogstatsd/unix_socket/
#
# useDogStatsDSocketVolume: true
## @param nonLocalTraffic - boolean - optional - default: false
## Enable this to make each node accept non-local statsd traffic.
## ref: https://github.com/DataDog/docker-dd-agent#environment-variables
#
# nonLocalTraffic: false
## @param collectEvents - boolean - optional - default: false
## Enables this to start event collection from the kubernetes API
## ref: https://docs.datadoghq.com/agent/kubernetes/event_collection/
#
# collectEvents: false
## @param leaderElection - boolean - optional - default: false
## Enables leader election mechanism for event collection.
#
# leaderElection: false
## @param leaderLeaseDuration - integer - optional - default: 60
## Set the lease time for leader election in second.
#
# leaderLeaseDuration: 60
## @param logsEnabled - boolean - optional - default: false
## Enables this to activate Datadog Agent log collection.
## ref: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
#
# logsEnabled: false
## @param logsConfigContainerCollectAll - boolean - optional - default: false
## Enable this to allow log collection for all containers.
## ref: https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/#log-collection-setup
#
# logsConfigContainerCollectAll: false
## @param containerLogsPath - string - optional - default: /var/lib/docker/containers
## This to allow log collection from container log path. Set to a different path if not
## using docker runtime.
## ref: https://docs.datadoghq.com/agent/kubernetes/daemonset_setup/?tab=k8sfile#create-manifest
#
containerLogsPath: /var/lib/docker/containers
## @param apmEnabled - boolean - optional - default: false
## Enable this to enable APM and tracing, on port 8126
## ref: https://github.com/DataDog/docker-dd-agent#tracing-from-the-host
#
# apmEnabled: false
## @param processAgentEnabled - boolean - optional - default: false
## Enable this to activate live process monitoring.
## Note: /etc/passwd is automatically mounted to allow username resolution.
## ref: https://docs.datadoghq.com/graphing/infrastructure/process/#kubernetes-daemonset
#
# processAgentEnabled: false
## @param env - list of object - optional
## The dd-agent supports many environment variables
## ref: https://github.com/DataDog/datadog-agent/tree/master/Dockerfiles/agent#environment-variables
#
# env:
# - name: <ENV_VAR_NAME>
# value: <ENV_VAR_VALUE>
## @param volumes - list of objects - optional
## Specify additional volumes to mount in the dd-agent container
#
# volumes:
# - hostPath:
# path: <HOST_PATH>
# name: <VOLUME_NAME>
## @param volumeMounts - list of objects - optional
## Specify additional volumes to mount in the dd-agent container
#
# volumeMounts:
# - name: <VOLUME_NAME>
# mountPath: <CONTAINER_PATH>
# readOnly: true
## @param confd - list of objects - optional
## Provide additional check configurations (static and Autodiscovery)
## Each key becomes a file in /conf.d
## ref: https://github.com/DataDog/datadog-agent/tree/master/Dockerfiles/agent#optional-volumes
## ref: https://docs.datadoghq.com/agent/autodiscovery/
#
# confd:
# redisdb.yaml: |-
# init_config:
# instances:
# - host: "name"
# port: "6379"
# kubernetes_state.yaml: |-
# ad_identifiers:
# - kube-state-metrics
# init_config:
# instances:
# - kube_state_url: http://%%host%%:8080/metrics
## @param checksd - list of key:value strings - optional
## Provide additional custom checks as python code
## Each key becomes a file in /checks.d
## ref: https://github.com/DataDog/datadog-agent/tree/master/Dockerfiles/agent#optional-volumes
#
# checksd:
# service.py: |-
## @param criSocketPath - string - optional
## Path to the container runtime socket (if different from Docker)
## This is supported starting from agent 6.6.0
#
# criSocketPath: /var/run/containerd/containerd.sock
## @param dogStatsDSocketPath - string - optional
## Path to the DogStatsD socket
#
# dogStatsDSocketPath: /var/run/datadog/dsd.socket
## @param livenessProbe - object - optional
## Override the agent's liveness probe logic from the default:
## In case of issues with the probe, you can disable it with the
## following values, to allow easier investigating:
#
# livenessProbe:
# exec:
# command: ["/bin/true"]
## @param resources - object -required
## datadog-agent resource requests and limits
## Make sure to keep requests and limits equal to keep the pods in the Guaranteed QoS class
## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
#
resources: {}
# requests:
# cpu: 200m
# memory: 256Mi
# limits:
# cpu: 200m
# memory: 256Mi
## @param clusterAgent - object - required
## This is the Datadog Cluster Agent implementation that handles cluster-wide
## metrics more cleanly, separates concerns for better rbac, and implements
## the external metrics API so you can autoscale HPAs based on datadog metrics
## ref: https://docs.datadoghq.com/agent/kubernetes/cluster/
#
clusterAgent:
## @param enabled - boolean - required
## Set this to true to enable Datadog Cluster Agent
#
enabled: false
containerName: cluster-agent
image:
# repository: datadog/cluster-agent
repository: ranchercharts/datadog-cluster-agent
tag: 1.3.2
pullPolicy: IfNotPresent
## @param token - string - required
## This needs to be at least 32 characters a-zA-z
## It is a preshared key between the node agents and the cluster agent
## ref:
#
token: ""
replicas: 1
## @param metricsProvider - object - required
## Enable the metricsProvider to be able to scale based on metrics in Datadog
#
metricsProvider:
enabled: false
## @param clusterChecks - object - required
## Enable the Cluster Checks feature on both the cluster-agents and the daemonset
## ref: https://docs.datadoghq.com/agent/autodiscovery/clusterchecks/
## Autodiscovery via Kube Service annotations is automatically enabled
#
clusterChecks:
enabled: false
## @param confd - list of objects - optional
## Provide additional cluster check configurations
## Each key will become a file in /conf.d
## ref: https://docs.datadoghq.com/agent/autodiscovery/
#
# confd:
# mysql.yaml: |-
# cluster_check: true
# instances:
# - server: '<EXTERNAL_IP>'
# port: 3306
# user: datadog
# pass: '<YOUR_CHOSEN_PASSWORD>'
## @param resources - object -required
## Datadog cluster-agent resource requests and limits.
#
resources: {}
# requests:
# cpu: 200m
# memory: 256Mi
# limits:
# cpu: 200m
# memory: 256Mi
## @param priorityclassName - string - optional
## Name of the priorityClass to apply to the Cluster Agent
# priorityClassName: system-cluster-critical
## @param livenessProbe - object - optional
## Override the agent's liveness probe logic from the default:
## In case of issues with the probe, you can disable it with the
## following values, to allow easier investigating:
#
# livenessProbe:
# exec:
# command: ["/bin/true"]
## @param podAnnotations - list of key:value strings - optional
## Annotations to add to the cluster-agents's pod(s)
#
# podAnnotations:
# key: "value"
## @param readinessProbe - object - optional
## Override the cluster-agent's readiness probe logic from the default:
#
# readinessProbe:
rbac:
## @param created - boolean - required
## If true, create & use RBAC resources
#
create: true
## @param serviceAccountName - string - required
## Ignored if rbac.create is true
#
serviceAccountName: default
tolerations: []
kubeStateMetrics:
## @param enabled - boolean - required
## If true, deploys the kube-state-metrics deployment.
## ref: https://github.com/kubernetes/charts/tree/master/stable/kube-state-metrics
#
enabled: true
kube-state-metrics:
image:
repository: ranchercharts/coreos-kube-state-metrics
tag: v1.7.2
rbac:
## @param created - boolean - required
## If true, create & use RBAC resources
#
create: true
serviceAccount:
## @param created - boolean - required
## If true, create ServiceAccount, require rbac kube-state-metrics.rbac.create true
#
create: true
## @param name - string - required
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the fullname template
#
name:
## @param resources - object - optional
## Resource requests and limits for the kube-state-metrics container.
#
# resources:
# requests:
# cpu: 200m
# memory: 256Mi
# limits:
# cpu: 200m
# memory: 256Mi
daemonset:
## @param enabled - boolean - required
## You should keep Datadog DaemonSet enabled!
## The exceptional case could be a situation when you need to run
## single DataDog pod per every namespace, but you do not need to
## re-create a DaemonSet for every non-default namespace install.
## Note: StatsD and DogStatsD work over UDP, so you may not
## get guaranteed delivery of the metrics in Datadog-per-namespace setup!
#
enabled: true
## Configure pods with the required tolerations to run agents
## on RKE data and control plane nodes.
rkeETCDControlPlane: true
## @param useDedicatedContainers - boolean - optional
## Deploy each datadog agent process in a separate container. Allow fine-grained
## control over allocated resources and better isolation.
#
# useDedicatedContainers: false
containers:
agent:
## @param env - list - required
## Additionnal environment variables for the agent container.
#
# env:
## @param logLevel - string - optional
## Set logging verbosity, valid log levels are:
## trace, debug, info, warn, error, critical, and off.
## If not set, fall back to the value of datadog.logLevel.
#
# logLevel: INFO
## @param resources - object - required
## Resource requests and limits for the agent container.
#
resources: {}
# requests:
# cpu: 200m
# memory: 256Mi
# limits:
# cpu: 200m
# memory: 256Mi
processAgent:
## @param env - list - required
## Additionnal environment variables for the process-agent container.
#
# env:
## @param logLevel - string - optional
## Set logging verbosity, valid log levels are:
## trace, debug, info, warn, error, critical, and off.
## If not set, fall back to the value of datadog.logLevel.
#
# logLevel: INFO
## @param resources - object - required
## Resource requests and limits for the process-agent container.
#
resources: {}
# requests:
# cpu: 100m
# memory: 200Mi
# limits:
# cpu: 100m
# memory: 200Mi
traceAgent:
## @param env - list - required
## Additionnal environment variables for the trace-agent container.
#
# env:
## @param logLevel - string - optional
## Set logging verbosity, valid log levels are:
## trace, debug, info, warn, error, critical, and off.
## If not set, fall back to the value of datadog.logLevel.
#
# logLevel: INFO
## @param resources - object - required
## Resource requests and limits for the trace-agent container.
#
resources: {}
# requests:
# cpu: 100m
# memory: 200Mi
# limits:
# cpu: 100m
# memory: 200Mi
## @param useHostNetwork - boolean - optional
## Bind ports on the hostNetwork. Useful for CNI networking where hostPort might
## not be supported. The ports need to be available on all hosts. It 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 are accepted from any host able to connect to this host.
#
# useHostNetwork: true
## @param useHostPort - boolean - optional
## Sets the hostPort to the same value of the container port. Needs to be used
## to receive traces in a standard APM set up. Can be used as for sending custom metrics.
## The ports need to be available on all hosts.
##
## WARNING: Make sure that hosts using this are properly firewalled otherwise
## metrics and traces are accepted from any host able to connect to this host.
#
# useHostPort: true
## @param useHostPID - boolean - optional
## Run the agent in the host's PID namespace. This is required for Dogstatsd origin
## detection to work. See https://docs.datadoghq.com/developers/dogstatsd/unix_socket/
#
# useHostPID: true
## @param podAnnotations - list of key:value strings - optional
## Annotations to add to the DaemonSet's Pods
#
# podAnnotations:
# <POD_ANNOTATION>: '[{"key": "<KEY>", "value": "<VALUE>"}]'
## @param tolerations - array - optional
## Allow the DaemonSet to schedule on tainted nodes (requires Kubernetes >= 1.6)
#
# tolerations: []
## @param nodeSelector - object - optional
## Allow the DaemonSet to schedule on selected nodes
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
#
# nodeSelector: {}
## @param affinity - object - optional
## Allow the DaemonSet to schedule using affinity rules
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
#
# affinity: {}
## @param updateStrategy - string - optional
## Allow the DaemonSet to perform a rolling update on helm update
## ref: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/
#
# updateStrategy: RollingUpdate
## @param priorityClassName - string - optional
## Sets PriorityClassName if defined.
#
# priorityClassName:
## @param podLabels - object - optional
## Sets podLabels if defined.
#
# podLabels: {}
## @param useConfigMap - boolean - optional
# Configures a configmap to provide the agent configuration
#
# useConfigMap: false
deployment:
## @param enabled - boolean - required
## Apart from DaemonSet, deploy Datadog agent pods and related service for
## applications that want to send custom metrics. Provides DogStasD service.
#
enabled: false
## @param replicas - integer - required
## If you want to use datadog.collectEvents, keep deployment.replicas set to 1.
#
replicas: 1
## @param affinity - object - required
## Affinity for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
#
affinity: {}
## @param tolerations - array - required
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
#
tolerations: []
## @param dogstatsdNodePort - integer - optional
## If you're using a NodePort-type service and need a fixed port, set this parameter.
#
# dogstatsdNodePort: 8125
## @param traceNodePort - integer - optional
## If you're using a NodePort-type service and need a fixed port, set this parameter.
#
# traceNodePort: 8126
## @param service - object - required
##
#
service:
type: ClusterIP
annotations: {}
## @param priorityClassName - string - optional
## Sets PriorityClassName if defined.
#
# priorityClassName:
clusterchecksDeployment:
## @param enabled - boolean - required
## If true, deploys agent dedicated for running the Cluster Checks instead of running in the Daemonset's agents.
## ref: https://docs.datadoghq.com/agent/autodiscovery/clusterchecks/
#
enabled: false
rbac:
## @param dedicated - boolean - required
## If true, use a dedicated RBAC resource for the cluster checks agent(s)
#
dedicated: false
## @param serviceAccountName - string - required
## Ignored if rbac.create is true
#
serviceAccountName: default
## @param replicas - integer - required
## If you want to deploy the cluckerchecks agent in HA, keep at least clusterchecksDeployment.replicas set to 2.
## And increase the clusterchecksDeployment.replicas according to the number of Cluster Checks.
#
replicas: 2
## @param resources - object -required
## Datadog clusterchecks-agent resource requests and limits.
#
resources: {}
# requests:
# cpu: 200m
# memory: 500Mi
# limits:
# cpu: 200m
# memory: 500Mi
## @param affinity - object - optional
## Allow the ClusterChecks Deployment to schedule using affinity rules.
## By default, ClusterChecks Deployment Pods are forced to run on different Nodes.
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
#
# affinity:
## @param nodeSelector - object - optional
## Allow the ClusterChecks Deploument to schedule on selected nodes
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
#
# nodeSelector: {}
## @param tolerations - array - required
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
#
# tolerations: []
## @param livenessProbe - object - optional
## Override the agent's liveness probe logic from the default:
## In case of issues with the probe, you can disable it with the
## following values, to allow easier investigating:
#
# livenessProbe:
# exec:
# command: ["/bin/true"]
## @param env - list of object - optional
## The dd-agent supports many environment variables
## ref: https://github.com/DataDog/datadog-agent/tree/master/Dockerfiles/agent#environment-variables
#
# env:
# - name: <ENV_VAR_NAME>
# value: <ENV_VAR_VALUE>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment