Merge pull request #81791 from yastij/remove-ipvs-checks

remove the ipvs checks from the preflight checks
This commit is contained in:
Kubernetes Prow Robot 2019-08-26 20:55:22 -07:00 committed by GitHub
commit 90cf189152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 64 deletions

View File

@ -77,9 +77,7 @@
"k8s.io/kubernetes/pkg/util/conntrack",
"k8s.io/kubernetes/pkg/util/dbus",
"k8s.io/kubernetes/pkg/util/hash",
"k8s.io/kubernetes/pkg/util/ipset",
"k8s.io/kubernetes/pkg/util/iptables",
"k8s.io/kubernetes/pkg/util/ipvs",
"k8s.io/kubernetes/pkg/util/metrics",
"k8s.io/kubernetes/pkg/util/parsers",
"k8s.io/kubernetes/pkg/util/sysctl",
@ -111,7 +109,6 @@
"github.com/coreos/etcd/pkg/transport",
"github.com/davecgh/go-spew/spew",
"github.com/docker/distribution/reference",
"github.com/docker/libnetwork/ipvs",
"github.com/godbus/dbus",
"github.com/gogo/protobuf/proto",
"github.com/gogo/protobuf/sortkeys",

View File

@ -99,10 +99,6 @@ func runPreflight(c workflow.RunData) error {
// Continue with more specific checks based on the init configuration
klog.V(1).Infoln("[preflight] Running configuration dependant checks")
if err := preflight.RunOptionalJoinNodeChecks(utilsexec.New(), &initCfg.ClusterConfiguration, j.IgnorePreflightErrors()); err != nil {
return err
}
if j.Cfg().ControlPlane != nil {
// Checks if the cluster configuration supports
// joining a new control plane instance and if all the necessary certificates are provided

View File

@ -26,7 +26,6 @@ go_library(
"//cmd/kubeadm/app/util/system:go_default_library",
"//cmd/kubeadm/app/version:go_default_library",
"//pkg/registry/core/service/ipallocator:go_default_library",
"//pkg/util/ipvs:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/version:go_default_library",
@ -38,8 +37,6 @@ go_library(
] + select({
"@io_bazel_rules_go//go/platform:linux": [
"//cmd/kubeadm/app/util:go_default_library",
"//pkg/proxy/ipvs:go_default_library",
"//pkg/util/ipset:go_default_library",
],
"//conditions:default": [],
}),

View File

@ -48,7 +48,6 @@ import (
"k8s.io/kubernetes/cmd/kubeadm/app/util/system"
kubeadmversion "k8s.io/kubernetes/cmd/kubeadm/app/version"
"k8s.io/kubernetes/pkg/registry/core/service/ipallocator"
ipvsutil "k8s.io/kubernetes/pkg/util/ipvs"
utilsexec "k8s.io/utils/exec"
utilsnet "k8s.io/utils/net"
)
@ -867,20 +866,10 @@ func (ncc NumCPUCheck) Check() (warnings, errorList []error) {
return warnings, errorList
}
// IPVSProxierCheck tests if IPVS proxier can be used.
type IPVSProxierCheck struct {
exec utilsexec.Interface
}
// Name returns label for IPVSProxierCheck
func (r IPVSProxierCheck) Name() string {
return "IPVSProxierCheck"
}
// RunInitNodeChecks executes all individual, applicable to control-plane node checks.
// The boolean flag 'isSecondaryControlPlane' controls whether we are running checks in a --join-control-plane scenario.
// The boolean flag 'downloadCerts' controls whether we should skip checks on certificates because we are downloading them.
// If the flag is set to true we should skip checks already executed by RunJoinNodeChecks and RunOptionalJoinNodeChecks.
// If the flag is set to true we should skip checks already executed by RunJoinNodeChecks.
func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String, isSecondaryControlPlane bool, downloadCerts bool) error {
if !isSecondaryControlPlane {
// 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
if !isSecondaryControlPlane {
checks = addCommonChecks(execer, cfg.KubernetesVersion, &cfg.NodeRegistration, checks)
// Check if IVPS kube-proxy mode is supported
if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
checks = append(checks, IPVSProxierCheck{exec: execer})
}
// Check if Bridge-netfilter and IPv6 relevant flags are set
if ip := net.ParseIP(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil {
if utilsnet.IsIPv6(ip) {
@ -1001,18 +985,6 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfigura
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
}
// RunOptionalJoinNodeChecks executes all individual, applicable to node configuration dependant checks
func RunOptionalJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.ClusterConfiguration, ignorePreflightErrors sets.String) error {
checks := []Checker{}
// Check if IPVS kube-proxy mode is supported
if cfg.ComponentConfigs.KubeProxy != nil && cfg.ComponentConfigs.KubeProxy.Mode == ipvsutil.IPVSProxyMode {
checks = append(checks, IPVSProxierCheck{exec: execer})
}
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
}
// addCommonChecks is a helper function to duplicate checks that are common between both the
// kubeadm init and join commands
func addCommonChecks(execer utilsexec.Interface, k8sVersion string, nodeReg *kubeadmapi.NodeRegistrationOptions, checks []Checker) []Checker {

View File

@ -25,9 +25,3 @@ package preflight
func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
return nil, nil
}
// Check determines if IPVS proxier can be used or not
// No-op for for Darwin (MacOS).
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
return nil, nil
}

View File

@ -21,10 +21,7 @@ package preflight
import (
"github.com/pkg/errors"
"k8s.io/kubernetes/cmd/kubeadm/app/util"
"k8s.io/kubernetes/pkg/proxy/ipvs"
"k8s.io/utils/exec"
utilipset "k8s.io/kubernetes/pkg/util/ipset"
)
// Check validates if Docker is setup to use systemd as the cgroup driver.
@ -43,13 +40,3 @@ func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
}
return nil, nil
}
// Check determines if IPVS proxier can be used or not
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
ipsetInterface := utilipset.New(ipvspc.exec)
kernelHandler := ipvs.NewLinuxKernelHandler()
if _, err := ipvs.CanUseIPVSProxier(kernelHandler, ipsetInterface); err != nil {
return nil, []error{err}
}
return nil, nil
}

View File

@ -54,9 +54,3 @@ func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) {
func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error) {
return nil, nil
}
// Check determines if IPVS proxier can be used or not
// No-op for Windows.
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
return nil, nil
}