Skip to content

Commit

Permalink
draining was a mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
kke committed Nov 28, 2024
1 parent f32ea2c commit 6677dc8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions phase/reinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ func (p *Reinstall) reinstall(h *cluster.Host) error {
return err
}

log.Infof("%s: draining node %s", p.Config.Spec.K0sLeader(), h)
if err := p.Config.Spec.K0sLeader().DrainNode(h); err != nil {
return fmt.Errorf("failed to drain node %s: %w", h, err)
}

err = p.Wet(h, "restart k0s service", func() error {
if err := h.Configurer.RestartService(h, h.K0sServiceName()); err != nil {
return fmt.Errorf("failed to restart k0s: %w", err)
Expand All @@ -112,14 +107,6 @@ func (p *Reinstall) reinstall(h *cluster.Host) error {
if err != nil {
return fmt.Errorf("restart after reinstall: %w", err)
}
log.Infof("%s: uncordoning node %s", p.Config.Spec.K0sLeader(), h)
if err := p.Config.Spec.K0sLeader().UncordonNode(h); err != nil {
return fmt.Errorf("failed to uncordon node %s: %w", h, err)
}

// if h != p.Config.Spec.K0sLeader() {
// return nil
// }

log.Infof("%s: waiting for system pods to become ready", h)
if err := retry.Timeout(context.TODO(), 10*time.Minute, node.SystemPodsRunningFunc(h)); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/node/statusfunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func SystemPodsRunningFunc(h *cluster.Host) retryFunc {
running++
for _, c := range p.Status.ContainerStatuses {
if !c.Ready {
log.Debugf("%s: container %s of %s not ready %s (%s)", h, c.Name, p.Name, c.State.Waiting.Reason, c.State.Waiting.Message)
log.Debugf("%s: container %s not ready %s (%s)", h, c.Name, c.State.Waiting.Reason, c.State.Waiting.Message)
continue
}
ready++
Expand Down

0 comments on commit 6677dc8

Please sign in to comment.