Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait 10 seconds before upgrading next node #316

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pkg/upgrader/upgrade/upgrade_follower.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package upgrade

import (
"time"

"github.com/pkg/errors"

"github.com/kubermatic/kubeone/pkg/config"
Expand All @@ -29,29 +31,34 @@ func upgradeFollower(ctx *util.Context) error {
}

func upgradeFollowerExecutor(ctx *util.Context, node *config.HostConfig, conn ssh.Connection) error {
ctx.Logger.Infoln("Labeling follower control plane…")
logger := ctx.Logger.WithField("node", node.PublicAddress)

logger.Infoln("Labeling follower control plane…")
err := labelNode(ctx.DynamicClient, node)
if err != nil {
return errors.Wrap(err, "failed to label leader control plane node")
}

ctx.Logger.Infoln("Upgrading Kubernetes binaries on follower control plane…")
logger.Infoln("Upgrading Kubernetes binaries on follower control plane…")
err = upgradeKubernetesBinaries(ctx, node)
if err != nil {
return errors.Wrap(err, "failed to upgrade kubernetes binaries on follower control plane")
}

ctx.Logger.Infoln("Running 'kubeadm upgrade' on the follower control plane node…")
logger.Infoln("Running 'kubeadm upgrade' on the follower control plane node…")
err = upgradeFollowerControlPlane(ctx)
if err != nil {
return errors.Wrap(err, "failed to upgrade follower control plane")
}

ctx.Logger.Infoln("Unlabeling follower control plane…")
logger.Infoln("Unlabeling follower control plane…")
err = unlabelNode(ctx.DynamicClient, node)
if err != nil {
return errors.Wrap(err, "failed to unlabel follower control plane node")
}

logger.Infoln("Waiting 10 seconds to ensure all components are up…")
time.Sleep(10 * time.Second)

return nil
}
5 changes: 5 additions & 0 deletions pkg/upgrader/upgrade/upgrade_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package upgrade

import (
"time"

"github.com/pkg/errors"

"github.com/kubermatic/kubeone/pkg/config"
Expand Down Expand Up @@ -61,5 +63,8 @@ func upgradeLeaderExecutor(ctx *util.Context, node *config.HostConfig, conn ssh.
return errors.Wrap(err, "failed to unlabel leader control plane node")
}

logger.Infoln("Waiting 10 seconds to ensure all components are up…")
time.Sleep(10 * time.Second)

return nil
}