Kubernetes Error: Cannot retrieve ConfigMap from the default namespaceKubernetes Error:

Error

root@k8-master-dec-2022:~/k8# kubectl logs datadog-cluster-agent-58699fcccc-thxgg
'/conf.d/kubernetes_state_core.yaml.default' -> '/etc/datadog-agent/conf.d/kubernetes_state_core.yaml.default'
'/conf.d/kubernetes_state_core.yaml.default' -> '/etc/datadog-agent/conf.d/kubernetes_state_core.yaml.default'
2022-12-16 07:26:05 UTC | CLUSTER | WARN | (pkg/util/log/log.go:616 in func1) | Agent configuration relax permissions constraint on the secret backend cmd, Group can read and exec
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (pkg/util/log/log.go:588 in func1) | Features detected from environment: kubernetes,orchestratorexplorer
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (pkg/api/security/security.go:250 in saveAuthToken) | Wrote auth token
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (pkg/api/security/security.go:144 in fetchAuthToken) | Saved a new authentication token to /etc/datadog-agent/auth_token
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (pkg/api/security/security.go:189 in getClusterAgentAuthToken) | Using configured cluster_agent.auth_token
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (app/app.go:204 in start) | Waiting to obtain APIClient connection
2022-12-16 07:26:05 UTC | CLUSTER | INFO | (app/app.go:209 in start) | Got APIClient connection
2022-12-16 07:26:16 UTC | CLUSTER | INFO | (app/app.go:216 in start) | Hostname is: datadog-cluster-agent-58699fcccc-thxgg
2022-12-16 07:26:18 UTC | CLUSTER | INFO | (pkg/forwarder/forwarder.go:237 in NewDefaultForwarder) | Retry queue storage on disk is disabled
2022-12-16 07:26:18 UTC | CLUSTER | INFO | (pkg/forwarder/forwarder.go:237 in NewDefaultForwarder) | Retry queue storage on disk is disabled
2022-12-16 07:26:18 UTC | CLUSTER | INFO | (pkg/aggregator/time_sampler.go:46 in NewTimeSampler) | Creating TimeSampler #0
2022-12-16 07:26:18 UTC | CLUSTER | INFO | (pkg/forwarder/forwarder.go:356 in Start) | Forwarder started, sending to 1 endpoint(s) with 1 worker(s) each: "https://orchestrator.datadoghq.com" (1 api key(s))
2022-12-16 07:26:18 UTC | CLUSTER | INFO | (pkg/forwarder/forwarder.go:356 in Start) | Forwarder started, sending to 1 endpoint(s) with 1 worker(s) each: "https://7-39-2-app.agent.datadoghq.com" (1 api key(s))
Error: temporary failure in leaderElection, will retry later: Get "https://10.96.0.1:443/api/v1/namespaces/default/configmaps/datadog-leader-election?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2022-12-16 07:26:28 UTC | CLUSTER | ERROR | (pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go:146 in init) | Cannot retrieve ConfigMap from the default namespace: Get "https://10.96.0.1:443/api/v1/namespaces/default/configmaps/datadog-leader-election?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Usage:
  datadog-cluster-agent start [flags]

Flags:
  -h, --help   help for start

Global Flags:
  -c, --cfgpath string   path to directory containing datadog.yaml
  -n, --no-color         disable color output

Solution – Still working on it

Kubernetes Error: unable to reliably determine the host nameKubernetes Error:

Error


2022-12-16 03:16:07 UTC | CLUSTER | ERROR | (app/app.go:214 in start) | Error while getting hostname, exiting: unable to reliably determine the host name. You can define one in the agent config file or in your hosts file
Error: Error while getting hostname, exiting: unable to reliably determine the host name. You can define one in the agent config file or in your hosts file

Solution

Latest clusterAgent.image.tag which is 1.41 is having some bugs. You may use old one

    # clusterAgent.image.tag -- Cluster Agent image tag to use
    tag: 7.39.2

Reference