diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 8931678798a..bb2eb83e7e6 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -1000,19 +1000,27 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.NodeConfigura criCtlChecker) } + var bridgenf6Check Checker for _, server := range cfg.DiscoveryTokenAPIServers { ipstr, _, err := net.SplitHostPort(server) if err == nil { - if ip := net.ParseIP(ipstr); ip != nil { - if ip.To4() == nil && ip.To16() != nil { - checks = append(checks, - FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, - ) - break // Ensure that check is added only once + checks = append(checks, + HTTPProxyCheck{Proto: "https", Host: ipstr}, + ) + if bridgenf6Check == nil { + if ip := net.ParseIP(ipstr); ip != nil { + if ip.To4() == nil && ip.To16() != nil { + // This check should be added only once + bridgenf6Check = FileContentCheck{Path: bridgenf6, Content: []byte{'1'}} + } } } } } + if bridgenf6Check != nil { + checks = append(checks, bridgenf6Check) + } + return RunChecks(checks, os.Stderr, ignorePreflightErrors) }