Skip to content

Commit a179212

Browse files
committed
feat(helm): Allow control of hostUsers
Fixes: #2397 Signed-off-by: Pat Riehecky <[email protected]>
1 parent 4a47517 commit a179212

File tree

8 files changed

+64
-0
lines changed

8 files changed

+64
-0
lines changed

deployment/helm/node-feature-discovery/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ NFD.
175175
| master.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/master-commandline-reference) to pass to nfd-master. |
176176
| master.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-master container. |
177177
| master.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
178+
| master.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
178179
| master.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD master pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). |
179180
| master.config | string | `nil` | NFD master [configuration](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/master-configuration-reference). |
180181
| master.port | int | `8080` | Port on which to serve http for metrics and healthz endpoints. |
@@ -228,6 +229,7 @@ NFD.
228229
| worker.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/worker-commandline-reference) to pass to nfd-worker. |
229230
| worker.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-worker container. |
230231
| worker.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
232+
| worker.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
231233
| worker.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD worker pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
232234
| worker.config | string | `nil` | NFD worker [configuration](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/worker-configuration-reference). |
233235
| worker.port | int | `8080` | Port on which to serve http for metrics and healthz endpoints. |
@@ -271,6 +273,7 @@ NFD.
271273
| topologyUpdater.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/topology-updater-commandline-reference) to pass to nfd-topology-updater. |
272274
| topologyUpdater.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-topology-updater container. |
273275
| topologyUpdater.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
276+
| topologyUpdater.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
274277
| topologyUpdater.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD topology updater pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
275278
| topologyUpdater.serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |
276279
| topologyUpdater.serviceAccount.annotations | object | `{}` | [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations) to add to the service account. |
@@ -314,6 +317,7 @@ NFD.
314317
| gc.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/gc-commandline-reference) to pass to nfd-gc. |
315318
| gc.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-gc container. |
316319
| gc.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
320+
| gc.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
317321
| gc.replicaCount | int | `1` | The number of desired replicas for the nfd-gc Deployment. |
318322
| gc.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD gc pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
319323
| gc.serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |

deployment/helm/node-feature-discovery/templates/master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ spec:
4242
securityContext:
4343
{{- toYaml .Values.master.podSecurityContext | nindent 8 }}
4444
hostNetwork: {{ .Values.master.hostNetwork }}
45+
{{- if kindIs "bool" .Values.master.hostUsers }}
46+
hostUsers: {{ .Values.master.hostUsers }}
47+
{{- end }}
4548
containers:
4649
- name: master
4750
securityContext:

deployment/helm/node-feature-discovery/templates/nfd-gc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ spec:
4040
securityContext:
4141
{{- toYaml .Values.gc.podSecurityContext | nindent 8 }}
4242
hostNetwork: {{ .Values.gc.hostNetwork }}
43+
{{- if kindIs "bool" .Values.gc.hostUsers }}
44+
hostUsers: {{ .Values.gc.hostUsers }}
45+
{{- end }}
4346
containers:
4447
- name: gc
4548
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

deployment/helm/node-feature-discovery/templates/topologyupdater.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ spec:
4040
securityContext:
4141
{{- toYaml .Values.topologyUpdater.podSecurityContext | nindent 8 }}
4242
hostNetwork: {{ .Values.topologyUpdater.hostNetwork }}
43+
{{- if kindIs "bool" .Values.topologyUpdater.hostUsers }}
44+
hostUsers: {{ .Values.topologyUpdater.hostUsers }}
45+
{{- end }}
4346
containers:
4447
- name: topology-updater
4548
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

deployment/helm/node-feature-discovery/templates/worker.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ spec:
4444
securityContext:
4545
{{- toYaml .Values.worker.podSecurityContext | nindent 8 }}
4646
hostNetwork: {{ .Values.worker.hostNetwork }}
47+
{{- if kindIs "bool" .Values.worker.hostUsers }}
48+
hostUsers: {{ .Values.worker.hostUsers }}
49+
{{- end }}
4750
containers:
4851
- name: worker
4952
securityContext:

deployment/helm/node-feature-discovery/values.schema.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
"description": "Run the container in the host's network namespace.",
5656
"type": "boolean"
5757
},
58+
"hostUsers": {
59+
"description": "Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.",
60+
"type": [
61+
"boolean",
62+
"null"
63+
]
64+
},
5865
"interval": {
5966
"description": "Time between periodic garbage collector runs.",
6067
"type": "string"
@@ -328,6 +335,13 @@
328335
"description": "Run the container in the host's network namespace.",
329336
"type": "boolean"
330337
},
338+
"hostUsers": {
339+
"description": "Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.",
340+
"type": [
341+
"boolean",
342+
"null"
343+
]
344+
},
331345
"instance": {
332346
"description": "Instance name. Used to separate annotation namespaces for multiple parallel deployments.",
333347
"type": [
@@ -645,6 +659,13 @@
645659
"description": "Run the container in the host's network namespace.",
646660
"type": "boolean"
647661
},
662+
"hostUsers": {
663+
"description": "Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.",
664+
"type": [
665+
"boolean",
666+
"null"
667+
]
668+
},
648669
"kubeletConfigPath": {
649670
"description": "Host path for the kubelet config file.",
650671
"type": [
@@ -878,6 +899,13 @@
878899
"description": "Run the container in the host's network namespace.",
879900
"type": "boolean"
880901
},
902+
"hostUsers": {
903+
"description": "Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.",
904+
"type": [
905+
"boolean",
906+
"null"
907+
]
908+
},
881909
"labels": {
882910
"description": "[Labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to add to the nfd-worker pods.",
883911
"$ref": "#/$defs/_definitions.json/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels",

deployment/helm/node-feature-discovery/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ master:
6565
# -- Run the container in the host's network namespace.
6666
# @section -- NFD-Master
6767
hostNetwork: false
68+
# @schema type: [boolean, null]
69+
# -- Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.
70+
# @section -- NFD-Master
71+
hostUsers: NULL
6872
# @enum: [Default, ClusterFirst, ClusterFirstWithHostNet, None]
6973
# -- NFD master pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy).
7074
# @section -- NFD-Master
@@ -342,6 +346,10 @@ worker:
342346
# -- Run the container in the host's network namespace.
343347
# @section -- NFD-Worker
344348
hostNetwork: false
349+
# @schema type: [boolean, null]
350+
# -- Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.
351+
# @section -- NFD-Worker
352+
hostUsers: NULL
345353
# @enum: [Default, ClusterFirst, ClusterFirstWithHostNet, None]
346354
# -- NFD worker pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy).
347355
# @section -- NFD-Worker
@@ -768,6 +776,10 @@ topologyUpdater:
768776
# -- Run the container in the host's network namespace.
769777
# @section -- NFD-Topology-Updater
770778
hostNetwork: false
779+
# @schema type: [boolean, null]
780+
# -- Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.
781+
# @section -- NFD-Topology-Updater
782+
hostUsers: NULL
771783
# @enum: [Default, ClusterFirst, ClusterFirstWithHostNet, None]
772784
# -- NFD topology updater pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy).
773785
# @section -- NFD-Topology-Updater
@@ -936,6 +948,10 @@ gc:
936948
# -- Run the container in the host's network namespace.
937949
# @section -- NFD-GC
938950
hostNetwork: false
951+
# @schema type: [boolean, null]
952+
# -- Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true.
953+
# @section -- NFD-GC
954+
hostUsers: NULL
939955
# -- The number of desired replicas for the nfd-gc Deployment.
940956
# @section -- NFD-GC
941957
replicaCount: 1

docs/deployment/helm.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ NFD.
193193
| master.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/master-commandline-reference) to pass to nfd-master. |
194194
| master.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-master container. |
195195
| master.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
196+
| master.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
196197
| master.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD master pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). |
197198
| master.config | string | `nil` | NFD master [configuration](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/master-configuration-reference). |
198199
| master.port | int | `8080` | Port on which to serve http for metrics and healthz endpoints. |
@@ -246,6 +247,7 @@ NFD.
246247
| worker.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/worker-commandline-reference) to pass to nfd-worker. |
247248
| worker.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-worker container. |
248249
| worker.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
250+
| worker.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
249251
| worker.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD worker pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
250252
| worker.config | string | `nil` | NFD worker [configuration](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/worker-configuration-reference). |
251253
| worker.port | int | `8080` | Port on which to serve http for metrics and healthz endpoints. |
@@ -289,6 +291,7 @@ NFD.
289291
| topologyUpdater.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/topology-updater-commandline-reference) to pass to nfd-topology-updater. |
290292
| topologyUpdater.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-topology-updater container. |
291293
| topologyUpdater.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
294+
| topologyUpdater.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
292295
| topologyUpdater.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD topology updater pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
293296
| topologyUpdater.serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |
294297
| topologyUpdater.serviceAccount.annotations | object | `{}` | [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations) to add to the service account. |
@@ -332,6 +335,7 @@ NFD.
332335
| gc.extraArgs | list | `[]` | Additional [command line arguments](https://kubernetes-sigs.github.io/node-feature-discovery/master/reference/gc-commandline-reference) to pass to nfd-gc. |
333336
| gc.extraEnvs | list | `[]` | Additional environment variables to set in the nfd-gc container. |
334337
| gc.hostNetwork | bool | `false` | Run the container in the host's network namespace. |
338+
| gc.hostUsers | string | `nil` | Run the container with host user ids. NOTE: if hostNetwork is true, hostUsers should be true. |
335339
| gc.replicaCount | int | `1` | The number of desired replicas for the nfd-gc Deployment. |
336340
| gc.dnsPolicy | string | `"ClusterFirstWithHostNet"` | NFD gc pod [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-policy). |
337341
| gc.serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |

0 commit comments

Comments
 (0)