diff --git a/helm/rustfs/templates/ingress.yaml b/helm/rustfs/templates/ingress.yaml index 164d9c5e3..3c802140e 100644 --- a/helm/rustfs/templates/ingress.yaml +++ b/helm/rustfs/templates/ingress.yaml @@ -31,7 +31,11 @@ spec: {{- range .Values.ingress.hosts }} - {{ .host | quote }} {{- end }} + {{- if .Values.ingress.tls.existingSecret.enabled }} + secretName: {{ required "ingress.tls.existingSecret.name must be set when ingress.tls.existingSecret.enabled is true" .Values.ingress.tls.existingSecret.name }} + {{- else }} secretName: {{ include "rustfs.fullname" $ }}-tls + {{- end }} {{- end }} rules: {{- range .Values.ingress.hosts }} diff --git a/helm/rustfs/templates/secret-tls.yaml b/helm/rustfs/templates/secret-tls.yaml index d8261904e..dbdbdf3f5 100644 --- a/helm/rustfs/templates/secret-tls.yaml +++ b/helm/rustfs/templates/secret-tls.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.ingress.tls.enabled (not .Values.ingress.tls.certManager.enabled) -}} +{{- if and .Values.ingress.tls.enabled (not .Values.ingress.tls.certManager.enabled) (not .Values.ingress.tls.existingSecret.enabled) -}} apiVersion: v1 kind: Secret metadata: @@ -8,6 +8,6 @@ metadata: {{- toYaml .Values.commonLabels | nindent 4 }} type: kubernetes.io/tls data: - tls.crt : {{ .Values.ingress.tls.crt | b64enc | quote }} - tls.key : {{ .Values.ingress.tls.key | b64enc | quote }} + tls.crt: {{ .Values.ingress.tls.crt | b64enc | quote }} + tls.key: {{ .Values.ingress.tls.key | b64enc | quote }} {{- end }} diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 80ccc74d6..90ba2f185 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -144,9 +144,21 @@ ingress: pathType: Prefix tls: enabled: false # Enable tls and access rustfs via https. + certManager: enabled: false # Enable certmanager to generate certificate for rustfs, default false. - secretName: secret-tls + + existingSecret: + # To use an existing secret for tls certificates in the ingress enable this, + # set the name of the existing secret and make sure that the secret contains + # values for the keys "crt" and "key". + enabled: false + name: "" + + # If the certmanager is not used and no existing secret is used to provide a tls certificate, + # then this certificate can be configured here. A secret will be created and used. + # Note: The following input will be base64 encoded during secret creation. There is no need + # to provide it base64 encoded here already. crt: tls.crt key: tls.key