Skip to content

Latest commit

 

History

History
72 lines (56 loc) · 3.58 KB

File metadata and controls

72 lines (56 loc) · 3.58 KB

DatadogAgentProfiles

This feature was introduced in Datadog Operator v1.5.0 and was made generally available in v1.24.0.

Overview

DatadogAgentProfiles (DAPs), also known as profiles, can be created to override certain Operator settings that were set in a DatadogAgent (DDA) on a subset of nodes. The Supported Settings table lists which settings can be overridden and the minimum Operator versions for each. While multiple DAPs can be applied to a cluster, each DAP must target a different subset of nodes so the DAPs do not conflict with each other.

Example:

apiVersion: datadoghq.com/v1alpha1
kind: DatadogAgentProfile
metadata:
  name: datadogagentprofile-sample
spec:
  profileAffinity:
    profileNodeAffinity:
      - key: kubernetes.io/os
        operator: In
        values:
          - linux
  config:
    override:
      nodeAgent:
        containers:
          agent:
            resources:
              requests:
                cpu: 256m

The DAP spec has two main sections:

  • profileAffinity is used to target a subset of nodes. It accepts a list of NodeSelectorRequirements.
  • config defines the configuration to override in the DDA. It follows the configuration formatting of the Operator's DatadogAgentSpec.

When a DAP is applied, the Operator creates a new DaemonSet for that profile using the same name as the DAP. Even if the Operator is configured to use ExtendedDaemonSets, it will still create DaemonSets for any DAPs. It will also create a DaemonSet (or an ExtendedDaemonSet, if enabled) for a default profile. The default profile uses the same name as the DDA and applies to all nodes that are not targeted by a DAP.

$ kubectl get ds
NAME                                                            DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
datadog-agent                                                   1         1         1       1            1           <none>          5m3s
datadogagentprofile-sample                                      1         1         1       1            1           <none>          44s
  • datadog-agent is the DaemonSet created by the default profile
  • datadogagentprofile-sample is the DaemonSet created by the profile datadogagentprofile-sample

Prerequisites

  • Operator v1.5.0+
  • Tests were performed on Kubernetes versions >= 1.27.0

Enabling DatadogAgentProfiles

DAP is disabled by default. To enable DAP using the datadog-operator helm chart, set in your values.yaml or as a flag in the command line arguments using --set:

  • datadogAgentProfile.enabled=true: this instructs the Operator deployment to start the DatadogAgentProfile controller.
  • datadogCRDs.crds.datadogAgentProfiles=true: this installs the DatadogAgentProfile CRD.

Caution

Enabling DAP will increase the resource usage of the Operator. Please ensure the operator pod has enough resources allocated to it prior to enabling DAP.

Supported Settings

Setting Operator Version
override.[nodeAgent].containers.[*].resources.* v1.5.0
override.[nodeAgent].priorityClassName v1.6.0
override.[nodeAgent].containers.[*].env v1.8.0
override.[nodeAgent].labels v1.8.0
override.[nodeAgent].updateStrategy v1.9.0
override.[nodeAgent].runtimeClassName v1.12.0