Skip to content

Commit 20d164c

Browse files
authored
Merge pull request #47469 from kubernetes/dev-1.31
Official 1.31 Release Docs
2 parents ad6351d + b1972bd commit 20d164c

File tree

108 files changed

+1841
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1841
-519
lines changed

content/en/docs/concepts/architecture/leases.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ This is used by control plane components like `kube-controller-manager` and `kub
3434
HA configurations, where only one instance of the component should be actively running while the other
3535
instances are on stand-by.
3636

37+
Read [coordinated leader election](/docs/concepts/cluster-administration/coordinated-leader-election)
38+
to learn about how Kubernetes builds on the Lease API to select which component instance
39+
acts as leader.
40+
3741
## API server identity
3842

3943
{{< feature-state feature_gate_name="APIServerIdentity" >}}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
reviewers:
3+
- jpbetz
4+
title: Coordinated Leader Election
5+
content_type: concept
6+
weight: 200
7+
---
8+
9+
<!-- overview -->
10+
11+
{{< feature-state feature_gate_name="CoordinatedLeaderElection" >}}
12+
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_.
16+
This is useful to satisfy Kubernetes version skew constraints during cluster upgrades.
17+
Currently, the only builtin selection strategy is `OldestEmulationVersion`,
18+
preferring the leader with the lowest emulation version, followed by binary
19+
version, followed by creation timestamp.
20+
21+
## Enabling coordinated leader election
22+
23+
Ensure that `CoordinatedLeaderElection` [feature
24+
gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled
25+
when you start the {{< glossary_tooltip text="API Server"
26+
term_id="kube-apiserver" >}}: and that the `coordination.k8s.io/v1alpha1` API group is
27+
enabled.
28+
29+
This can be done by setting flags `--feature-gates="CoordinatedLeaderElection=true"` and
30+
`--runtime-config="coordination.k8s.io/v1alpha1=true"`.
31+
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/concepts/configuration/manage-resources-containers.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ that file but the kubelet does not categorize the space as in use.
508508
{{% /tab %}}
509509
{{% tab name="Filesystem project quota" %}}
510510

511-
{{< feature-state for_k8s_version="v1.15" state="alpha" >}}
511+
{{< feature-state feature_gate_name="LocalStorageCapacityIsolationFSQuotaMonitoring" >}}
512512

513513
Project quotas are an operating-system level feature for managing
514514
storage use on filesystems. With Kubernetes, you can enable project
@@ -534,13 +534,21 @@ If a file is created and deleted, but has an open file descriptor,
534534
it continues to consume space. Quota tracking records that space accurately
535535
whereas directory scans overlook the storage used by deleted files.
536536

537+
To use quotas to track a pod's resource usage, the pod must be in
538+
a user namespace. Within user namespaces, the kernel restricts changes
539+
to projectIDs on the filesystem, ensuring the reliability of storage
540+
metrics calculated by quotas.
541+
537542
If you want to use project quotas, you should:
538543

539544
* Enable the `LocalStorageCapacityIsolationFSQuotaMonitoring=true`
540545
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
541546
using the `featureGates` field in the
542-
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/)
543-
or the `--feature-gates` command line flag.
547+
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
548+
549+
* Ensure the `UserNamespacesSupport`
550+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
551+
is enabled, and that the kernel, CRI implementation and OCI runtime support user namespaces.
544552

545553
* Ensure that the root filesystem (or optional runtime filesystem)
546554
has project quotas enabled. All XFS filesystems support project quotas.
@@ -556,6 +564,13 @@ If you want to use project quotas, you should:
556564
mounted with project quotas enabled. For both XFS and ext4fs, the
557565
mount option is named `prjquota`.
558566

567+
568+
If you don't want to use project quotas, you should:
569+
570+
* Disable the `LocalStorageCapacityIsolationFSQuotaMonitoring`
571+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
572+
using the `featureGates` field in the
573+
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
559574
{{% /tab %}}
560575
{{< /tabs >}}
561576

content/en/docs/concepts/extend-kubernetes/api-extension/custom-resources.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,10 @@ may also be used with field selectors when included in the `spec.versions[*].sel
315315

316316
{{< feature-state feature_gate_name="CustomResourceFieldSelectors" >}}
317317

318-
You need to enable the `CustomResourceFieldSelectors`
319-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to
320-
use this behavior, which then applies to all CustomResourceDefinitions in your
321-
cluster.
322-
323318
The `spec.versions[*].selectableFields` field of a {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} may be used to
324-
declare which other fields in a custom resource may be used in field selectors.
319+
declare which other fields in a custom resource may be used in field selectors
320+
with the feature of `CustomResourceFieldSelectors`
321+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) (This feature gate is enabled by default since Kubernetes v1.31).
325322
The following example adds the `.spec.color` and `.spec.size` fields as
326323
selectable fields.
327324

content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The general workflow of a device plugin includes the following steps:
160160
The processing of the fully-qualified CDI device names by the Device Manager requires
161161
that the `DevicePluginCDIDevices` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
162162
is enabled for both the kubelet and the kube-apiserver. This was added as an alpha feature in Kubernetes
163-
v1.28 and graduated to beta in v1.29.
163+
v1.28, graduated to beta in v1.29 and to GA in v1.31.
164164
{{< /note >}}
165165

166166
### Handling kubelet restarts
@@ -170,6 +170,35 @@ kubelet instance. A new kubelet instance deletes all the existing Unix sockets u
170170
`/var/lib/kubelet/device-plugins` when it starts. A device plugin can monitor the deletion
171171
of its Unix socket and re-register itself upon such an event.
172172

173+
### Device plugin and unhealthy devices
174+
175+
There are cases when devices fail or are shut down. The responsibility of the Device Plugin
176+
in this case is to notify the kubelet about the situation using the `ListAndWatchResponse` API.
177+
178+
Once a device is marked as unhealthy, the kubelet will decrease the allocatable count
179+
for this resource on the Node to reflect how many devices can be used for scheduling new pods.
180+
Capacity count for the resource will not change.
181+
182+
Pods that were assigned to the failed devices will continue be assigned to this device.
183+
It is typical that code relying on the device will start failing and Pod may get
184+
into Failed phase if `restartPolicy` for the Pod was not `Always` or enter the crash loop
185+
otherwise.
186+
187+
Before Kubernetes v1.31, the way to know whether or not a Pod is associated with the
188+
failed device is to use the [PodResources API](#monitoring-device-plugin-resources).
189+
190+
{{< feature-state feature_gate_name="ResourceHealthStatus" >}}
191+
192+
By enabling the feature gate `ResourceHealthStatus`, the field `allocatedResourcesStatus`
193+
will be added to each container status, within the `.status` for each Pod. The `allocatedResourcesStatus`
194+
field
195+
reports health information for each device assigned to the container.
196+
197+
For a failed Pod, or or where you suspect a fault, you can use this status to understand whether
198+
the Pod behavior may be associated with device failure. For example, if an accelerator is reporting
199+
an over-temperature event, the `allocatedResourcesStatus` field may be able to report this.
200+
201+
173202
## Device plugin deployment
174203

175204
You can deploy a device plugin as a DaemonSet, as a package for your node's operating system,

content/en/docs/concepts/scheduling-eviction/assign-pod-node.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ null `namespaceSelector` matches the namespace of the Pod where the rule is defi
363363
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
364364

365365
{{< note >}}
366-
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
367-
The `matchLabelKeys` field is an alpha-level field and is disabled by default in
366+
<!-- UPDATE THIS WHEN PROMOTING TO STABLE -->
367+
The `matchLabelKeys` field is a beta-level field and is enabled by default in
368368
Kubernetes {{< skew currentVersion >}}.
369-
When you want to use it, you have to enable it via the
369+
When you want to disable it, you have to disable it explicitly via the
370370
`MatchLabelKeysInPodAffinity` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
371371
{{< /note >}}
372372

@@ -414,10 +414,10 @@ spec:
414414
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
415415

416416
{{< note >}}
417-
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
418-
The `mismatchLabelKeys` field is an alpha-level field and is disabled by default in
417+
<!-- UPDATE THIS WHEN PROMOTING TO STABLE -->
418+
The `mismatchLabelKeys` field is a beta-level field and is enabled by default in
419419
Kubernetes {{< skew currentVersion >}}.
420-
When you want to use it, you have to enable it via the
420+
When you want to disable it, you have to disable it explicitly via the
421421
`MatchLabelKeysInPodAffinity` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
422422
{{< /note >}}
423423

0 commit comments

Comments
 (0)