diff --git a/cluster/plan.go b/cluster/plan.go index 1c702592..0295feeb 100644 --- a/cluster/plan.go +++ b/cluster/plan.go @@ -19,7 +19,7 @@ import ( "github.com/rancher/rke/pki" "github.com/rancher/rke/services" "github.com/rancher/rke/util" - "github.com/rancher/types/apis/management.cattle.io/v3" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" "github.com/sirupsen/logrus" ) @@ -350,6 +350,11 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string, svcOp "pod-infra-container-image": c.Services.Kubelet.InfraContainerImage, "root-dir": path.Join(prefixPath, "/var/lib/kubelet"), } + + if c.DinD { + CommandArgs["healthz-bind-address"] = "0.0.0.0" + } + if host.IsControl && !host.IsWorker { CommandArgs["register-with-taints"] = unschedulableControlTaint } @@ -435,7 +440,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string, svcOp Binds = append(Binds, c.Services.Kubelet.ExtraBinds...) healthCheck := v3.HealthCheck{ - URL: services.GetHealthCheckURL(true, services.KubeletPort), + URL: services.GetHealthCheckURL(false, services.KubeletPort), } registryAuthConfig, _, _ := docker.GetImageRegistryConfig(c.Services.Kubelet.Image, c.PrivateRegistriesMap) diff --git a/services/healthcheck.go b/services/healthcheck.go index 257169d5..ad6f0c61 100644 --- a/services/healthcheck.go +++ b/services/healthcheck.go @@ -33,14 +33,6 @@ func runHealthcheck(ctx context.Context, host *hosts.Host, serviceName string, l if err != nil { return err } - if serviceName == KubeletContainerName { - certificate := cert.EncodeCertPEM(certMap[pki.KubeNodeCertName].Certificate) - key := cert.EncodePrivateKeyPEM(certMap[pki.KubeNodeCertName].Key) - x509Pair, err = tls.X509KeyPair(certificate, key) - if err != nil { - return err - } - } if serviceName == KubeAPIContainerName { certificate := cert.EncodeCertPEM(certMap[pki.KubeAPICertName].Certificate) key := cert.EncodePrivateKeyPEM(certMap[pki.KubeAPICertName].Key) diff --git a/services/services.go b/services/services.go index ca7577c5..0f0fa881 100644 --- a/services/services.go +++ b/services/services.go @@ -10,7 +10,7 @@ import ( "github.com/rancher/rke/hosts" "github.com/rancher/rke/log" "github.com/rancher/rke/util" - "github.com/rancher/types/apis/management.cattle.io/v3" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" "github.com/sirupsen/logrus" ) @@ -43,7 +43,7 @@ const ( KubeAPIPort = 6443 SchedulerPort = 10251 KubeControllerPort = 10252 - KubeletPort = 10250 + KubeletPort = 10248 KubeproxyPort = 10256 WorkerThreads = util.WorkerThreads