Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to inject an Issuer or ClusterIssuer ref instead of creating a new one #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/mirrors/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# mirrors chart

## 0.1.8
* Ability to inject an existing Issuer or ClusterIssuer instead of creating a new one

## 0.1.7
* Use caBundle when certmanager.enabled is false

Expand Down
2 changes: 1 addition & 1 deletion charts/mirrors/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v2
name: mirrors
description: mirrors controller
type: application
version: 0.1.7
version: 0.1.8
appVersion: "0.2.5"
home: https://github.com/ktsstudio/mirrors
9 changes: 8 additions & 1 deletion charts/mirrors/templates/certmanager.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{ if and .Values.webhooks.enabled .Values.webhooks.cert.certmanager.enabled }}
{{ if not (and .Values.webhooks.cert.certmanager.external_issuer .Values.webhooks.cert.certmanager.external_issuer.enabled) }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "mirrors.fullname" . }}-selfsigned-issuer
spec:
selfSigned: {}
{{ end }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
Expand All @@ -15,9 +17,14 @@ spec:
- {{ include "mirrors.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc
- {{ include "mirrors.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc.{{ .Values.webhooks.cert.certmanager.clusterDomain }}
issuerRef:
{{ if and .Values.webhooks.cert.certmanager.external_issuer .Values.webhooks.cert.certmanager.external_issuer.enabled }}
kind: {{ default "ClusterIssuer" .Values.webhooks.cert.certmanager.external_issuer.kind }}
name: {{ .Values.webhooks.cert.certmanager.external_issuer.name }}
{{ else }}
kind: Issuer
name: {{ include "mirrors.fullname" . }}-selfsigned-issuer
{{ end }}
secretName: {{ include "mirrors.fullname" . }}-webhook-server-cert
duration: {{ .Values.webhooks.cert.certmanager.duration }}
renewBefore: {{ .Values.webhooks.cert.certmanager.renewBefore }}
{{ end }}
{{ end }}
2 changes: 2 additions & 0 deletions charts/mirrors/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ webhooks:
certmanager:
# enables automatic certificate creation via cert-manager
enabled: true
external_issuer:
enabled: false

# clusterDomain is used to specify correctly a DNS for automatic certificate generation
clusterDomain: cluster.local
Expand Down