diff --git a/deployment/helm/node-feature-discovery/templates/cert-manager-certs.yaml b/deployment/helm/node-feature-discovery/templates/cert-manager-certs.yaml index c4fd00784..8af115316 100644 --- a/deployment/helm/node-feature-discovery/templates/cert-manager-certs.yaml +++ b/deployment/helm/node-feature-discovery/templates/cert-manager-certs.yaml @@ -1,4 +1,5 @@ {{- if .Values.tls.certManager }} +{{- if .Values.master.enable }} --- apiVersion: cert-manager.io/v1 kind: Certificate @@ -21,8 +22,9 @@ spec: name: nfd-ca-issuer kind: Issuer group: cert-manager.io - +{{- end }} --- +{{- if .Values.worker.enable }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: @@ -40,6 +42,7 @@ spec: name: nfd-ca-issuer kind: Issuer group: cert-manager.io +{{- end }} {{- if .Values.topologyUpdater.enable }} --- diff --git a/deployment/helm/node-feature-discovery/templates/clusterrole.yaml b/deployment/helm/node-feature-discovery/templates/clusterrole.yaml index d4329338b..e652e1df8 100644 --- a/deployment/helm/node-feature-discovery/templates/clusterrole.yaml +++ b/deployment/helm/node-feature-discovery/templates/clusterrole.yaml @@ -1,4 +1,4 @@ -{{- if .Values.master.rbac.create }} +{{- if and .Values.master.enable .Values.master.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/deployment/helm/node-feature-discovery/templates/clusterrolebinding.yaml b/deployment/helm/node-feature-discovery/templates/clusterrolebinding.yaml index 87b3003e2..99134a1c5 100644 --- a/deployment/helm/node-feature-discovery/templates/clusterrolebinding.yaml +++ b/deployment/helm/node-feature-discovery/templates/clusterrolebinding.yaml @@ -1,4 +1,4 @@ -{{- if .Values.master.rbac.create }} +{{- if and .Values.master.enable .Values.master.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/deployment/helm/node-feature-discovery/templates/master.yaml b/deployment/helm/node-feature-discovery/templates/master.yaml index 7e7cdcce6..53a291e0f 100644 --- a/deployment/helm/node-feature-discovery/templates/master.yaml +++ b/deployment/helm/node-feature-discovery/templates/master.yaml @@ -1,3 +1,4 @@ +{{- if .Values.master.enable }} apiVersion: apps/v1 kind: Deployment metadata: @@ -141,3 +142,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} diff --git a/deployment/helm/node-feature-discovery/templates/nfd-master-conf.yaml b/deployment/helm/node-feature-discovery/templates/nfd-master-conf.yaml index c806a8e5d..9c6e01cde 100644 --- a/deployment/helm/node-feature-discovery/templates/nfd-master-conf.yaml +++ b/deployment/helm/node-feature-discovery/templates/nfd-master-conf.yaml @@ -1,3 +1,4 @@ +{{- if .Values.master.enable }} apiVersion: v1 kind: ConfigMap metadata: @@ -8,3 +9,4 @@ metadata: data: nfd-master.conf: |- {{- .Values.master.config | toYaml | nindent 4 }} +{{- end }} diff --git a/deployment/helm/node-feature-discovery/templates/nfd-worker-conf.yaml b/deployment/helm/node-feature-discovery/templates/nfd-worker-conf.yaml index 61d2a481a..a2299dea1 100644 --- a/deployment/helm/node-feature-discovery/templates/nfd-worker-conf.yaml +++ b/deployment/helm/node-feature-discovery/templates/nfd-worker-conf.yaml @@ -1,3 +1,4 @@ +{{- if .Values.worker.enable }} apiVersion: v1 kind: ConfigMap metadata: @@ -8,3 +9,4 @@ metadata: data: nfd-worker.conf: |- {{- .Values.worker.config | toYaml | nindent 4 }} +{{- end }} diff --git a/deployment/helm/node-feature-discovery/templates/role.yaml b/deployment/helm/node-feature-discovery/templates/role.yaml index c71ede442..3a872e572 100644 --- a/deployment/helm/node-feature-discovery/templates/role.yaml +++ b/deployment/helm/node-feature-discovery/templates/role.yaml @@ -1,4 +1,4 @@ -{{- if .Values.worker.rbac.create }} +{{- if and .Values.worker.enable .Values.worker.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: diff --git a/deployment/helm/node-feature-discovery/templates/rolebinding.yaml b/deployment/helm/node-feature-discovery/templates/rolebinding.yaml index d8025be9b..a640d5f8b 100644 --- a/deployment/helm/node-feature-discovery/templates/rolebinding.yaml +++ b/deployment/helm/node-feature-discovery/templates/rolebinding.yaml @@ -1,4 +1,4 @@ -{{- if .Values.worker.rbac.create }} +{{- if and .Values.worker.enable .Values.worker.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/deployment/helm/node-feature-discovery/templates/service.yaml b/deployment/helm/node-feature-discovery/templates/service.yaml index 0ed9ed7db..d71d1555f 100644 --- a/deployment/helm/node-feature-discovery/templates/service.yaml +++ b/deployment/helm/node-feature-discovery/templates/service.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.enableNodeFeatureApi }} +{{- if and (not .Values.enableNodeFeatureApi) .Values.master.enable }} apiVersion: v1 kind: Service metadata: diff --git a/deployment/helm/node-feature-discovery/templates/serviceaccount.yaml b/deployment/helm/node-feature-discovery/templates/serviceaccount.yaml index 34dc8b753..7da2c877e 100644 --- a/deployment/helm/node-feature-discovery/templates/serviceaccount.yaml +++ b/deployment/helm/node-feature-discovery/templates/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{- if .Values.master.serviceAccount.create -}} +{{- if and .Values.master.enable .Values.master.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -42,7 +42,7 @@ metadata: {{- end }} {{- end }} -{{- if .Values.worker.serviceAccount.create }} +{{- if and .Values.worker.enable .Values.worker.serviceAccount.create }} --- apiVersion: v1 kind: ServiceAccount diff --git a/deployment/helm/node-feature-discovery/templates/worker.yaml b/deployment/helm/node-feature-discovery/templates/worker.yaml index ac9f9b2db..014dc0230 100644 --- a/deployment/helm/node-feature-discovery/templates/worker.yaml +++ b/deployment/helm/node-feature-discovery/templates/worker.yaml @@ -1,3 +1,4 @@ +{{- if .Values.worker.enable }} apiVersion: apps/v1 kind: DaemonSet metadata: @@ -150,3 +151,4 @@ spec: {{- with .Values.worker.priorityClassName }} priorityClassName: {{ . | quote }} {{- end }} +{{- end }} diff --git a/deployment/helm/node-feature-discovery/values.yaml b/deployment/helm/node-feature-discovery/values.yaml index f48b177a6..74623fadf 100644 --- a/deployment/helm/node-feature-discovery/values.yaml +++ b/deployment/helm/node-feature-discovery/values.yaml @@ -13,6 +13,7 @@ namespaceOverride: "" enableNodeFeatureApi: true master: + enable: true config: ### # noPublish: false # extraLabelNs: ["added.ns.io","added.kubernets.io"] @@ -132,6 +133,7 @@ master: values: [""] worker: + enable: true config: ### #core: # labelWhiteList: diff --git a/docs/deployment/helm.md b/docs/deployment/helm.md index d6b288796..0f2f3a291 100644 --- a/docs/deployment/helm.md +++ b/docs/deployment/helm.md @@ -114,6 +114,7 @@ API's you need to install the prometheus operator in your cluster. | Name | Type | Default | description | |-----------------------------|---------|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------| | `master.*` | dict | | NFD master deployment configuration | +| `master.enable` | bool | true | Specifies whether nfd-master should be deployed | | `master.port` | integer | | Specifies the TCP port that nfd-master listens for incoming requests. **NOTE**: this parameter is related to the deprecated gRPC API and will be removed with it in a future release | | `master.metricsPort` | integer | 8081 | Port on which to expose metrics from components to prometheus operator | | `master.instance` | string | | Instance name. Used to separate annotation namespaces for multiple parallel deployments | @@ -146,6 +147,7 @@ API's you need to install the prometheus operator in your cluster. | Name | Type | Default | description | | ---- | ---- | ------- | ----------- | | `worker.*` | dict | | NFD worker daemonset configuration | +| `worker.enable` | bool | true | Specifies whether nfd-worker should be deployed | | `worker.metricsPort*` | integer | 8081 | Port on which to expose metrics from components to prometheus operator | | `worker.config` | dict | | NFD worker [configuration](../reference/worker-configuration-reference) | | `worker.podSecurityContext` | dict | {} | [PodSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) holds pod-level security attributes and common container settings |