From edb3e6824c3777a53eba4619fbd30f5e96eb0753 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 13 Dec 2021 10:19:48 +0200 Subject: [PATCH] deployment/helm: disable nfr controller for parallel instances Change the helm chart so that the NodeFeatureRule controller will be disabled for other than the default deployment (i.e. all deployments where master.instance is non-empty), unless explicitly set to true. With this we try to ensure that there is only on controller instance for the CR, avoiding contention and conflicts. --- deployment/helm/node-feature-discovery/templates/master.yaml | 5 +++++ deployment/helm/node-feature-discovery/values.yaml | 2 +- docs/get-started/deployment-and-usage.md | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deployment/helm/node-feature-discovery/templates/master.yaml b/deployment/helm/node-feature-discovery/templates/master.yaml index 76262a3f0..8a62d385a 100644 --- a/deployment/helm/node-feature-discovery/templates/master.yaml +++ b/deployment/helm/node-feature-discovery/templates/master.yaml @@ -78,7 +78,12 @@ spec: {{- if .Values.master.extraLabelNs | empty | not }} - "--extra-label-ns={{- join "," .Values.master.extraLabelNs }}" {{- end }} + {{- if .Values.master.featureRulesController | kindIs "invalid" | not }} - "-featurerules-controller={{ .Values.master.featureRulesController }}" + {{- else }} + ## By default, disable NodeFeatureRules controller for other than the default instances + - "-featurerules-controller={{ .Values.master.instance | empty }}" + {{- end }} {{- if .Values.tls.enable }} - "--ca-file=/etc/kubernetes/node-feature-discovery/certs/ca.crt" - "--key-file=/etc/kubernetes/node-feature-discovery/certs/tls.key" diff --git a/deployment/helm/node-feature-discovery/values.yaml b/deployment/helm/node-feature-discovery/values.yaml index c92fcff2e..613263c0b 100644 --- a/deployment/helm/node-feature-discovery/values.yaml +++ b/deployment/helm/node-feature-discovery/values.yaml @@ -24,7 +24,7 @@ nodeFeatureRule: master: instance: extraLabelNs: [] - featureRulesController: true + featureRulesController: null replicaCount: 1 diff --git a/docs/get-started/deployment-and-usage.md b/docs/get-started/deployment-and-usage.md index 03eb24475..d910c84f8 100644 --- a/docs/get-started/deployment-and-usage.md +++ b/docs/get-started/deployment-and-usage.md @@ -301,7 +301,7 @@ We have introduced the following Chart parameters. | `master.*` | dict | | NFD master deployment configuration | | `master.instance` | string | | Instance name. Used to separate annotation namespaces for multiple parallel deployments | | `master.extraLabelNs` | array | [] | List of allowed extra label namespaces | -| `master.featureRulesController` | bool | True | Specifies whether the controller for processing of NodeFeatureRule objects is enable. | +| `master.featureRulesController` | bool | null | Specifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if `master.instance` is empty. | `master.replicaCount` | integer | 1 | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified | | `master.podSecurityContext` | dict | {} | SecurityContext holds pod-level security attributes and common container settings | | `master.service.type` | string | ClusterIP | NFD master service type |