Skip to content

Commit 05326f8

Browse files
committed
remove the ipvs checks from the preflight checks
Signed-off-by: Yassine TIJANI <[email protected]>
1 parent 5df8781 commit 05326f8

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",
@@ -110,7 +108,6 @@
110108
"github.com/coreos/etcd/pkg/transport",
111109
"github.com/davecgh/go-spew/spew",
112110
"github.com/docker/distribution/reference",
113-
"github.com/docker/libnetwork/ipvs",
114111
"github.com/godbus/dbus",
115112
"github.com/gogo/protobuf/proto",
116113
"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",
@@ -39,8 +38,6 @@ go_library(
3938
] + select({
4039
"@io_bazel_rules_go//go/platform:linux": [
4140
"//cmd/kubeadm/app/util:go_default_library",
42-
"//pkg/proxy/ipvs:go_default_library",
43-
"//pkg/util/ipset:go_default_library",
4441
],
4542
"//conditions:default": [],
4643
}),

cmd/kubeadm/app/preflight/checks.go

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

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

914-
// Check if IVPS kube-proxy mode is supported
915-
if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
916-
checks = append(checks, IPVSProxierCheck{exec: execer})
917-
}
918-
919903
// Check if Bridge-netfilter and IPv6 relevant flags are set
920904
if ip := net.ParseIP(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil {
921905
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)