Skip to content
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

Add NodeExporter dnsPolicy option. #2079

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

kahirokunn
Copy link
Contributor

What does this PR change?

I have taken the actions described in the following document.

Pods running with hostNetwork, you should explicitly set its DNS policy to "ClusterFirstWithHostNet".

https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy

Does this PR rely on any other PRs?

How does this PR impact users? (This is the kind of thing that goes in release notes!)

Links to Issues or ZD tickets this PR addresses or fixes

How was this PR tested?

on local machine

Have you made an update to documentation?

yes

@Adam-Stack-PM
Copy link

@kahirokunn, Thanks for this PR. We will get this routed to an engineer for review very soon.

Please note this it may take a few days as our team is traveling to a company event this week.

CC: @allyleonce

@thomasvn
Copy link
Member

Thanks for the PR @kahirokunn! I believe the default configuration for node-exporter does not include hostNetwork: true. Therefore, node-exporter should be defaulting to the default dnsPolicy and not ClusterFirstWithHostNet?

@kahirokunn
Copy link
Contributor Author

@thomasvn default configuration for node-exporter include hostNetwork: true.
image

@thomasvn
Copy link
Member

Ah, thanks for pointing me to that @kahirokunn! Yes, so I agree that updating node-exporter to dnsPolicy: ClusterFirstWithHostNet would be in alignment with the k8s docs.

Can you think of a way to test this change? Would it be worthwhile running nslookup in the node-exporter pod before and after the change?

@kahirokunn
Copy link
Contributor Author

It works well in my environment, so I don't think it is necessary to go that far.

@thomasvn
Copy link
Member

thomasvn commented Apr 3, 2023

@kahirokunn I’ve tested in my environment and also see no issue with metrics emitted by node-exporter, and Prometheus scraping node-exporter. Approving as these changes are in accordance to k8s docs.

@AjayTripathy AjayTripathy merged commit 2af2255 into kubecost:develop Apr 3, 2023
@kahirokunn kahirokunn deleted the dnspolicy branch April 4, 2023 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants