argocd-helm/charts/argo-cd/templates/argocd-configs/cluster-secrets.yaml
Marco Kilchhofer 84120e6da3
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>
2021-04-13 21:10:04 -04:00

23 lines
800 B
YAML

{{- 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 }}