{{- if and .Values.tls.enabled .Values.tls.certs.certManager }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: {{ template "cockroachdb.fullname" . }}-root-client namespace: {{ .Release.Namespace | quote }} labels: helm.sh/chart: {{ template "cockroachdb.chart" . }} app.kubernetes.io/name: {{ template "cockroachdb.name" . }} app.kubernetes.io/instance: {{ .Release.Name | quote }} app.kubernetes.io/managed-by: {{ .Release.Service | quote }} {{- with .Values.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: duration: {{ .Values.tls.certs.certManagerIssuer.clientCertDuration }} renewBefore: {{ .Values.tls.certs.certManagerIssuer.clientCertExpiryWindow }} usages: - digital signature - key encipherment - client auth privateKey: algorithm: RSA size: 2048 commonName: root subject: organizations: - Cockroach secretName: {{ .Values.tls.certs.clientRootSecret }} issuerRef: name: {{ template "cockroachdb.fullname" . }}-ca-issuer kind: Issuer group: cert-manager.io {{- end }}