Merge pull request #7424 from medyagh/paralel_kubeadm

do kubeadm post init in parallel
pull/7527/head
Thomas Strömberg 2020-04-08 11:38:12 -07:00 committed by GitHub
commit d7bb5a8833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 9 deletions

View File

@ -21,6 +21,7 @@ import (
"context"
"os/exec"
"path"
"sync"
"fmt"
"net"
@ -238,17 +239,30 @@ func (k *Bootstrapper) init(cfg config.ClusterConfig) error {
}
}
if err := k.applyNodeLabels(cfg); err != nil {
glog.Warningf("unable to apply node labels: %v", err)
}
var wg sync.WaitGroup
wg.Add(3)
if err := bsutil.AdjustResourceLimits(k.c); err != nil {
glog.Warningf("unable to adjust resource limits: %v", err)
}
go func() {
if err := k.applyNodeLabels(cfg); err != nil {
glog.Warningf("unable to apply node labels: %v", err)
}
wg.Done()
}()
if err := k.elevateKubeSystemPrivileges(cfg); err != nil {
glog.Warningf("unable to create cluster role binding, some addons might not work: %v", err)
}
go func() {
if err := bsutil.AdjustResourceLimits(k.c); err != nil {
glog.Warningf("unable to adjust resource limits: %v", err)
}
wg.Done()
}()
go func() {
if err := k.elevateKubeSystemPrivileges(cfg); err != nil {
glog.Warningf("unable to create cluster role binding, some addons might not work: %v", err)
}
wg.Done()
}()
wg.Wait()
return nil
}