fix: distribute PKI from initial master to joining masters (#426)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
parent
b59f632ef4
commit
7528d892c4
@ -43,7 +43,7 @@ func (k *Kubeadm) ID(data *userdata.UserData) string {
|
||||
|
||||
// PreFunc implements the Service interface.
|
||||
func (k *Kubeadm) PreFunc(data *userdata.UserData) (err error) {
|
||||
if data.IsMaster() {
|
||||
if data.IsBootstrap() {
|
||||
if err = writeKubeadmPKIFiles(data.Security.Kubernetes.CA); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -58,7 +58,7 @@ func (k *Kubeadm) PreFunc(data *userdata.UserData) (err error) {
|
||||
|
||||
// PostFunc implements the Service interface.
|
||||
func (k *Kubeadm) PostFunc(data *userdata.UserData) error {
|
||||
if data.IsWorker() {
|
||||
if !data.IsBootstrap() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,9 @@ func (g *Generator) Certificate(in *proto.CertificateRequest) (resp *proto.Certi
|
||||
// Identity creates a CSR and sends it to trustd for signing.
|
||||
// A signed certificate is returned.
|
||||
func (g *Generator) Identity(data *userdata.UserData) (err error) {
|
||||
if data.Security == nil {
|
||||
data.Security = &userdata.Security{}
|
||||
}
|
||||
data.Security.OS = &userdata.OSSecurity{CA: &x509.PEMEncodedCertificateAndKey{}}
|
||||
var csr *x509.CertificateSigningRequest
|
||||
if csr, err = data.NewIdentityCSR(); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user