-
Notifications
You must be signed in to change notification settings - Fork 204
Description
When following the instructions at https://www.elastic.co/guide/en/fleet/current/example-kubernetes-fleet-managed-agent-helm.html and installing a Fleet Managed with preset perNode
helm install demo ./deploy/helm/elastic-agent \
--set agent.fleet.enabled=true \
--set agent.fleet.url=https://fleet-svc.default.svc \
--set agent.fleet.token=myToken \
--set agent.fleet.preset=perNode \
--set agent.fleet.insecure=true
The agent works fine but it cannot access the kubelet endpoint when configuring k8s integration:
"log.level":"error","@timestamp":"2024-12-13T08:47:25.573Z","message":"Error fetching data for metricset kubernetes.proxy: error getting metrics: error making http request: Get \"http://localhost:10249/metrics\": dial tcp 127.0.0.1:10249: connect: connection refused","component":{"binary":"metricbeat","dataset":"elastic_agent.metricbeat","id":"kubernetes/metrics-default","type":"kubernetes/metrics"},"log":{"source":"kubernetes/metrics-default"},"log.origin":{"file.line":333,"file.name":"module/wrapper.go","function":"github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).handleFetchError"},"service.name":"metricbeat","ecs.version":"1.6.0","ecs.version":"1.6.0"}
If we want this preset to work with the default values of the k8s integration we should probably add hostNetwork: true.
The hostNetwork true I believe it's also needed to perform the system monitoring of the network interfaces.
If we don't want to use hostNetwork: true (which I would love to), then we have to determine and document how to perform the kubelet monitoring and the system interfaces monitoring.
hostNetwork is apparently needed to also show the real hostnames in monitoring data instead of the pod name, which is important for infrastructure monitoring.
cc: @pkoutsovasilis ;)