Skip to content

Commit 1cd8284

Browse files
Enable NodeFeature API by default in GFD
This change enables NodeFeature API in GFD. This results in GFD creating in a new NodeFeature CR on startup. This commit also removes the redundant `enableNodeFeatureApi` helm value NodeFeature is now enabled by default in NFD since it's v0.17.0 release. The k8s-device-plugin helm chart has been using NFD v0.17.3 subchart since k8s-device-plugin's v0.18.0 release, so NodeFeature API has been enabled by default since then and this helm value has had no effect. Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>
1 parent 624b771 commit 1cd8284

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

cmd/gpu-feature-discovery/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func main() {
9999
},
100100
&cli.BoolFlag{
101101
Name: "use-node-feature-api",
102+
Value: true,
102103
Usage: "Use NFD NodeFeature API to publish labels",
103104
EnvVars: []string{"GFD_USE_NODE_FEATURE_API", "USE_NODE_FEATURE_API"},
104105
},

deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{{- if .Values.gfd.enabled }}
1616
---
1717
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
18-
{{- $useServiceAccount := or ( $options.hasConfigMap ) ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
18+
{{- $useServiceAccount := or $options.hasConfigMap .Values.gfd.enabled }}
1919
{{- $configMapName := (include "nvidia-device-plugin.configMapName" .) | trim }}
2020
{{- $daemonsetName := printf "%s-gpu-feature-discovery" (include "nvidia-device-plugin.fullname" .) | trunc 63 | trimSuffix "-" }}
2121
apiVersion: apps/v1
@@ -161,10 +161,6 @@ spec:
161161
- name: GFD_SLEEP_INTERVAL
162162
value: {{ .Values.sleepInterval | quote }}
163163
{{- end }}
164-
{{- if typeIs "bool" .Values.nfd.enableNodeFeatureApi }}
165-
- name: GFD_USE_NODE_FEATURE_API
166-
value: {{ .Values.nfd.enableNodeFeatureApi | quote }}
167-
{{- end }}
168164
{{- if $options.hasConfigMap }}
169165
- name: CONFIG_FILE
170166
value: /config/config.yaml

deployments/helm/nvidia-device-plugin/templates/role-binding.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
3-
{{- if or $options.hasConfigMap ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
3+
{{- if or $options.hasConfigMap .Values.gfd.enabled }}
44
apiVersion: rbac.authorization.k8s.io/v1
55
kind: ClusterRoleBinding
66
metadata:

deployments/helm/nvidia-device-plugin/templates/role.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
3-
{{- if or $options.hasConfigMap ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
3+
{{- if or $options.hasConfigMap .Values.gfd.enabled }}
44
apiVersion: rbac.authorization.k8s.io/v1
55
kind: ClusterRole
66
metadata:
@@ -11,7 +11,7 @@ rules:
1111
- apiGroups: [""]
1212
resources: ["nodes"]
1313
verbs: ["get", "list", "watch"]
14-
{{- if and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi }}
14+
{{- if .Values.gfd.enabled }}
1515
- apiGroups: ["nfd.k8s-sigs.io"]
1616
resources: ["nodefeatures"]
1717
verbs: ["get", "list", "watch", "create", "update"]

deployments/helm/nvidia-device-plugin/templates/service-account.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
3-
{{- if or $options.hasConfigMap ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
3+
{{- if or $options.hasConfigMap .Values.gfd.enabled }}
44
apiVersion: v1
55
kind: ServiceAccount
66
metadata:

deployments/helm/nvidia-device-plugin/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ gfd:
118118
# Helm dependency
119119
nfd:
120120
nameOverride: node-feature-discovery
121-
enableNodeFeatureApi: false
122121
master:
123122
serviceAccount:
124123
name: node-feature-discovery

0 commit comments

Comments
 (0)