diff --git a/charts/plugin-barman-cloud/templates/certificate-issuer.yaml b/charts/plugin-barman-cloud/templates/certificate-issuer.yaml index 64f078e8e6..d5e3ba2877 100644 --- a/charts/plugin-barman-cloud/templates/certificate-issuer.yaml +++ b/charts/plugin-barman-cloud/templates/certificate-issuer.yaml @@ -16,6 +16,7 @@ # # SPDX-License-Identifier: Apache-2.0 # +{{- if or .Values.certificate.createClientCertificate .Values.certificate.createServerCertificate }} --- apiVersion: cert-manager.io/v1 kind: Issuer @@ -24,3 +25,4 @@ metadata: namespace: {{ include "plugin-barman-cloud.namespace" . }} spec: selfSigned: {} +{{- end }} diff --git a/charts/plugin-barman-cloud/templates/deployment.yaml b/charts/plugin-barman-cloud/templates/deployment.yaml index f80ef36781..9e67ae4d07 100644 --- a/charts/plugin-barman-cloud/templates/deployment.yaml +++ b/charts/plugin-barman-cloud/templates/deployment.yaml @@ -79,11 +79,17 @@ spec: {{- toYaml .Values.resources | nindent 10 }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 10 }} + {{- if or .Values.certificate.createClientCertificate .Values.certificate.createServerCertificate }} volumeMounts: + {{- if .Values.certificate.createServerCertificate }} - mountPath: /server name: server + {{- end }} + {{- if .Values.certificate.createClientCertificate }} - mountPath: /client name: client + {{- end }} + {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} @@ -106,10 +112,16 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if or .Values.certificate.createClientCertificate .Values.certificate.createServerCertificate }} volumes: + {{- if .Values.certificate.createServerCertificate }} - name: server secret: secretName: barman-cloud-server-tls + {{- end }} + {{- if .Values.certificate.createClientCertificate }} - name: client secret: secretName: barman-cloud-client-tls + {{- end }} + {{- end }}