29 lines
1.1 KiB
YAML
29 lines
1.1 KiB
YAML
{{- 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 }}
|