constellation/internal/helm/charts/cilium/templates/clustermesh-config/clustermesh-secret.yaml

27 lines
1.0 KiB
YAML
Raw Normal View History

{{- if .Values.clustermesh.config.enabled }}
2022-08-12 04:20:19 -04:00
---
apiVersion: v1
kind: Secret
metadata:
name: cilium-clustermesh
namespace: {{ .Release.Namespace }}
{{- with .Values.clustermesh.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
2022-08-12 04:20:19 -04:00
data:
{{- $kvstoremesh := and .Values.clustermesh.useAPIServer .Values.clustermesh.apiserver.kvstoremesh.enabled }}
{{- $override := ternary (printf "https://clustermesh-apiserver.%s.svc:2379" .Release.Namespace) "" $kvstoremesh }}
2022-08-12 04:20:19 -04:00
{{- range .Values.clustermesh.config.clusters }}
{{ .name }}: {{ include "clustermesh-config-generate-etcd-cfg" (list . $.Values.clustermesh.config.domain $override) | b64enc }}
{{- /* The parenthesis around .tls are required, since it can be null: https://stackoverflow.com/a/68807258 */}}
{{- if and (eq $override "") (.tls).cert (.tls).key }}
{{- if .tls.caCert }}
{{ .name }}.etcd-client-ca.crt: {{ .tls.caCert }}
{{- end }}
2022-08-12 04:20:19 -04:00
{{ .name }}.etcd-client.key: {{ .tls.key }}
{{ .name }}.etcd-client.crt: {{ .tls.cert }}
{{- end }}
{{- end }}
2022-08-12 04:20:19 -04:00
{{- end }}