Skip to content

Configure CoreDNS and kubelet for dual stack DNS#7686

Open
pschichtel wants to merge 2 commits into
k0sproject:mainfrom
pschichtel:bugfix/dual-stack-dns
Open

Configure CoreDNS and kubelet for dual stack DNS#7686
pschichtel wants to merge 2 commits into
k0sproject:mainfrom
pschichtel:bugfix/dual-stack-dns

Conversation

@pschichtel

@pschichtel pschichtel commented May 24, 2026

Copy link
Copy Markdown
Contributor

Description

Previously the kube-dns service only received the primary IP address and the service was single stack. It is now configured with 2 address and address families and PreferDualStack (maybe that should be require?). To utilize the IP addresses, kubelet's config now also includes both IP addresses when running in dual stack mode.

Doesn't fix, but is related to: #7186

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@jnummelin

Copy link
Copy Markdown
Member

PreferDualStack (maybe that should be require?)

hmm, in this case I don't think there's much of a difference. In our case we know when things are dual-stack. This is what kube docs say, so if I read that correctly both Prefer.. and Require... behave exact same in our case.

PreferDualStack: Allocates both IPv4 and IPv6 cluster IPs for the Service when dual-stack is enabled. If dual-stack is not enabled or supported, it falls back to single-stack behavior.

@pschichtel

Copy link
Copy Markdown
Contributor Author

yeah that's how I interpreted the docs as well. I went with "prefer" only for the remote chance of the service somehow being misaligned with the cluster dualstack configuration and then being blocked because it is RequireDualStack but doesn't have/receive an IPv6. not sure if that is ever a realistic scenario.

Comment thread pkg/component/controller/coredns.go
Comment thread pkg/apis/k0s/v1beta1/network.go Outdated
Comment thread pkg/apis/k0s/v1beta1/network.go Outdated
Comment thread pkg/component/controller/coredns.go Outdated
@pschichtel pschichtel force-pushed the bugfix/dual-stack-dns branch from 2c6e287 to 3836ae5 Compare May 31, 2026 22:55
APIServer *k0snet.HostPort
ServiceCIDRIPv4 string
ClusterDNSIP string
ClusterDNSIPs []net.IP

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twz123 Removing DNSAddress() revealed that this field is unused, which is kinda concerning.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that need to be resolved.

@pschichtel

Copy link
Copy Markdown
Contributor Author

I'll rebase in the evening.

Any input regarding the unused calico fields?

@pschichtel pschichtel force-pushed the bugfix/dual-stack-dns branch from e4011b0 to 31587b3 Compare June 1, 2026 22:47
@pschichtel pschichtel force-pushed the bugfix/dual-stack-dns branch from 31587b3 to c9e9488 Compare June 11, 2026 23:53
@pschichtel

Copy link
Copy Markdown
Contributor Author

Is there still a chance this could land for 1.36 or 1.36.1?

Previously the kube-dns service only received the primary IP address and the service was single stack. It is now configured with 2 address and address families and PreferDualStack (maybe that should be require?). To utilize the IP addresses, kubelet's config now also includes both IP addresses when running in dual stack mode.

Signed-off-by: Phillip Schichtel <phillip@schich.tel>
Most of the remaining usages were tests. The new test cases also verify the dual stack case.

Signed-off-by: Phillip Schichtel <phillip@schich.tel>
@pschichtel pschichtel force-pushed the bugfix/dual-stack-dns branch from c9e9488 to 59c46c7 Compare June 14, 2026 22:26
@pschichtel

Copy link
Copy Markdown
Contributor Author

Fixed the failing test and rebased.

@twz123

twz123 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Is there still a chance this could land for 1.36 or 1.36.1?

I guess we can backport this.

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.

3 participants