[zh] sync concepts/cluster-administration/coordinated-leader-election.md

pull/50691/head
KKtheGhost 2025-04-27 02:02:27 +09:00
parent 8477eac549
commit bb66a95c7d
1 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ weight: 200
{{< feature-state feature_gate_name="CoordinatedLeaderElection" >}}
<!--
Kubernetes {{< skew currentVersion >}} includes an alpha feature that allows {{<
Kubernetes {{< skew currentVersion >}} includes a beta feature that allows {{<
glossary_tooltip text="control plane" term_id="control-plane" >}} components to
deterministically select a leader via _coordinated leader election_.
This is useful to satisfy Kubernetes version skew constraints during cluster upgrades.
@ -24,7 +24,7 @@ Currently, the only builtin selection strategy is `OldestEmulationVersion`,
preferring the leader with the lowest emulation version, followed by binary
version, followed by creation timestamp.
-->
Kubernetes {{< skew currentVersion >}} 包含一个 Alpha 特性,
Kubernetes {{< skew currentVersion >}} 包含一个 Beta 特性,
允许{{< glossary_tooltip text="控制平面" term_id="control-plane" >}}组件通过**协调领导者选举**确定性地选择一个领导者。
这对于在集群升级期间满足 Kubernetes 版本偏差约束非常有用。
目前,唯一内置的选择策略是 `OldestEmulationVersion`
@ -36,34 +36,34 @@ Kubernetes {{< skew currentVersion >}} 包含一个 Alpha 特性,
Ensure that `CoordinatedLeaderElection` [feature
gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled
when you start the {{< glossary_tooltip text="API Server"
term_id="kube-apiserver" >}}: and that the `coordination.k8s.io/v1alpha1` API group is
term_id="kube-apiserver" >}}: and that the `coordination.k8s.io/v1beta1` API group is
enabled.
-->
## 启用协调领导者选举 {#enabling-coordinated-leader-election}
确保你在启动 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}时
`CoordinatedLeaderElection` [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)被启用,
并且 `coordination.k8s.io/v1alpha1` API 组被启用。
并且 `coordination.k8s.io/v1beta1` API 组被启用。
<!--
This can be done by setting flags `--feature-gates="CoordinatedLeaderElection=true"` and
`--runtime-config="coordination.k8s.io/v1alpha1=true"`.
`--runtime-config="coordination.k8s.io/v1beta1=true"`.
-->
此操作可以通过设置 `--feature-gates="CoordinatedLeaderElection=true"`
`--runtime-config="coordination.k8s.io/v1alpha1=true"` 标志来完成。
`--runtime-config="coordination.k8s.io/v1beta1=true"` 标志来完成。
<!--
## Component configuration
Provided that you have enabled the `CoordinatedLeaderElection` feature gate _and_
have the `coordination.k8s.io/v1alpha1` API group enabled, compatible control plane
have the `coordination.k8s.io/v1beta1` API group enabled, compatible control plane
components automatically use the LeaseCandidate and Lease APIs to elect a leader
as needed.
-->
## 组件配置 {#component-configuration}
前提是你已启用 `CoordinatedLeaderElection` 特性门控**并且**
启用了 `coordination.k8s.io/v1alpha1` API 组,
启用了 `coordination.k8s.io/v1beta1` API 组,
兼容的控制平面组件会自动使用 LeaseCandidate 和 Lease API 根据需要选举领导者。
<!--