feat(argo-cd): Add ability to handle cluster credentials (#632)

* feat(argo-cd): Add ability to handle cluster credentials

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Apply review changes

Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* fix: use stringData in cluster secret

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
Co-authored-by: Spencer Gilbert <Spencer.Gilbert@gmail.com>
This commit is contained in:
Marco Kilchhofer 2021-04-14 03:10:04 +02:00 committed by GitHub
parent 4b9c281711
commit 84120e6da3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 1 deletions

View file

@ -0,0 +1,23 @@
{{- range .Values.configs.clusterCredentials }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "argo-cd.name" $ }}-cluster-{{ .name }}
labels:
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }}
argocd.argoproj.io/secret-type: cluster
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
stringData:
name: {{ required "A valid .Values.configs.clusterCredentials[].name entry is required!" .name }}
server: {{ required "A valid .Values.configs.clusterCredentials[].server entry is required!" .server }}
{{- with .namespaces }}
namespaces: {{ . }}
{{- end }}
config: |
{{- required "A valid .Values.configs.clusterCredentials[].config entry is required!" .config | toPrettyJson | nindent 4 }}
{{- end }}