Skip to content

Conversation

@sashanicolas
Copy link

Description

Adds a dnsPolicy configuration option to the prometheus-node-exporter chart.

Problem

When hostNetwork: true (the default), Kubernetes defaults to dnsPolicy: ClusterFirst, which prepends cluster DNS to the host's DNS servers. If the host has 3 nameservers configured, this results in 4 total nameservers, exceeding the limit and triggering:

Nameserver limits were exceeded, some nameservers have been omitted

Solution

Add a dnsPolicy value (similar to the existing dnsConfig) allowing users to set:

  • Default - use only host DNS (appropriate when pod doesn't need cluster DNS)
  • ClusterFirstWithHostNet - prefer cluster DNS with host DNS fallback

Changes

  • Chart.yaml: version bump 4.49.2 → 4.50.0
  • values.yaml: Added dnsPolicy: "" with documentation
  • templates/daemonset.yaml: Added template logic to render dnsPolicy when set

Usage

prometheus-node-exporter:
  dnsPolicy: "Default"

Related

Signed-off-by: sashanicolas [email protected]

When hostNetwork is true (the default), users may need to set dnsPolicy
to 'Default' or 'ClusterFirstWithHostNet' to avoid DNS resolution issues
or 'Nameserver limits exceeded' warnings when Kubernetes tries to combine
host DNS with cluster DNS.

This adds a dnsPolicy value that allows users to explicitly set the pod's
DNS policy, similar to the existing dnsConfig option.

Signed-off-by: sashanicolas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants