Skip to content

Commit

Permalink
Merge pull request #8817 from sharifelgamal/restart-kubelet
Browse files Browse the repository at this point in the history
restart kubelet if config changes
  • Loading branch information
sharifelgamal authored Jul 24, 2020
2 parents cdfe6ef + b9c2182 commit d546ea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/minikube/bootstrapper/kubeadm/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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),
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/exit/exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d546ea1

Please sign in to comment.