From f515d52a64e1c0dfc7c059386a32a89ccf23b188 Mon Sep 17 00:00:00 2001 From: Uros Lipovsek Date: Mon, 3 Mar 2025 18:28:21 -0500 Subject: [PATCH 1/2] addding npd namespace object --- charts/neuron-helm-chart/templates/npd-daemonset.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/charts/neuron-helm-chart/templates/npd-daemonset.yaml b/charts/neuron-helm-chart/templates/npd-daemonset.yaml index 8dc4537..0beac0e 100644 --- a/charts/neuron-helm-chart/templates/npd-daemonset.yaml +++ b/charts/neuron-helm-chart/templates/npd-daemonset.yaml @@ -1,4 +1,13 @@ {{- if .Values.npd.enabled }} +--- +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "neuron-node-problem-detector-and-recovery.namespace" . }} + labels: + app: {{ include "neuron-node-problem-detector-and-recovery.fullname" . }} + {{- include "neuron-node-problem-detector-and-recovery.labels" . | nindent 4 }} +--- apiVersion: apps/v1 kind: DaemonSet metadata: From 81e83939b5c3011101b4a9dae37b234c240066ba Mon Sep 17 00:00:00 2001 From: Uros Lipovsek Date: Tue, 18 Mar 2025 19:02:31 -0400 Subject: [PATCH 2/2] opt-in namespace creation --- charts/neuron-helm-chart/templates/_helpers.tpl | 2 +- charts/neuron-helm-chart/templates/npd-daemonset.yaml | 8 -------- charts/neuron-helm-chart/templates/npd-namespace.yaml | 9 +++++++++ charts/neuron-helm-chart/values.yaml | 4 +++- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 charts/neuron-helm-chart/templates/npd-namespace.yaml diff --git a/charts/neuron-helm-chart/templates/_helpers.tpl b/charts/neuron-helm-chart/templates/_helpers.tpl index debe970..bd6d70b 100644 --- a/charts/neuron-helm-chart/templates/_helpers.tpl +++ b/charts/neuron-helm-chart/templates/_helpers.tpl @@ -331,7 +331,7 @@ Expand the name of the chart. Expand the namespace of the chart. */}} {{- define "neuron-node-problem-detector-and-recovery.namespace" -}} -{{- default .Release.Namespace .Values.npd.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- default .Release.Namespace .Values.npd.namespace.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/charts/neuron-helm-chart/templates/npd-daemonset.yaml b/charts/neuron-helm-chart/templates/npd-daemonset.yaml index 0beac0e..112125e 100644 --- a/charts/neuron-helm-chart/templates/npd-daemonset.yaml +++ b/charts/neuron-helm-chart/templates/npd-daemonset.yaml @@ -1,13 +1,5 @@ {{- if .Values.npd.enabled }} --- -apiVersion: v1 -kind: Namespace -metadata: - name: {{ include "neuron-node-problem-detector-and-recovery.namespace" . }} - labels: - app: {{ include "neuron-node-problem-detector-and-recovery.fullname" . }} - {{- include "neuron-node-problem-detector-and-recovery.labels" . | nindent 4 }} ---- apiVersion: apps/v1 kind: DaemonSet metadata: diff --git a/charts/neuron-helm-chart/templates/npd-namespace.yaml b/charts/neuron-helm-chart/templates/npd-namespace.yaml new file mode 100644 index 0000000..1137650 --- /dev/null +++ b/charts/neuron-helm-chart/templates/npd-namespace.yaml @@ -0,0 +1,9 @@ +{{- if and .Values.npd.enabled .Values.npd.namespace.create }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "neuron-node-problem-detector-and-recovery.namespace" . }} + labels: + app: {{ include "neuron-node-problem-detector-and-recovery.fullname" . }} + {{- include "neuron-node-problem-detector-and-recovery.labels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/neuron-helm-chart/values.yaml b/charts/neuron-helm-chart/values.yaml index 46e0124..681b388 100644 --- a/charts/neuron-helm-chart/values.yaml +++ b/charts/neuron-helm-chart/values.yaml @@ -155,7 +155,9 @@ npd: name: node-problem-detector-config imagePullSecrets: [] nameOverride: node-problem-detector - namespaceOverride: neuron-healthcheck-system + namespace: + name: neuron-healthcheck-system + create: false fullnameOverride: node-problem-detector selectorLabelsOverride: {} serviceAccount: