Skip to content

Commit bf67dc5

Browse files
committed
Docs update for Node Declared Features (KEP-5328) alpha
1 parent 0fcc949 commit bf67dc5

File tree

5 files changed

+104
-0
lines changed

5 files changed

+104
-0
lines changed

content/en/docs/concepts/scheduling-eviction/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ of terminating one or more Pods on Nodes.
2525
* [Resource Bin Packing for Extended Resources](/docs/concepts/scheduling-eviction/resource-bin-packing/)
2626
* [Pod Scheduling Readiness](/docs/concepts/scheduling-eviction/pod-scheduling-readiness/)
2727
* [Descheduler](https://github.com/kubernetes-sigs/descheduler#descheduler-for-kubernetes)
28+
* [Node Declared Features](/docs/concepts/scheduling-eviction/node-declared-features/)
2829

2930
## Pod Disruption
3031

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Node Declared Features
3+
weight: 160
4+
---
5+
6+
{{< feature-state feature_gate_name="NodeDeclaredFeatures" >}}
7+
8+
Kubernetes nodes use _declared features_ to report the availability of specific
9+
features that are new or feature-gated. Control plane components
10+
utilize this information to make better decisions. The kube-scheduler, via the
11+
`NodeDeclaredFeatures` plugin, ensures pods are only placed on nodes that
12+
explicitly support the features the pod requires. Additionally, the
13+
`NodeDeclaredFeatureValidator` admission controller validates pod updates
14+
against a node's declared features.
15+
16+
This mechanism helps manage version skew and improve cluster stability,
17+
especially during cluster upgrades or in mixed-version environments where nodes
18+
might not all have the same features enabled. This is intended for Kubernetes
19+
feature developers introducing new node-level features and works in the
20+
background; application developers deploying Pods do not need to interact with
21+
this framework directly.
22+
23+
## How it Works
24+
25+
1. **Kubelet Feature Reporting:** At startup, the kubelet on each node detects
26+
which managed Kubernetes features are currently enabled and reports them
27+
in the `.status.declaredFeatures` field of the Node. Only features
28+
under active development are included in this field.
29+
2. **Scheduler Filtering:** The default kube-scheduler uses the
30+
`NodeDeclaredFeatures` plugin. This plugin:
31+
* In the `PreFilter` stage, checks the `PodSpec` to infer the set of node
32+
features required by the pod.
33+
* In the `Filter` stage, checks if the features listed in the node's
34+
`.status.declaredFeatures` satisfy the requirements inferred for the Pod.
35+
Pods will not be scheduled on nodes lacking the required features.
36+
Custom schedulers can also utilize the
37+
`.status.declaredFeatures` field to enforce similar constraints.
38+
3. **Admission Control:** The `nodedeclaredfeaturevalidator` admission controller
39+
can reject Pods that require features not declared by the node they are
40+
bound to, preventing issues during pod updates.
41+
42+
## Enabling node declared features
43+
44+
To use Node Declared Features, the `NodeDeclaredFeatures`
45+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/#NodeDeclaredFeatures)
46+
must be enabled on the `kube-apiserver`, `kube-scheduler`, and `kubelet`
47+
components.
48+
49+
## {{% heading "whatsnext" %}}
50+
51+
* Read the KEP for more details:
52+
[KEP-5328: Node Declared Features](https://github.com/kubernetes/enhancements/blob/6d3210f7dd5d547c8f7f6a33af6a09eb45193cd7/keps/sig-node/5328-node-declared-features/README.md)
53+
* Read about the [`NodeDeclaredFeatureValidator` admission controller](/docs/reference/access-authn-authz/admission-controllers/#nodedeclaredfeaturevalidator).

content/en/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,23 @@ A `Namespace` deletion kicks off a sequence of operations that remove all object
568568
etc.) in that namespace. In order to enforce integrity of that process, we strongly recommend
569569
running this admission controller.
570570

571+
### NodeDeclaredFeatureValidator {#nodedeclaredfeaturevalidator}
572+
573+
{{< feature-state feature_gate_name="NodeDeclaredFeatures" >}}
574+
575+
**Type**: Validating.
576+
577+
This admission controller intercepts writes to bound Pods, to ensure that the
578+
changes are compatible with the features declared by the node where the Pod is
579+
currently running. It uses the `.status.declaredFeatures` field of the Node to
580+
determine the set of enabled features. If a Pod update requires a feature that
581+
is not listed in the features of its current node, the admission controller
582+
will reject the update request. This prevents runtime failures due to feature
583+
mismatch after a Pod has been scheduled.
584+
585+
This admission controller is enabled by
586+
default if the [`NodeDeclaredFeatures`](/docs/reference/command-line-tools-reference/feature-gates/#NodeDeclaredFeatures) feature gate is enabled.
587+
571588
### NodeRestriction {#noderestriction}
572589

573590
**Type**: Validating.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: NodeDeclaredFeatures
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.35"
12+
---
13+
Enables Nodes to report supported features via their `.status`. This enables the
14+
scheduler and admission controller to prevent operations on nodes lacking features
15+
required by the pod. See [Node Declared Features](/docs/concepts/scheduling-eviction/node-declared-features/).

content/en/docs/reference/node/node-status.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ A Node's status contains the following information:
1717
* [Conditions](#condition)
1818
* [Capacity and Allocatable](#capacity)
1919
* [Info](#info)
20+
* [Declared Features](#declaredfeatures)
2021

2122
You can use `kubectl` to view a Node's status and other details:
2223

@@ -109,6 +110,23 @@ operating system the node uses.
109110
The kubelet gathers this information from the node and publishes it into
110111
the Kubernetes API.
111112

113+
## Declared features {#declaredfeatures}
114+
115+
{{< feature-state feature_gate_name="NodeDeclaredFeatures" >}}
116+
117+
This field lists specific Kubernetes features that are currently enabled on the
118+
node's kubelet via [feature gates](/docs/reference/command-line-tools-reference/feature-gates/).
119+
The features are reported by the kubelet as a list of strings in the
120+
`.status.declaredFeatures` field of the Node object.
121+
122+
This field is intended for newer features under active development; features that
123+
have graduated and no longer require a feature gate are considered baseline and
124+
are not declared in this field. This reflects the enablement of Kubernetes
125+
features, not the underlying operating system or kernel capabilities of the node.
126+
127+
See [Node Declared Features](/docs/concepts/scheduling-eviction/node-declared-features/)
128+
for more details.
129+
112130
## Heartbeats
113131

114132
Heartbeats, sent by Kubernetes nodes, help your cluster determine the

0 commit comments

Comments
 (0)