mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Kubeadm should check for bridge-nf-call-ip6tables
With this change, Kubeadm will check that /proc/sys/net/bridge/bridge-nf-call-ip6tables is set to 1 in preflight when using IPv6. This is similar to how it currenltly checks for bridge-nf-call-iptables.
This commit is contained in:
parent
c3d47b683b
commit
9ad3116f10
@ -55,6 +55,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
bridgenf = "/proc/sys/net/bridge/bridge-nf-call-iptables"
|
bridgenf = "/proc/sys/net/bridge/bridge-nf-call-iptables"
|
||||||
|
bridgenf6 = "/proc/sys/net/bridge/bridge-nf-call-ip6tables"
|
||||||
externalEtcdRequestTimeout = time.Duration(10 * time.Second)
|
externalEtcdRequestTimeout = time.Duration(10 * time.Second)
|
||||||
externalEtcdRequestRetries = 3
|
externalEtcdRequestRetries = 3
|
||||||
externalEtcdRequestInterval = time.Duration(5 * time.Second)
|
externalEtcdRequestInterval = time.Duration(5 * time.Second)
|
||||||
@ -700,6 +701,13 @@ func RunInitMasterChecks(cfg *kubeadmapi.MasterConfiguration) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ip := net.ParseIP(cfg.API.AdvertiseAddress); ip != nil {
|
||||||
|
if ip.To4() == nil && ip.To16() != nil {
|
||||||
|
checks = append(checks,
|
||||||
|
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
return RunChecks(checks, os.Stderr)
|
return RunChecks(checks, os.Stderr)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,6 +742,15 @@ func RunJoinNodeChecks(cfg *kubeadmapi.NodeConfiguration) error {
|
|||||||
InPathCheck{executable: "touch", mandatory: false},
|
InPathCheck{executable: "touch", mandatory: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(cfg.DiscoveryTokenAPIServers) > 0 {
|
||||||
|
if ip := net.ParseIP(cfg.DiscoveryTokenAPIServers[0]); ip != nil {
|
||||||
|
if ip.To4() == nil && ip.To16() != nil {
|
||||||
|
checks = append(checks,
|
||||||
|
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return RunChecks(checks, os.Stderr)
|
return RunChecks(checks, os.Stderr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +205,12 @@ func TestRunInitMasterChecks(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cfg: &kubeadmapi.MasterConfiguration{
|
||||||
|
API: kubeadmapi.API{AdvertiseAddress: "2001:1234::1:15"},
|
||||||
|
},
|
||||||
|
expected: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rt := range tests {
|
for _, rt := range tests {
|
||||||
@ -229,6 +235,18 @@ func TestRunJoinNodeChecks(t *testing.T) {
|
|||||||
cfg: &kubeadmapi.NodeConfiguration{},
|
cfg: &kubeadmapi.NodeConfiguration{},
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cfg: &kubeadmapi.NodeConfiguration{
|
||||||
|
DiscoveryTokenAPIServers: []string{"192.168.1.15"},
|
||||||
|
},
|
||||||
|
expected: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
cfg: &kubeadmapi.NodeConfiguration{
|
||||||
|
DiscoveryTokenAPIServers: []string{"2001:1234::1:15"},
|
||||||
|
},
|
||||||
|
expected: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rt := range tests {
|
for _, rt := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user