Skip to content

Commit 80e2409

Browse files
committed
Comments
1 parent 8ed531d commit 80e2409

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed

content/en/docs/concepts/cluster-administration/coordinated-leader-election.md

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ weight: 200
1010

1111
{{< feature-state feature_gate_name="CoordinatedLeaderElection" >}}
1212

13-
Kubernetes {{< skew currentVersion >}} includes an alpha feature that allows
14-
{{< glossary_tooltip text="control plane" term_id="control-plane" >}} components to deterministically select a leader via _coordinated leader election.
13+
Kubernetes {{< skew currentVersion >}} includes an alpha feature that allows {{<
14+
glossary_tooltip text="control plane" term_id="control-plane" >}} components to
15+
deterministically select a leader via _coordinated leader election_.
1516
This is useful to satisfy Kubernetes version skew constraints during cluster upgrades.
1617
Currently, the only builtin selection strategy is `OldestEmulationVersion`,
1718
preferring the leader with the lowest emulation version, followed by binary
@@ -22,35 +23,18 @@ version, followed by creation timestamp.
2223
Ensure that `CoordinatedLeaderElection` [feature
2324
gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled
2425
when you start the {{< glossary_tooltip text="API Server"
25-
term_id="kube-apiserver" >}}: and that the `coordination.k8s.io/v1alpha1` API is
26+
term_id="kube-apiserver" >}}: and that the `coordination.k8s.io/v1alpha1` API group is
2627
enabled.
2728

2829
This can be done by setting flags `--feature-gates="CoordinatedLeaderElection=true"` and
2930
`--runtime-config="coordination.k8s.io/v1alpha1=true"`.
3031

31-
## Component Configuration
32-
33-
With Coordinated Leader Election, components need to both run a LeaseCandidate
34-
and Lease goroutine (both found in client-go/pkg/leaderelection). Two components
35-
(kube-controller-manager and kube-scheduler) will automatically use coordinated
36-
leader election if enabled. Please refer to the example found in
37-
[k8s.io/kubernetes/cmd/kube-scheduler/app/server.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-scheduler/app/server.go) on set up.
38-
39-
The created LeaseCandidate object looks similar to below:
40-
41-
```
42-
apiVersion: coordination.k8s.io/v1alpha1
43-
kind: LeaseCandidate
44-
metadata:
45-
name: hostname_uuid
46-
namespace: kube-system
47-
spec:
48-
binaryVersion: 1.31.0
49-
emulationVersion: 1.31.0
50-
leaseName: kube-scheduler
51-
preferredStrategies:
52-
- OldestEmulationVersion
53-
renewTime: "2024-07-30T03:45:18.325483Z"
54-
```
55-
56-
Please refer to the [documentation](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#leasecandidate-v1alpha1-coordination-k8s-io) for LeaseCandidate for the full API details.
32+
## Component configuration
33+
Provided that you have enabled the `CoordinatedLeaderElection` feature gate _and_
34+
have the `coordination.k8s.io/v1alpha1` API group enabled, compatible control plane
35+
components automatically use the LeaseCandidate and Lease APIs to elect a leader
36+
as needed.
37+
38+
For Kubernetes {{< skew currentVersion >}}, two control plane components
39+
(kube-controller-manager and kube-scheduler) automatically use coordinated
40+
leader election when the feature gate and API group are enabled.

content/en/docs/reference/kubernetes-api/cluster-resources/lease-candidate-v1alpha1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ api_metadata:
55
kind: "LeaseCandidate"
66
content_type: "api_reference"
77
description: "This is a placeholder page to be overwritten when the docs are generated for 1.31"
8-
title: "Lease Candidate"
8+
title: "LeaseCandidate"
99
weight: 5
1010
---
1111

0 commit comments

Comments
 (0)