feat(networking): add --disable-ipv6 flag for IPv4-only operation#150
Open
stevensbkang wants to merge 2 commits intodevelopfrom
Open
feat(networking): add --disable-ipv6 flag for IPv4-only operation#150stevensbkang wants to merge 2 commits intodevelopfrom
stevensbkang wants to merge 2 commits intodevelopfrom
Conversation
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
There was a problem hiding this comment.
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-ipv6flag and persist it intotypes.Embedded. - When enabled, disable IPv6 via
/proc/sys/net/ipv6/conf/*/disable_ipv6at bootstrap. - When enabled, generate a CoreDNS Corefile without the
ip6.arpareverse zone and pass--node-ipto 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.
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces --disable-ipv6 (KUBESOLO_DISABLE_IPV6) to disable IPv6 across all layers when running on IPv4-only or constrained environments: