Skip to content

Commit c92fb1c

Browse files
inteoncert-manager-bot
authored andcommitted
add Helm options to extend auto-approval or disable it
Signed-off-by: Tim Ramlot <[email protected]>
1 parent d3e8db7 commit c92fb1c

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

deploy/charts/cert-manager/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ spec:
137137
{{- with .Values.dns01RecursiveNameservers }}
138138
- --dns01-recursive-nameservers={{ . }}
139139
{{- end }}
140+
{{- if .Values.disableAutoApproval }}
141+
- --controllers=-certificaterequests-approver
142+
{{- end }}
140143
ports:
141144
- containerPort: 9402
142145
name: http-metrics

deploy/charts/cert-manager/templates/rbac.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ rules:
474474

475475
---
476476

477+
{{- if not .Values.disableAutoApproval -}}
478+
477479
# Permission to approve CertificateRequests referencing cert-manager.io Issuers and ClusterIssuers
478480
apiVersion: rbac.authorization.k8s.io/v1
479481
kind: ClusterRole
@@ -489,7 +491,12 @@ rules:
489491
- apiGroups: ["cert-manager.io"]
490492
resources: ["signers"]
491493
verbs: ["approve"]
492-
resourceNames: ["issuers.cert-manager.io/*", "clusterissuers.cert-manager.io/*"]
494+
{{- with .Values.approveSignerNames }}
495+
resourceNames:
496+
{{- range . }}
497+
- {{ . | quote }}
498+
{{- end }}
499+
{{- end }}
493500

494501
---
495502

@@ -514,6 +521,8 @@ subjects:
514521

515522
---
516523

524+
{{- end -}}
525+
517526
# Permission to:
518527
# - Update and sign CertificatSigningeRequests referencing cert-manager.io Issuers and ClusterIssuers
519528
# - Perform SubjectAccessReviews to test whether users are able to reference Namespaced Issuers

deploy/charts/cert-manager/values.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,23 @@ dns01RecursiveNameservers: ""
241241
# Enabling this option could cause the DNS01 self check to take longer owing to caching performed by the recursive nameservers.
242242
dns01RecursiveNameserversOnly: false
243243

244+
# Option to disable cert-manager's build-in auto-approver. The auto-approver
245+
# approves all CertificateRequests that reference issuers matching the 'approveSignerNames'
246+
# option. This 'disableAutoApproval' option is useful when you want to make all approval decisions
247+
# using a different approver (like approver-policy - https://github.com/cert-manager/approver-policy).
248+
disableAutoApproval: false
249+
250+
# List of signer names that cert-manager will approve by default. CertificateRequests
251+
# referencing these signer names will be auto-approved by cert-manager. Defaults to just
252+
# approving the cert-manager.io Issuer and ClusterIssuer issuers. When set to an empty
253+
# array, ALL issuers will be auto-approved by cert-manager. To disable the auto-approval,
254+
# because eg. you are using approver-policy, you can enable 'disableAutoApproval'.
255+
# ref: https://cert-manager.io/docs/concepts/certificaterequest/#approval
256+
# +docs:property
257+
approveSignerNames:
258+
- issuers.cert-manager.io/*
259+
- clusterissuers.cert-manager.io/*
260+
244261
# Additional command line flags to pass to cert-manager controller binary.
245262
# To see all available flags run `docker run quay.io/jetstack/cert-manager-controller:<version> --help`.
246263
#

0 commit comments

Comments
 (0)