-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes manifest shouldn't use hostNetwork with autodiscovery #15013
Comments
Hi @TomaszKlosinski, this line should avoid that problem: https://github.com/elastic/beats/blob/7.5/deploy/kubernetes/filebeat-kubernetes.yaml#L26, are you passing the |
I've tried but it didn't make any effect, the pod's hostname was still the same a host's hostname. In fact, if I kubectl exec to the pod and run "echo ${NODE_NAME}" it returns the host's hostname. |
I had the same problem, but it was caused because the example config has 'node: ${NODE_NAME}' which I had to change to 'host: ${NODE_NAME}' |
Interesting. I'm pretty sure, I've tried both node and host and it didn't work, but I can test it again. More general question: what's the point of using host network in this case? |
Same question:
Can these lines be safely removed?
Using |
I can share my opinion as a user of filebeat. I did remove them and my filebeat runs as expected since late November, 2019. I haven't encountered any problems. |
HI everyone, We use That said, it's not mandatory for Filebeat to work, and you can remove I'm closing this issue as we don't have plans to remove |
Hi, using the official k8s manifest with autodiscovery enabled is causing:
due to this line:
https://github.com/elastic/beats/blob/master/deploy/kubernetes/filebeat-kubernetes.yaml#L63
Because then it sets the hostname of the pod equal to the hostname of the host machine. And this hostname is picked up by kubernetes client in libbeat:
https://github.com/elastic/beats/blob/master/libbeat/common/kubernetes/util.go#L89
Removing these lines helps:
But the proper solution would be reconfiguring the k8s client in libbeat to fetch pod name differently. Pod's hostname is not stable across deployments.
The text was updated successfully, but these errors were encountered: