Unable to detect the kubelet URL automatically : datadog_checks.base.errors.CheckException

Viewed 2932

I set up datadog trace client in my kubernetes cluster to monitor my deployed application. It was working fine with the kubernetes version 1.15x but as soon as I upgraded the version to 1.16x, the service itself is not showing in the Datadog Dashboard.

Currently using:

  1. Kubernetes 1.16.9

  2. Datadog 0.52.0

When checked for agent status. It is giving following exception :

Instance ID: kubelet:xxxxxxxxxxxxx [ERROR]
      Configuration Source: file:/etc/datadog-agent/conf.d/kubelet.d/conf.yaml.default
      Total Runs: 12,453
      Metric Samples: Last Run: 0, Total: 0
      Events: Last Run: 0, Total: 0
      Service Checks: Last Run: 0, Total: 0
      Average Execution Time : 5ms
      Last Execution Date : 2020-06-19 15:18:19.000000 UTC
      Last Successful Execution Date : Never
      Error: Unable to detect the kubelet URL automatically.
      Traceback (most recent call last):
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py", line 822, in run
          self.check(instance)
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/kubelet/kubelet.py", line 297, in check
          raise CheckException("Unable to detect the kubelet URL automatically.")
      datadog_checks.base.errors.CheckException: Unable to detect the kubelet URL automatically.

This looks like a version issue to me. If it is which Datadog version I need to use for monitoring?

2 Answers

This was a issue with deployed DataDog daemonset for me:

What I did to resolve:

  1. Check daemonset if it exists or not:

    kubectl get ds -n datadog
    
  2. Edit the datadog daemonset:

    kubectl edit ds datadog -n datadog
    
  3. In the opened yaml, add

    - name: DD_KUBELET_TLS_VERIFY
      value: "false"
    

    Add this in env: tag for all places. For me there were 4 places which are having DD tags in the yaml.

  4. Save and close it. The daemonset will restart. And the application will start getting traced.

If you are using the Helm chart, you can overwrite on the values:

## https://github.com/DataDog/helm-charts/blob/master/charts/datadog/values.yaml

datadog:  
  # kubelet configuration
  kubelet:
    # datadog.kubelet.tlsVerify -- Toggle kubelet TLS verification
    # @default -- true
    tlsVerify:  false
Related