diff --git a/step-certificates/templates/ca.yaml b/step-certificates/templates/ca.yaml index 21e823a..5a31486 100644 --- a/step-certificates/templates/ca.yaml +++ b/step-certificates/templates/ca.yaml @@ -171,6 +171,11 @@ spec: - name: database emptyDir: {} {{- end }} + {{- if and .Values.ca.db.enabled (and .Values.ca.db.persistent .Values.ca.db.existingClaim) }} + - name: database + persistentVolumeClaim: + claimName: {{ .Values.ca.db.existingClaim }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -183,7 +188,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- if and .Values.ca.db.enabled .Values.ca.db.persistent }} + {{- if and .Values.ca.db.enabled .Values.ca.db.persistent (not .Values.ca.db.existingClaim) }} volumeClaimTemplates: - metadata: name: database @@ -199,11 +204,6 @@ spec: resources: requests: storage: {{ .Values.ca.db.size | quote }} - {{ if .Values.ca.db.existingClaim }} - selector: - matchLabels: - name: {{ .Values.ca.db.existingClaim | quote }} - {{- else }} {{- if .Values.ca.db.storageClass }} {{- if (eq "-" .Values.ca.db.storageClass) }} storageClassName: "" @@ -211,5 +211,4 @@ spec: storageClassName: {{ .Values.ca.db.storageClass | quote }} {{- end }} {{- end }} - {{- end }} {{- end }}