From 2b606fb1693a673699b03d79cd3d9a79e9e533c1 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sat, 3 Feb 2024 22:09:32 +0100 Subject: [PATCH] feat(cluster_setup): Use secret in multiple namespaces --- helm/cluster_setup/Chart.yaml | 6 +++--- helm/cluster_setup/templates/thanos-object-storage.yaml | 6 ++++-- helm/cluster_setup/values.yaml | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/helm/cluster_setup/Chart.yaml b/helm/cluster_setup/Chart.yaml index 3e5e9f6..c2b2f5b 100644 --- a/helm/cluster_setup/Chart.yaml +++ b/helm/cluster_setup/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: cluster_setup -version: 0.4.1 +version: 0.5.0 type: application description: "Initial cluster setup" maintainers: @@ -8,8 +8,8 @@ maintainers: url: https://2martens.de annotations: artifacthub.io/changes: | - - kind: fixed - description: Fixed network policies + - kind: added + description: Added ability to use secret in multiple namespaces artifacthub.io/signKey: | fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8 url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc diff --git a/helm/cluster_setup/templates/thanos-object-storage.yaml b/helm/cluster_setup/templates/thanos-object-storage.yaml index 04ae0a8..e70b69e 100644 --- a/helm/cluster_setup/templates/thanos-object-storage.yaml +++ b/helm/cluster_setup/templates/thanos-object-storage.yaml @@ -7,11 +7,12 @@ metadata: {{- include "template.labels" . | nindent 4 }} annotations: {{- include "template.annotations" . | nindent 4 }} +{{- range .Values.thanos.secretNamespaces }} --- apiVersion: v1 kind: Secret metadata: - namespace: {{ .Values.thanos.namespace | default "observability" }} + namespace: {{ .name | default "observability" }} name: thanos-object-storage-config labels: {{- include "template.labels" . | nindent 4 }} @@ -19,5 +20,6 @@ metadata: {{- include "template.annotations" . | nindent 4 }} data: thanos.yaml: |- - {{ tpl (.Files.Get "thanos.yaml") . | b64enc }} + {{ tpl ($.Files.Get "thanos.yaml") . | b64enc }} +{{- end }} {{- end }} \ No newline at end of file diff --git a/helm/cluster_setup/values.yaml b/helm/cluster_setup/values.yaml index 90570eb..5cb78d1 100644 --- a/helm/cluster_setup/values.yaml +++ b/helm/cluster_setup/values.yaml @@ -17,5 +17,6 @@ thanos: awsRegion: "eu-central-1" accessKey: "" secretKey: "" + secretNamespaces: [] cilium: enabled: false \ No newline at end of file