Skip to content

Commit 90cf189

Browse files
authored
Merge pull request kubernetes#81791 from yastij/remove-ipvs-checks
remove the ipvs checks from the preflight checks
2 parents f789e1e + 05326f8 commit 90cf189

File tree

7 files changed

+1
-64
lines changed

7 files changed

+1
-64
lines changed

cmd/kubeadm/.import-restrictions

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@
7777
"k8s.io/kubernetes/pkg/util/conntrack",
7878
"k8s.io/kubernetes/pkg/util/dbus",
7979
"k8s.io/kubernetes/pkg/util/hash",
80-
"k8s.io/kubernetes/pkg/util/ipset",
8180
"k8s.io/kubernetes/pkg/util/iptables",
82-
"k8s.io/kubernetes/pkg/util/ipvs",
8381
"k8s.io/kubernetes/pkg/util/metrics",
8482
"k8s.io/kubernetes/pkg/util/parsers",
8583
"k8s.io/kubernetes/pkg/util/sysctl",
@@ -111,7 +109,6 @@
111109
"github.com/coreos/etcd/pkg/transport",
112110
"github.com/davecgh/go-spew/spew",
113111
"github.com/docker/distribution/reference",
114-
"github.com/docker/libnetwork/ipvs",
115112
"github.com/godbus/dbus",
116113
"github.com/gogo/protobuf/proto",
117114
"github.com/gogo/protobuf/sortkeys",

cmd/kubeadm/app/cmd/phases/join/preflight.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ func runPreflight(c workflow.RunData) error {
9999

100100
// Continue with more specific checks based on the init configuration
101101
klog.V(1).Infoln("[preflight] Running configuration dependant checks")
102-
if err := preflight.RunOptionalJoinNodeChecks(utilsexec.New(), &initCfg.ClusterConfiguration, j.IgnorePreflightErrors()); err != nil {
103-
return err
104-
}
105-
106102
if j.Cfg().ControlPlane != nil {
107103
// Checks if the cluster configuration supports
108104
// joining a new control plane instance and if all the necessary certificates are provided

cmd/kubeadm/app/preflight/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ go_library(
2626
"//cmd/kubeadm/app/util/system:go_default_library",
2727
"//cmd/kubeadm/app/version:go_default_library",
2828
"//pkg/registry/core/service/ipallocator:go_default_library",
29-
"//pkg/util/ipvs:go_default_library",
3029
"//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library",
3130
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
3231
"//staging/src/k8s.io/apimachinery/pkg/util/version:go_default_library",
@@ -38,8 +37,6 @@ go_library(
3837
] + select({
3938
"@io_bazel_rules_go//go/platform:linux": [
4039
"//cmd/kubeadm/app/util:go_default_library",
41-
"//pkg/proxy/ipvs:go_default_library",
42-
"//pkg/util/ipset:go_default_library",
4340
],
4441
"//conditions:default": [],
4542
}),

cmd/kubeadm/app/preflight/checks.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import (
4848
"k8s.io/kubernetes/cmd/kubeadm/app/util/system"
4949
kubeadmversion "k8s.io/kubernetes/cmd/kubeadm/app/version"
5050
"k8s.io/kubernetes/pkg/registry/core/service/ipallocator"
51-
ipvsutil "k8s.io/kubernetes/pkg/util/ipvs"
5251
utilsexec "k8s.io/utils/exec"
5352
utilsnet "k8s.io/utils/net"
5453
)
@@ -867,20 +866,10 @@ func (ncc NumCPUCheck) Check() (warnings, errorList []error) {
867866
return warnings, errorList
868867
}
869868

870-
// IPVSProxierCheck tests if IPVS proxier can be used.
871-
type IPVSProxierCheck struct {
872-
exec utilsexec.Interface
873-
}
874-
875-
// Name returns label for IPVSProxierCheck
876-
func (r IPVSProxierCheck) Name() string {
877-
return "IPVSProxierCheck"
878-
}
879-
880869
// RunInitNodeChecks executes all individual, applicable to control-plane node checks.
881870
// The boolean flag 'isSecondaryControlPlane' controls whether we are running checks in a --join-control-plane scenario.
882871
// The boolean flag 'downloadCerts' controls whether we should skip checks on certificates because we are downloading them.
883-
// If the flag is set to true we should skip checks already executed by RunJoinNodeChecks and RunOptionalJoinNodeChecks.
872+
// If the flag is set to true we should skip checks already executed by RunJoinNodeChecks.
884873
func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String, isSecondaryControlPlane bool, downloadCerts bool) error {
885874
if !isSecondaryControlPlane {
886875
// First, check if we're root separately from the other preflight checks and fail fast
@@ -913,11 +902,6 @@ func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigura
913902
if !isSecondaryControlPlane {
914903
checks = addCommonChecks(execer, cfg.KubernetesVersion, &cfg.NodeRegistration, checks)
915904

916-
// Check if IVPS kube-proxy mode is supported
917-
if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
918-
checks = append(checks, IPVSProxierCheck{exec: execer})
919-
}
920-
921905
// Check if Bridge-netfilter and IPv6 relevant flags are set
922906
if ip := net.ParseIP(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil {
923907
if utilsnet.IsIPv6(ip) {
@@ -1001,18 +985,6 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfigura
1001985
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
1002986
}
1003987

1004-
// RunOptionalJoinNodeChecks executes all individual, applicable to node configuration dependant checks
1005-
func RunOptionalJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.ClusterConfiguration, ignorePreflightErrors sets.String) error {
1006-
checks := []Checker{}
1007-
1008-
// Check if IPVS kube-proxy mode is supported
1009-
if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
1010-
checks = append(checks, IPVSProxierCheck{exec: execer})
1011-
}
1012-
1013-
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
1014-
}
1015-
1016988
// addCommonChecks is a helper function to duplicate checks that are common between both the
1017989
// kubeadm init and join commands
1018990
func addCommonChecks(execer utilsexec.Interface, k8sVersion string, nodeReg *kubeadmapi.NodeRegistrationOptions, checks []Checker) []Checker {

cmd/kubeadm/app/preflight/checks_darwin.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,3 @@ package preflight
2525
func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
2626
return nil, nil
2727
}
28-
29-
// Check determines if IPVS proxier can be used or not
30-
// No-op for for Darwin (MacOS).
31-
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
32-
return nil, nil
33-
}

cmd/kubeadm/app/preflight/checks_linux.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ package preflight
2121
import (
2222
"github.com/pkg/errors"
2323
"k8s.io/kubernetes/cmd/kubeadm/app/util"
24-
"k8s.io/kubernetes/pkg/proxy/ipvs"
2524
"k8s.io/utils/exec"
26-
27-
utilipset "k8s.io/kubernetes/pkg/util/ipset"
2825
)
2926

3027
// Check validates if Docker is setup to use systemd as the cgroup driver.
@@ -43,13 +40,3 @@ func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
4340
}
4441
return nil, nil
4542
}
46-
47-
// Check determines if IPVS proxier can be used or not
48-
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
49-
ipsetInterface := utilipset.New(ipvspc.exec)
50-
kernelHandler := ipvs.NewLinuxKernelHandler()
51-
if _, err := ipvs.CanUseIPVSProxier(kernelHandler, ipsetInterface); err != nil {
52-
return nil, []error{err}
53-
}
54-
return nil, nil
55-
}

cmd/kubeadm/app/preflight/checks_windows.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,3 @@ func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) {
5454
func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
5555
return nil, nil
5656
}
57-
58-
// Check determines if IPVS proxier can be used or not
59-
// No-op for Windows.
60-
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
61-
return nil, nil
62-
}

0 commit comments

Comments
 (0)