Skip to content

feat(networking): add --disable-ipv6 flag for IPv4-only operation#150

Open
stevensbkang wants to merge 2 commits intodevelopfrom
feat/ks-48/support-disable-ipv6-flag
Open

feat(networking): add --disable-ipv6 flag for IPv4-only operation#150
stevensbkang wants to merge 2 commits intodevelopfrom
feat/ks-48/support-disable-ipv6-flag

Conversation

@stevensbkang
Copy link
Copy Markdown
Member

Introduces --disable-ipv6 (KUBESOLO_DISABLE_IPV6) to disable IPv6 across all layers when running on IPv4-only or constrained environments:

  • OS: writes net.ipv6.conf.{all,default,lo}/disable_ipv6=1 via /proc/sys at bootstrap; idempotent — skips paths already set to 1
  • CoreDNS: omits ip6.arpa reverse zone from the Corefile
  • Kubelet: conditionally passes --node-ip to force IPv4-only node registration only when the flag is set, avoiding breakage on IPv6-only hosts

Introduces --disable-ipv6 (KUBESOLO_DISABLE_IPV6) to disable IPv6
across all layers when running on IPv4-only or constrained environments:

- OS: writes net.ipv6.conf.{all,default,lo}/disable_ipv6=1 via /proc/sys
  at bootstrap; idempotent — skips paths already set to 1
- CoreDNS: omits ip6.arpa reverse zone from the Corefile
- Kubelet: conditionally passes --node-ip to force IPv4-only node
  registration only when the flag is set, avoiding breakage on
  IPv6-only hosts
@linear
Copy link
Copy Markdown

linear Bot commented May 8, 2026

KS-48

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit IPv4-only operation mode by introducing a --disable-ipv6 / KUBESOLO_DISABLE_IPV6 switch and wiring it through bootstrap networking, CoreDNS configuration, and kubelet registration behavior.

Changes:

  • Add --disable-ipv6 flag and persist it into types.Embedded.
  • When enabled, disable IPv6 via /proc/sys/net/ipv6/conf/*/disable_ipv6 at bootstrap.
  • When enabled, generate a CoreDNS Corefile without the ip6.arpa reverse zone and pass --node-ip to kubelet to force IPv4 node registration.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
types/types.go Adds DisableIPv6 to the embedded runtime configuration struct.
internal/config/flags/flags.go Introduces the --disable-ipv6 / KUBESOLO_DISABLE_IPV6 flag.
cmd/kubesolo/main.go Plumbs the flag into bootstrap (sysctl write) and CoreDNS deploy parameters, and stores it in Embedded.
internal/runtime/network/ipv6.go Implements the sysctl-based IPv6 disabling helper.
pkg/kubernetes/kubelet/service.go Stores the new embedded DisableIPv6 setting in the kubelet service.
pkg/kubernetes/kubelet/args.go Conditionally appends --node-ip when IPv6 is disabled.
pkg/components/coredns/coredns.go Extends Deploy to accept the disableIPv6 option and forwards it to config creation.
pkg/components/coredns/configuration.go Splits CoreDNS Corefile into IPv4-only vs dual-stack variants and selects based on flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/components/coredns/configuration.go
Comment thread internal/runtime/network/ipv6.go
Comment thread internal/runtime/network/ipv6.go
- Add doc comment to DisableIPv6Sysctls
- Aggregate sysctl write errors so all three paths are always attempted
  rather than halting on the first failure, avoiding partial configuration
- Replace ConfigMap Update with a merge patch so existing metadata
  (labels, annotations) and unrelated data keys are preserved
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