apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: cluster-agent
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: RELEASE-NAME-datadog
    app.kubernetes.io/version: "7"
    helm.sh/chart: datadog-2.30.0
  name: RELEASE-NAME-datadog-cluster-agent
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: RELEASE-NAME-datadog-cluster-agent
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        checksum/api_key: 01c109694a000090422858257915329a3d306c5d06c90881c4044ae17a49da3d
        checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
        checksum/clusteragent_token: 34ed695c45de77f7f9de4bba199806bfb40588da0045a2b82a47f2b3c23eca84
        checksum/install_info: 32989b0d62b89e84a4cbfdb47ff22e23febe2be0a95d573ac60ac79828bb648f
      labels:
        app: RELEASE-NAME-datadog-cluster-agent
        app.kubernetes.io/component: cluster-agent
        app.kubernetes.io/instance: RELEASE-NAME
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: RELEASE-NAME-datadog
      name: RELEASE-NAME-datadog-cluster-agent
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app: RELEASE-NAME-datadog-cluster-agent
              topologyKey: kubernetes.io/hostname
            weight: 50
      containers:
      - env:
        - name: DD_HEALTH_PORT
          value: "5556"
        - name: DD_API_KEY
          valueFrom:
            secretKeyRef:
              key: api-key
              name: RELEASE-NAME-datadog
              optional: true
        - name: DD_CLUSTER_CHECKS_ENABLED
          value: "true"
        - name: DD_EXTRA_CONFIG_PROVIDERS
          value: kube_endpoints kube_services
        - name: DD_EXTRA_LISTENERS
          value: kube_endpoints kube_services
        - name: DD_LOG_LEVEL
          value: INFO
        - name: DD_LEADER_ELECTION
          value: "true"
        - name: DD_COLLECT_KUBERNETES_EVENTS
          value: "true"
        - name: DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME
          value: RELEASE-NAME-datadog-cluster-agent
        - name: DD_CLUSTER_AGENT_AUTH_TOKEN
          valueFrom:
            secretKeyRef:
              key: token
              name: RELEASE-NAME-datadog-cluster-agent
        - name: DD_KUBE_RESOURCES_NAMESPACE
          value: default
        - name: DD_ORCHESTRATOR_EXPLORER_ENABLED
          value: "true"
        - name: DD_ORCHESTRATOR_EXPLORER_CONTAINER_SCRUBBING_ENABLED
          value: "true"
        image: gcr.io/datadoghq/cluster-agent:1.17.0
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 6
          httpGet:
            path: /live
            port: 5556
            scheme: HTTP
          initialDelaySeconds: 15
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 5
        name: cluster-agent
        ports:
        - containerPort: 5005
          name: agentport
          protocol: TCP
        - containerPort: 5000
          name: agentmetrics
          protocol: TCP
        readinessProbe:
          failureThreshold: 6
          httpGet:
            path: /ready
            port: 5556
            scheme: HTTP
          initialDelaySeconds: 15
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 5
        resources: {}
        volumeMounts:
        - mountPath: /etc/datadog-agent/install_info
          name: installinfo
          readOnly: true
          subPath: install_info
      nodeSelector:
        kubernetes.io/os: linux
      serviceAccountName: RELEASE-NAME-datadog-cluster-agent
      volumes:
      - configMap:
          name: RELEASE-NAME-datadog-installinfo
        name: installinfo
