1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 23:16:22 +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

@@ -26,6 +26,16 @@ const (
func DeployCertificatesOnPlaneHost(ctx context.Context, host *hosts.Host, rkeConfig v3.RancherKubernetesEngineConfig, crtMap map[string]CertificatePKI, certDownloaderImage string, prsMap map[string]v3.PrivateRegistry, forceDeploy bool) error {
crtBundle := GenerateRKENodeCerts(ctx, rkeConfig, host.Address, crtMap)
env := []string{}
// Strip CA key as its sensitive and unneeded on nodes without controlplane role
if !host.IsControl {
caCert := crtBundle[CACertName]
caCert.Key = nil
caCert.KeyEnvName = ""
caCert.KeyPath = ""
crtBundle[CACertName] = caCert
}
for _, crt := range crtBundle {
env = append(env, crt.ToEnv()...)
}
@@ -192,7 +202,7 @@ func FetchCertificatesFromHost(ctx context.Context, extraHosts []*hosts.Host, ho
for _, etcdHost := range extraHosts {
// Fetch etcd certificates
crtList[GetEtcdCrtName(etcdHost.InternalAddress)] = false
crtList[GetCrtNameForHost(etcdHost, EtcdCertName)] = false
}
for certName, config := range crtList {