Skip to content

Commit

Permalink
fix: stop networkd before leaving etcd on 'reset' path
Browse files Browse the repository at this point in the history
The problem is with VIP and `reset` sequence: the order of operations
was that `etcd` was stopped first while `networkd` was still running,
and if the node owned the VIP at the time of the reset action, the lease
will be lost (as client connection is gone), so VIP will be unassigned
for a pretty long time.

This PR changes the order of operations: first, stop `networkd` and
other pods, and leave `etcd` last, so that VIP is released, and
`kube-apiserver` for example isn't left hanging on the node while `etcd`
is gone.

Fixes #3500

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed May 7, 2021
1 parent 610d38d commit 4ffd7c0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ func (*Sequencer) Reset(r runtime.Runtime, in runtime.ResetOptions) []runtime.Ph
in.GetGraceful(),
"drain",
CordonAndDrainNode,
).AppendWhen(
in.GetGraceful() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).AppendWhen(
in.GetGraceful(),
"cleanup",
Expand All @@ -325,6 +321,10 @@ func (*Sequencer) Reset(r runtime.Runtime, in runtime.ResetOptions) []runtime.Ph
"cleanup",
StopAllPods,
StopNetworkd,
).AppendWhen(
in.GetGraceful() && (r.Config().Machine().Type() != machine.TypeJoin),
"leave",
LeaveEtcd,
).AppendList(
stopAllPhaselist(r),
).AppendWhen(
Expand Down

0 comments on commit 4ffd7c0

Please sign in to comment.