Skip to content

Install Helm


Enable DDTrace Collector

Modify the datakit.yaml file and append ddtrace to the default enabled collectors.

 - name: ENV_DEFAULT_ENABLED_INPUTS
   value: cpu,disk,diskio,mem,swap,system,hostobject,net,host_processes,container,ddtrace

After configuration, restart DataKit:

kubectl apply -f datakit.yaml

Helm Install DataKit Operator

Prerequisites: Kubernetes >= 1.14, Helm >= 3.0+.

$ helm install datakit-operator datakit-operator \
     --repo  https://pubrepo.truewatch.com/chartrepo/datakit-operator \
     -n datakit --create-namespace

Update Configuration File

Datakit Operator configuration is in JSON format, stored separately in Kubernetes as a ConfigMap, and loaded into the container as environment variables.

{
    "server_listen": "0.0.0.0:9543",
    "log_level":     "info",
    "admission_inject": {
        "ddtrace": { 
           "enabled_namespaces":     [],
           "enabled_labelselectors": [],
           "images": {
                "java_agent_image":   "pubrepo.truewatch.com/datakit-operator/dd-lib-java-init:latest"
            },
            "envs": {
              "DD_JMXFETCH_STATSD_HOST": "datakit-service.datakit.svc",
              "DD_JMXFETCH_STATSD_PORT": "8125",
              "POD_NAME": "{fieldRef:metadata.name}",
              "POD_NAMESPACE": "{fieldRef:metadata.namespace}",
              "NODE_NAME": "{fieldRef:spec.nodeName}",
              "DD_SERVICE": "{fieldRef:metadata.labels['service']}",
              "DD_AGENT_HOST": "datakit-service.datakit.svc",
              "DD_TRACE_AGENT_PORT": "9529",
              "DD_TAGS": "pod_name:$(POD_NAME),pod_namespace:$(POD_NAMESPACE),host:$(NODE_NAME)"
            }
        },
        "logfwd": {
            "options": {
                "reuse_exist_volume": "false"
            },
            "images": {
                "logfwd_image": "pubrepo.truewatch.com/datakit/logfwd:1.28.1"
            }
        }
    }
}

Parameter Configuration:

  1. service: Service name;
  2. env: Environment information of the application service;
  3. Customize DataKit listening address. If not set, it will follow the default address;
  4. Set sampling rate: When enabled, it can reduce the actual data volume generated; the range is from 0.0 (0%) to 1.0 (100%);
  5. Collect Profiling data: When enabled, more runtime information of the application can be seen;
  6. Enable JVM metrics collection: Requires simultaneous enabling of the statsd collector.

Execute Installation Command

kubectl apply -f datakit-operator.yaml

Restart Application

After installation, restart the application Pod.