1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Add per node kubelet server certificate

This commit is contained in:
Sebastiaan van Steenis
2019-07-24 22:25:14 +02:00
committed by Alena Prokharchyk
parent e811e18fb3
commit adc5941fd9
10 changed files with 213 additions and 84 deletions

View File

@@ -222,6 +222,10 @@ func (c *Cluster) BuildKubeAPIProcess(host *hosts.Host, prefixPath string, svcOp
CommandArgs["experimental-encryption-provider-config"] = EncryptionProviderFilePath
}
if c.IsKubeletGenerateServingCertificateEnabled() {
CommandArgs["kubelet-certificate-authority"] = pki.GetCertPath(pki.CACertName)
}
serviceOptions := c.GetKubernetesServicesOptions(host.DockerInfo.OSType, svcOptionData)
if serviceOptions.KubeAPI != nil {
for k, v := range serviceOptions.KubeAPI {
@@ -451,6 +455,11 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string, svcOp
CommandArgs["cloud-config"] = path.Join(prefixPath, cloudConfigFileName)
}
}
if c.IsKubeletGenerateServingCertificateEnabled() {
CommandArgs["tls-cert-file"] = pki.GetCertPath(pki.GetCrtNameForHost(host, pki.KubeletCertName))
CommandArgs["tls-private-key-file"] = pki.GetCertPath(fmt.Sprintf("%s-key", pki.GetCrtNameForHost(host, pki.KubeletCertName)))
}
if len(c.CloudProvider.Name) > 0 {
c.Services.Kubelet.ExtraEnv = append(
c.Services.Kubelet.ExtraEnv,
@@ -891,7 +900,7 @@ func (c *Cluster) BuildSidecarProcess(host *hosts.Host, prefixPath string) v3.Pr
}
func (c *Cluster) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host, prefixPath string) v3.Process {
nodeName := pki.GetEtcdCrtName(host.InternalAddress)
nodeName := pki.GetCrtNameForHost(host, pki.EtcdCertName)
initCluster := ""
architecture := "amd64"
if len(etcdHosts) == 0 {