-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
NodeLocalDNS exposing prometheus metrics on 0.0.0.0 #7740
Comments
@D3DeFi indeed prometheus uses You could use the host IP to bind the service so if you have multiple interfaces on the host you don't intentionally leak information on more than one interface. Then, depending on the CNI, you can set up a host based firewall or an EndpointPolicy if you are using calico to prevent access to the metrics port except from the prometheus scraper. Note also that the pod healtcheck also happens on this port and that is also done on the |
@cristicalin thank you for explaining.
Could you please elaborate a little bit more on this part? You mean limiting actual service manifest file via |
Kubespray today does not allow you to do this with our current setup of nodelocaldns. A change would be needed to expose the @floryut @oomichi @champtar , any thoughts on this? I can submit a PR implementing this if you think it's the right way to go. |
Breaking change + a config variable to get back the old behavior is fine with me |
What would you like to be added:
Possibility to configure on which IP should NodeLocalDNS Prometheus metrics be exported.
Currently, nodelocaldns exposes metrics like this:
kubespray/roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2
Line 20 in 271be92
Since it is DS with
hostNetwork: true
, metrics backend can be reached from any interface present on the host.Although, I am not sure about this, my tip would be that eventual prometheus would try to scrape such metrics at
.spec.hostIP:9253
.Why is this needed:
security problem exposing part of the information publicly if Kubernetes nodes are reachable on public IP addresses.
Current situation:
Would something like this be considered a good enough patch?
The text was updated successfully, but these errors were encountered: