Files
charts/bitnami/geode/templates/tls-secrets.yaml
Miguel Ruiz c401bdf416 [bitnami/geode] Refactor TLS configuration (#11686)
* [bitnami/geode] Refactor TLS configuration

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* Fix typo

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Fix volumeMounts conditional

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Remove extra whitespace

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* [bitnami/geode] Update components versions

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
2022-08-11 14:29:48 +02:00

85 lines
3.9 KiB
YAML

{{- if .Values.ingress.enabled }}
{{- if .Values.ingress.secrets }}
{{- range .Values.ingress.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ $.Release.Namespace | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }}
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ .certificate | b64enc }}
tls.key: {{ .key | b64enc }}
---
{{- end }}
{{- end }}
{{- if and .Values.ingress.tls .Values.ingress.selfSigned }}
{{- $ca := genCA "geode-ca" 365 }}
{{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }}
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-tls" .Values.ingress.hostname }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ $cert.Cert | b64enc | quote }}
tls.key: {{ $cert.Key | b64enc | quote }}
ca.crt: {{ $ca.Cert | b64enc | quote }}
{{- end }}
{{- end }}
{{- if (include "geode.createTlsSecret" $) }}
{{- $ca := genCA "geode-ca" 365 }}
{{- $releaseNamespace := include "common.names.namespace" . }}
{{- $clusterDomain := .Values.clusterDomain }}
{{- $fullname := include "common.names.fullname" . }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-crt" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- $locatorReplicaCount := int .Values.locator.replicaCount }}
{{- range $i := until $locatorReplicaCount }}
{{- $replicaName := printf "%s-locator-%d" $fullname $i }}
{{- $replicaHost := printf "%s.%s-locator-hl" $replicaName $fullname }}
{{- $altNames := list (printf "%s.%s.svc.%s" $replicaHost $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $replicaName $releaseNamespace $clusterDomain) (printf "%s.%s" $replicaHost $releaseNamespace) (printf "%s.%s" $replicaName $releaseNamespace) $replicaHost $replicaName }}
{{- $crt := genSignedCert $replicaHost nil $altNames 365 $ca }}
geode-locator-{{ $i }}.crt: {{ $crt.Cert | b64enc | quote }}
geode-locator-{{ $i }}.key: {{ $crt.Key | b64enc | quote }}
{{- end }}
{{- $serverReplicaCount := int .Values.server.replicaCount }}
{{- range $i := until $serverReplicaCount }}
{{- $replicaName := printf "%s-server-%d" $fullname $i }}
{{- $replicaHost := printf "%s.%s-server-hl" $replicaName $fullname }}
{{- $altNames := list (printf "%s.%s.svc.%s" $replicaHost $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $replicaName $releaseNamespace $clusterDomain) (printf "%s.%s" $replicaHost $releaseNamespace) (printf "%s.%s" $replicaName $releaseNamespace) $replicaHost $replicaName }}
{{- $crt := genSignedCert $replicaHost nil $altNames 365 $ca }}
geode-server-{{ $i }}.crt: {{ $crt.Cert | b64enc | quote }}
geode-server-{{ $i }}.key: {{ $crt.Key | b64enc | quote }}
{{- end }}
ca.crt: {{ $ca.Cert | b64enc | quote }}
{{- end }}