Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the ipvs checks from the preflight checks #81791

Merged
merged 1 commit into from Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/kubeadm/.import-restrictions
Expand Up @@ -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",
yastij marked this conversation as resolved.
Show resolved Hide resolved
"k8s.io/kubernetes/pkg/util/metrics",
"k8s.io/kubernetes/pkg/util/parsers",
"k8s.io/kubernetes/pkg/util/sysctl",
Expand Down Expand Up @@ -110,7 +108,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",
Expand Down
4 changes: 0 additions & 4 deletions cmd/kubeadm/app/cmd/phases/join/preflight.go
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions cmd/kubeadm/app/preflight/BUILD
Expand Up @@ -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",
Expand All @@ -39,8 +38,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": [],
}),
Expand Down
30 changes: 1 addition & 29 deletions cmd/kubeadm/app/preflight/checks.go
Expand Up @@ -49,7 +49,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"
)
Expand Down Expand Up @@ -865,20 +864,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
Expand Down Expand Up @@ -911,11 +900,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) {
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions cmd/kubeadm/app/preflight/checks_darwin.go
Expand Up @@ -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
}
13 changes: 0 additions & 13 deletions cmd/kubeadm/app/preflight/checks_linux.go
Expand Up @@ -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.
Expand All @@ -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
}
6 changes: 0 additions & 6 deletions cmd/kubeadm/app/preflight/checks_windows.go
Expand Up @@ -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
}