Skip to content

Commit

Permalink
Merge pull request 'feat: Add cert-manager templates for wildcard-cer…
Browse files Browse the repository at this point in the history
…tificate' (#312) from wildcard-certificate into master

Reviewed-on: https://gitea.obmondo.com/EnableIT/KubeAid/pulls/312
  • Loading branch information
klavs committed Aug 9, 2024
2 parents cf75d6f + e664db9 commit 901cb85
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions argocd-helm-charts/cert-manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Simplified name of the secret name for issuing wildcard certificate.
*/}}
{{- define "cert-manager.namefix" -}}
{{ printf "%s" . | trimPrefix "*" | trimPrefix "." | replace "." "-" }}
{{- end -}}
19 changes: 19 additions & 0 deletions argocd-helm-charts/cert-manager/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.wildcardCertificates.enabled -}}
{{- range .Values.wildcardCertificates.domains }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "cert-manager.namefix" . }}
spec:
secretName: {{ include "cert-manager.namefix" . }}
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: {{ $.Values.issuer.name | quote }}
commonName: "{{ . }}"
dnsNames:
- "{{ . }}"

---
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
name: {{ .Values.issuer.name }}
spec:
acme:
email: {{ .Values.issuer.issuerEmail }}
Expand Down
1 change: 1 addition & 0 deletions argocd-helm-charts/cert-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cert-manager:
cpu: 1m
memory: 16Mi
issuer:
name: letsencrypt
enabled: false
production: false
preferredChain: null
Expand Down

0 comments on commit 901cb85

Please sign in to comment.