Merge pull request #8817 from sharifelgamal/restart-kubelet

restart kubelet if config changes
pull/8838/head
Sharif Elgamal 2020-07-24 15:48:53 -07:00 committed by GitHub
commit d546ea1b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -557,6 +557,11 @@ func (k *Bootstrapper) restartControlPlane(cfg config.ClusterConfig) error {
if err := k.stopKubeSystem(cfg); err != nil {
glog.Warningf("Failed to stop kube-system containers: port conflicts may arise: %v", err)
}
if err := sysinit.New(k.c).Stop("kubelet"); err != nil {
glog.Warningf("Failed to stop kubelet, this might cause upgrade errors: %v", err)
}
if err := k.clearStaleConfigs(cfg); err != nil {
return errors.Wrap(err, "clearing stale configs")
}
@ -567,6 +572,7 @@ func (k *Bootstrapper) restartControlPlane(cfg config.ClusterConfig) error {
baseCmd := fmt.Sprintf("%s %s", bsutil.InvokeKubeadm(cfg.KubernetesConfig.KubernetesVersion), phase)
cmds := []string{
fmt.Sprintf("%s phase kubelet-start --config %s", baseCmd, conf),
fmt.Sprintf("%s phase certs all --config %s", baseCmd, conf),
fmt.Sprintf("%s phase kubeconfig all --config %s", baseCmd, conf),
fmt.Sprintf("%s phase %s all --config %s", baseCmd, controlPlane, conf),

View File

@ -73,6 +73,7 @@ func WithError(msg string, err error) {
// WithProblem outputs info related to a known problem and exits.
func WithProblem(msg string, err error, p *problem.Problem) {
out.ErrT(out.Empty, "")
glog.Errorf("%+v\n", p)
out.FailureT("[{{.id}}] {{.msg}} {{.error}}", out.V{"msg": msg, "id": p.ID, "error": p.Err})
p.Display()
if p.ShowIssueLink {