Skip to content

Commit 90002d1

Browse files
ndbaker1fletcherw
authored andcommitted
docs: add feature gate and version-specific behavior table
1 parent 18479f7 commit 90002d1

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

nodeadm/doc/api-concepts.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,18 @@ There are three levels of stability and support:
1818

1919
### Stable
2020
- Example: `v5`.
21-
- Support for a stable API will align with the support of a major version of Amazon Linux.
21+
- Support for a stable API will align with the support of a major version of Amazon Linux.
22+
23+
## Feature Gates
24+
25+
|Name|Default|Since|Until|
26+
|---|---|---|---|
27+
|`InstanceIdNodeName`|`false`|-|-|
28+
29+
## Behaviorial Boundaries
30+
31+
|Description|Since|Until|
32+
|---|---|---|
33+
|Apply the `nvidia.com/gpu.present=true` node label on startup if NVIDIA devices are detected on the instance|1.35|-|
34+
|Enable CDI in the default containerd configuration|1.32|-|
35+
|Write user-provided kubelet config as a kubelet drop-in configuration file|1.29|-|

nodeadm/internal/kubelet/config.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,13 @@ func (k *kubelet) GenerateKubeletConfig(cfg *api.NodeConfig) (*kubeletConfig, er
336336
kubeletConfig.withCloudProvider(cfg, k.flags)
337337
kubeletConfig.withDefaultReservedResources(cfg, k.resources)
338338
kubeletConfig.withImageServiceEndpoint(cfg, k.resources)
339-
kubeletConfig.withNodeLabels(k.flags, map[string]LabelValueFunc{
339+
340+
nodeLabelFuncs := map[string]LabelValueFunc{}
341+
if semver.Compare(cfg.Status.KubeletVersion, "v1.35.0") >= 0 {
340342
// see: https://github.com/NVIDIA/gpu-operator/commit/e25291b86cf4542ac62d8635cda4bd653c4face3
341-
"nvidia.com/gpu.present": getNvidiaGPULabel,
342-
})
343+
nodeLabelFuncs["nvidia.com/gpu.present"] = getNvidiaGPULabel
344+
}
345+
kubeletConfig.withNodeLabels(k.flags, nodeLabelFuncs)
343346

344347
return &kubeletConfig, nil
345348
}

nodeadm/test/e2e/cases/nvidia-gpu-labels/run.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -o pipefail
77
source /helpers.sh
88

99
mock::aws
10-
mock::kubelet 1.32.0
10+
mock::kubelet 1.35.0
1111
wait::dbus-ready
1212

1313
nodeadm init --skip run --config-source file://config.yaml
@@ -22,3 +22,12 @@ nodeadm init --skip run --config-source file://config.yaml
2222

2323
assert::file-contains /etc/eks/kubelet/environment '--node-labels=nvidia.com/gpu.present=true'
2424
assert::file-contains /etc/eks/kubelet/environment '--node-labels=foo=bar'
25+
26+
# the label is only applied start from Kubernetes 1.35+
27+
28+
mock::kubelet 1.34.0
29+
30+
nodeadm init --skip run --config-source file://config.yaml
31+
32+
assert::file-not-contains /etc/eks/kubelet/environment '--node-labels=nvidia.com/gpu.present=true'
33+
assert::file-contains /etc/eks/kubelet/environment '--node-labels=foo=bar'

0 commit comments

Comments
 (0)