Skip to content

Commit 5aad65c

Browse files
authored
Add support for ClusterIssuer for certificates (#630)
* Add support for ClusterIssuer * Add validation that kind must be Issuer when issuer is created as part of the deployment
1 parent ab99e91 commit 5aad65c

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

charts/pulsar/templates/_certs.tpl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,8 @@ spec:
107107
# Issuer references are always required.
108108
issuerRef:
109109
name: "{{ template "pulsar.certs.issuers.ca.name" .root }}"
110-
# We can reference ClusterIssuers by changing the kind here.
111-
# The default value is Issuer (i.e. a locally namespaced Issuer)
112-
kind: Issuer
113-
# This is optional since cert-manager will default to this value however
114-
# if you are using an external issuer, change this to that issuer group.
115-
group: cert-manager.io
110+
kind: "{{ default "Issuer" .root.Values.certs.issuers.ca.kind }}"
111+
group: "{{ default "cert-manager.io" .root.Values.certs.issuers.ca.group }}"
116112
{{- end -}}
117113

118114
{{/*

charts/pulsar/templates/tls-cert-internal-issuer.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ spec:
5555
group: cert-manager.io
5656
---
5757
{{- end }}
58+
{{- if and (eq .Values.certs.internal_issuer.type "ca") (not (eq .Values.certs.issuers.ca.kind "Issuer")) -}}
59+
{{- fail "Set certs.internal_issuer.enabled to false when using certs.issuers.ca.kind other than Issuer." -}}
60+
{{- end }}
5861
apiVersion: "{{ .Values.certs.internal_issuer.apiVersion }}"
5962
kind: Issuer
6063
metadata:

charts/pulsar/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ certs:
397397
# The secret name of the CA certificate, it is mandatory to specify this value if TLS is enabled
398398
# and selfsigning is not used
399399
secretName:
400+
# The k8s kind of the ca issuer: Issuer or ClusterIssuer
401+
kind: Issuer
402+
# Issuer group
403+
group: cert-manager.io
400404

401405
######################################################################
402406
# Below are settings for each component

0 commit comments

Comments
 (0)