Skip to content

Commit

Permalink
fix: ensure that ipv6 is not disabled in kernel
Browse files Browse the repository at this point in the history
Signed-off-by: Natanael Copa <ncopa@mirantis.com>
  • Loading branch information
ncopa authored and aauren committed Jun 16, 2024
1 parent f042d08 commit a1125f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/controllers/routing/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,14 @@ func NewNetworkRoutingController(clientset kubernetes.Interface,
}
nrc.isIPv6Capable = len(nrc.nodeIPv6Addrs) > 0

if kubeRouterConfig.EnableIPv6 {
sysctlErr := utils.SetSysctl(utils.IPv6ConfAllDisableIPv6, 0)
if sysctlErr != nil {
klog.Errorf("Failed to set /proc/sys/net/ipv6/conf/all/disable_ipv6. IPv6 may "+
"not work: %s", sysctlErr.Error())
}
}

switch {
case kubeRouterConfig.RouterID == "generate":
h := fnv.New32a()
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/sysctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
IPv4IPVSConnReuseMode = "net/ipv4/vs/conn_reuse_mode"
IPv4ConfAllArpIgnore = "net/ipv4/conf/all/arp_ignore"
IPv4ConfAllArpAnnounce = "net/ipv4/conf/all/arp_announce"
IPv6ConfAllDisableIPv6 = "net/ipv6/conf/all/disable_ipv6"

// Network Routes Configuration Paths
BridgeNFCallIPTables = "net/bridge/bridge-nf-call-iptables"
Expand Down

0 comments on commit a1125f6

Please sign in to comment.