Skip to content

Commit

Permalink
fix: stop networkd and pods before leaving etcd on upgrade
Browse files Browse the repository at this point in the history
The change is essentially same as #3590, but applied to the upgrade path
which is very similar to the reset path.

We have to stop networkd (and remove the VIP/lease on the VIP) before we
leave and stop etcd. Plus we stop the kube-apiserver before the etcd is
stopped, so that we don't have unhealthy kube-apiserver.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed May 14, 2021
1 parent bed6b15 commit 0825cf1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,14 @@ func (*Sequencer) StageUpgrade(r runtime.Runtime, in *machineapi.UpgradeRequest)
case runtime.ModeContainer:
return nil
default:
phases = phases.AppendWhen(
!in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).Append(
phases = phases.Append(
"cleanup",
StopAllPods,
StopNetworkd,
).AppendWhen(
!in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).AppendList(
stopAllPhaselist(r),
).Append(
Expand All @@ -401,10 +401,6 @@ func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []ru
phases = phases.Append(
"drain",
CordonAndDrainNode,
).AppendWhen(
!in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).AppendWhen(
!in.GetPreserve(),
"cleanup",
Expand All @@ -415,6 +411,10 @@ func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []ru
"cleanup",
StopAllPods,
StopNetworkd,
).AppendWhen(
!in.GetPreserve() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).Append(
"stopServices",
StopServicesForUpgrade,
Expand Down

0 comments on commit 0825cf1

Please sign in to comment.