From bdb65e89ef1842c7faed0db9d6e331c390ffafb5 Mon Sep 17 00:00:00 2001 From: Aleksey Senin Date: Tue, 25 Mar 2025 09:34:39 -0400 Subject: [PATCH] Allow post-delete job to be disabled There are situations where the modifications performed by the NFD need to be preserved even after its removal. One such use case arises when NFD is installed as part of another project. By design, uninstalling the parent project does not remove all its components. However, the remaining components still rely on the labels created by NFD. If NFD is removed, these labels will be deleted, causing dependent components to fail. To maintain system integrity and ensure continued functionality, adding the 'postDeleteCleanup' option that allows any modifications made by NFD to be preserved upon its removal. Signed-off-by: Aleksey Senin --- .../helm/node-feature-discovery/templates/post-delete-job.yaml | 2 ++ deployment/helm/node-feature-discovery/values.yaml | 2 ++ docs/deployment/helm.md | 1 + 3 files changed, 5 insertions(+) diff --git a/deployment/helm/node-feature-discovery/templates/post-delete-job.yaml b/deployment/helm/node-feature-discovery/templates/post-delete-job.yaml index 1768c57ff..06606b7a4 100644 --- a/deployment/helm/node-feature-discovery/templates/post-delete-job.yaml +++ b/deployment/helm/node-feature-discovery/templates/post-delete-job.yaml @@ -1,3 +1,4 @@ +{{- if .Values.postDeleteCleanup }} apiVersion: v1 kind: ServiceAccount metadata: @@ -96,3 +97,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/deployment/helm/node-feature-discovery/values.yaml b/deployment/helm/node-feature-discovery/values.yaml index d71b7bb5b..559cf5cb2 100644 --- a/deployment/helm/node-feature-discovery/values.yaml +++ b/deployment/helm/node-feature-discovery/values.yaml @@ -15,6 +15,8 @@ featureGates: priorityClassName: "" +postDeleteCleanup: true + master: enable: true extraArgs: [] diff --git a/docs/deployment/helm.md b/docs/deployment/helm.md index 734f362a8..0e9a60156 100644 --- a/docs/deployment/helm.md +++ b/docs/deployment/helm.md @@ -164,6 +164,7 @@ Chart parameters are available. | `prometheus.labels` | dict | {} | Specifies labels for use with the prometheus operator to control how it is selected | | `prometheus.scrapeInterval` | string | 10s | Specifies the interval by which metrics are scraped | | `priorityClassName` | string | | The name of the PriorityClass to be used for the NFD pods. | +| `postDeleteCleanup` | bool | true | Controls behavior of post-delete hook. | Metrics are configured to be exposed using prometheus operator API's by default. If you want to expose metrics using the prometheus operator