From 55c2089fd696e25fa0fd07cebdfb9c0b709bfc8c Mon Sep 17 00:00:00 2001 From: travisn Date: Tue, 28 Nov 2023 16:25:59 -0700 Subject: [PATCH] helm: add namespace to all resource templates The helm templates assumed that the resources would be installed to the given namespace for the helm install or upgrade. This works perfectly until there is a desire to extract the manifests from the helm chart and instead install with those. Thus, the namespace is added to all the resources in the chart where they were missing. Signed-off-by: travisn (cherry picked from commit b4e51f6d12bcc2bcb6a8293a522add5acbb4f367) --- deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/cephcluster.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/cephecblockpool.yaml | 2 +- deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml | 1 + .../rook-ceph-cluster/templates/cephobjectstore-ingress.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/configmap.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/deployment.yaml | 1 + deploy/charts/rook-ceph-cluster/templates/ingress.yaml | 1 + deploy/charts/rook-ceph/templates/configmap.yaml | 1 + deploy/charts/rook-ceph/templates/deployment.yaml | 1 + 11 files changed, 11 insertions(+), 1 deletion(-) diff --git a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml index 05920f5db..0efb69cdf 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml @@ -5,6 +5,7 @@ apiVersion: ceph.rook.io/v1 kind: CephBlockPool metadata: name: {{ $blockpool.name }} + namespace: {{ $root.Release.Namespace }} # namespace:cluster spec: {{ toYaml $blockpool.spec | indent 2 }} --- diff --git a/deploy/charts/rook-ceph-cluster/templates/cephcluster.yaml b/deploy/charts/rook-ceph-cluster/templates/cephcluster.yaml index 3ff4b6525..3a568e22a 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephcluster.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephcluster.yaml @@ -3,6 +3,7 @@ apiVersion: ceph.rook.io/v1 kind: CephCluster metadata: name: {{ default .Release.Namespace .Values.clusterName }} + namespace: {{ .Release.Namespace }} # namespace:cluster spec: {{- if .Values.monitoring }} monitoring: diff --git a/deploy/charts/rook-ceph-cluster/templates/cephecblockpool.yaml b/deploy/charts/rook-ceph-cluster/templates/cephecblockpool.yaml index bb6f4e908..97ae8d1d4 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephecblockpool.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephecblockpool.yaml @@ -5,6 +5,7 @@ apiVersion: ceph.rook.io/v1 kind: CephBlockPool metadata: name: {{ $ecblockpool.name }} + namespace: {{ $root.Release.Namespace }} # namespace:cluster spec: {{ toYaml $ecblockpool.spec | indent 2 }} {{ end }} @@ -43,4 +44,3 @@ parameters: allowVolumeExpansion: {{ $cephEcStorage.allowVolumeExpansion }} reclaimPolicy: {{ $cephEcStorage.reclaimPolicy }} {{ end }} - diff --git a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml index 644910e9b..19393e4cd 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml @@ -5,6 +5,7 @@ apiVersion: ceph.rook.io/v1 kind: CephFilesystem metadata: name: {{ $filesystem.name }} + namespace: {{ $root.Release.Namespace }} # namespace:cluster spec: {{ toYaml $filesystem.spec | indent 2 }} --- diff --git a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml index 014d2ab87..24ab3708d 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml @@ -5,6 +5,7 @@ apiVersion: {{ include "capabilities.ingress.apiVersion" $ }} kind: Ingress metadata: name: {{ .name }} + namespace: {{ .Release.Namespace }} # namespace:cluster {{- with .ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml index adde413a2..a3b00b20c 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml @@ -5,6 +5,7 @@ apiVersion: ceph.rook.io/v1 kind: CephObjectStore metadata: name: {{ $objectstore.name }} + namespace: {{ $root.Release.Namespace }} # namespace:cluster spec: {{ toYaml $objectstore.spec | indent 2 }} --- diff --git a/deploy/charts/rook-ceph-cluster/templates/configmap.yaml b/deploy/charts/rook-ceph-cluster/templates/configmap.yaml index 3586ed856..a14994fc5 100644 --- a/deploy/charts/rook-ceph-cluster/templates/configmap.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/configmap.yaml @@ -4,6 +4,7 @@ kind: ConfigMap apiVersion: v1 metadata: name: rook-config-override + namespace: {{ .Release.Namespace }} # namespace:cluster data: config: | {{ .Values.configOverride | nindent 4 }} diff --git a/deploy/charts/rook-ceph-cluster/templates/deployment.yaml b/deploy/charts/rook-ceph-cluster/templates/deployment.yaml index c176323a6..c04028261 100644 --- a/deploy/charts/rook-ceph-cluster/templates/deployment.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/deployment.yaml @@ -4,6 +4,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: rook-ceph-tools + namespace: {{ .Release.Namespace }} # namespace:cluster labels: app: rook-ceph-tools spec: diff --git a/deploy/charts/rook-ceph-cluster/templates/ingress.yaml b/deploy/charts/rook-ceph-cluster/templates/ingress.yaml index 4cf4c42ca..883d8a48f 100644 --- a/deploy/charts/rook-ceph-cluster/templates/ingress.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/ingress.yaml @@ -4,6 +4,7 @@ apiVersion: {{ include "capabilities.ingress.apiVersion" . }} kind: Ingress metadata: name: {{ template "clusterName" . }}-dashboard + namespace: {{ .Release.Namespace }} # namespace:cluster {{- if .Values.ingress.dashboard.annotations }} annotations: {{- toYaml .Values.ingress.dashboard.annotations | nindent 4 }} {{- end }} diff --git a/deploy/charts/rook-ceph/templates/configmap.yaml b/deploy/charts/rook-ceph/templates/configmap.yaml index d373b10d2..b154adcd6 100644 --- a/deploy/charts/rook-ceph/templates/configmap.yaml +++ b/deploy/charts/rook-ceph/templates/configmap.yaml @@ -4,6 +4,7 @@ kind: ConfigMap apiVersion: v1 metadata: name: rook-ceph-operator-config + namespace: {{ .Release.Namespace }} # namespace:operator data: ROOK_LOG_LEVEL: {{ .Values.logLevel | quote }} ROOK_CEPH_COMMANDS_TIMEOUT_SECONDS: {{ .Values.cephCommandsTimeoutSeconds | quote }} diff --git a/deploy/charts/rook-ceph/templates/deployment.yaml b/deploy/charts/rook-ceph/templates/deployment.yaml index 9f0b3d5e7..5c02a4a10 100644 --- a/deploy/charts/rook-ceph/templates/deployment.yaml +++ b/deploy/charts/rook-ceph/templates/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: rook-ceph-operator + namespace: {{ .Release.Namespace }} # namespace:operator labels: operator: rook storage-backend: ceph