Menu

A Kubernetes Lease Is Not a Fencing Token
πŸ“°

A Kubernetes Lease Is Not a Fencing Token

DEV Community: kubernetesΒ·Zen Mesh Inc.Β·about 11 hours ago
#UaCNXfbn
#devtokubernetes#devto#dev#leader#authority
Reading 0:00
15s threshold

This is article 3 of 10 in Beyond Kubernetes Defaults . Read article 2: Kubernetes Has Garbage Collection. Why Did We Build Another One? first, or start with article 1: When Kubernetes Primitives Aren't Enough . Later articles cover custody, admission and more.

Kubernetes makes leader election straightforward.

With controller-runtime or the Lease API, replicas compete for a Lease and one becomes leader. When that leader stops renewing, another replica can take over.

For many controllers, that is sufficient.

For systems where leader-only actions mutate durable authority, we found a second question matters just as much:

How do we prove that the old leader can no longer act?

That is a fencing problem.

Election and fencing are different properties

Suppose replica A holds leadership.

A = leader B = follower

Enter fullscreen mode

Exit fullscreen mode

A pauses during a network or runtime failure.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.