Skip to content

Commit

Permalink
add new cert manager chart
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Jan 21, 2025
1 parent fa7254e commit 23bf077
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
14 changes: 14 additions & 0 deletions charts/certmanager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v2
name: cert-manager-google
version: 0.1.0
description: "Installs Cert-Manager an Issuer and a Certificate on google cloud"

# The key part: we declare the dependency on the official cert-manager chart:
dependencies:
- name: cert-manager
version: 1.8.0
repository: "https://charts.jetstack.io"
condition: certManager.enabled # so we can toggle it on/off
tags:
- certManager

20 changes: 20 additions & 0 deletions charts/certmanager/templates/cert-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ required "A valid .Values.projectName is required!" .Values.projectName }}
{{ required "A valid .Values.letsEncryptEmail is required!" .Values.letsEncryptEmail }}

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ .Values.issuerName }}
spec:
acme:
server: {{ .Values.letsEncryptServer }}
email: {{ .Values.letsEncryptEmail }}
privateKeySecretRef:
name: {{ .Values.issuerName }}
solvers:
- dns01:
cloudDNS:
project: {{ .Values.projectName }}
serviceAccountSecretRef:
name: {{ .Values.cloudDnsServiceAccountSecret }}
key: {{ .Values.googleSecretFilename }}
13 changes: 13 additions & 0 deletions charts/certmanager/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Values.environment }}-cert
spec:
secretName: {{ .Values.environment }}-cert
renewBefore: 720h
dnsNames:
{{- range .Values.dnsHostnames }}
- {{ . }}
{{- end }}
issuerRef:
name: {{ .Values.issuerName }}
16 changes: 16 additions & 0 deletions charts/certmanager/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
issuerName: letsencrypt-issuer
letsEncryptServer: https://acme-v02.api.letsencrypt.org/directory
letsEncryptEmail: ""
projectName: ""
environment: ""
dnsHostnames: []
installCRDs: true
certManager:
enabled: true
installCRDs: true

# You can override anything from the cert-manager chart’s values here,
# for example the default namespace, extraArgs, etc.
# example:
ingressShim.defaultIssuerName: letsencrypt-issuer
ingressShim.defaultIssuerKind: ClusterIssuer

0 comments on commit 23bf077

Please sign in to comment.