2023-02-01 10:19:17 +00:00

29 lines
1.1 KiB
YAML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{- if not .Values.cloudCredentialsSecretName }}
{{- $cloud := index .Values.clouds .Values.cloudName }}
{{- if not (dig "auth" "project_id" nil $cloud) }}
{{- fail "clouds.yaml must contain the project ID" }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "openstack-cluster.cloudCredentialsSecretName" . }}
labels: {{ include "openstack-cluster.componentLabels" (list . "cloud-credentials") | nindent 4 }}
annotations:
# If the cloud credentials are deleted before the cluster has finished deleting, then the cluster
# deletion cannot proceed any further. So prevent Helm from deleting it.
helm.sh/resource-policy: keep
# For Argo, this resource should be pruned last out of everything
argocd.argoproj.io/sync-options: PruneLast=true
stringData:
# Just include the data for the cloud we will be using
clouds.yaml: |
clouds:
openstack:
{{ index .Values.clouds .Values.cloudName | toYaml | indent 8 | trim }}
{{- with .Values.cloudCACert }}
cacert: |
{{ . | indent 4 | trim }}
{{- end }}
{{- end }}