Add cilium chart
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{{- define "clustermesh-config-generate-etcd-cfg" }}
|
||||
{{- $cluster := index . 0 -}}
|
||||
{{- $domain := index . 1 -}}
|
||||
{{- $override := index . 2 -}}
|
||||
{{- /* The parenthesis around $cluster.tls are required, since it can be null: https://stackoverflow.com/a/68807258 */}}
|
||||
{{- $prefix := ternary "common-" (printf "%s." $cluster.name) (or (ne $override "") (empty ($cluster.tls).cert) (empty ($cluster.tls).key)) -}}
|
||||
|
||||
endpoints:
|
||||
{{- if ne $override "" }}
|
||||
- {{ $override }}
|
||||
{{- else if $cluster.ips }}
|
||||
- https://{{ $cluster.name }}.{{ $domain }}:{{ $cluster.port }}
|
||||
{{- else }}
|
||||
- https://{{ $cluster.address | required "missing clustermesh.apiserver.config.clusters.address" }}:{{ $cluster.port }}
|
||||
{{- end }}
|
||||
{{- if not (empty ($cluster.tls).caCert) }}
|
||||
{{- /* The custom CA configuration takes effect only if a custom certificate and key are also set */}}
|
||||
trusted-ca-file: /var/lib/cilium/clustermesh/{{ $prefix }}etcd-client-ca.crt
|
||||
{{- else }}
|
||||
trusted-ca-file: /var/lib/cilium/clustermesh/common-etcd-client-ca.crt
|
||||
{{- end }}
|
||||
key-file: /var/lib/cilium/clustermesh/{{ $prefix }}etcd-client.key
|
||||
cert-file: /var/lib/cilium/clustermesh/{{ $prefix }}etcd-client.crt
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.clustermesh.config.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cilium-clustermesh
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.clustermesh.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $kvstoremesh := and .Values.clustermesh.useAPIServer .Values.clustermesh.apiserver.kvstoremesh.enabled }}
|
||||
{{- $override := ternary (printf "https://clustermesh-apiserver.%s.svc:2379" .Release.Namespace) "" $kvstoremesh }}
|
||||
{{- 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 }}
|
||||
{{ .name }}.etcd-client.key: {{ .tls.key }}
|
||||
{{ .name }}.etcd-client.crt: {{ .tls.cert }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,24 @@
|
||||
{{- if and .Values.clustermesh.useAPIServer .Values.clustermesh.config.enabled .Values.clustermesh.apiserver.kvstoremesh.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cilium-kvstoremesh
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.clustermesh.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- range .Values.clustermesh.config.clusters }}
|
||||
{{ .name }}: {{ include "clustermesh-config-generate-etcd-cfg" (list . $.Values.clustermesh.config.domain "") | b64enc }}
|
||||
{{- /* The parenthesis around .tls are required, since it can be null: https://stackoverflow.com/a/68807258 */}}
|
||||
{{- if and (.tls).cert (.tls).key }}
|
||||
{{- if .tls.caCert }}
|
||||
{{ .name }}.etcd-client-ca.crt: {{ .tls.caCert }}
|
||||
{{- end }}
|
||||
{{ .name }}.etcd-client.key: {{ .tls.key }}
|
||||
{{ .name }}.etcd-client.crt: {{ .tls.cert }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user