Skip to content

Commit

Permalink
feat(helm): release cluster-issuer 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
isac322 committed Jan 1, 2024
1 parent 83977de commit b32b51c
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 60 deletions.
19 changes: 0 additions & 19 deletions charts/cluster-acme-issuer/templates/cluster-issuer.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions charts/cluster-acme-issuer/templates/external-secret.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions charts/cluster-acme-issuer/values.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: cluster-acme-issuer
description: cert-manager ClusterIssuer for ACME
name: cluster-issuer
description: cert-manager ClusterIssuer

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "cluster-acme-issuer.name" -}}
{{- define "cluster-issuer.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "cluster-acme-issuer.fullname" -}}
{{- define "cluster-issuer.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cluster-acme-issuer.chart" -}}
{{- define "cluster-issuer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "cluster-acme-issuer.labels" -}}
helm.sh/chart: {{ include "cluster-acme-issuer.chart" . }}
{{ include "cluster-acme-issuer.selectorLabels" . }}
{{- define "cluster-issuer.labels" -}}
helm.sh/chart: {{ include "cluster-issuer.chart" . }}
{{ include "cluster-issuer.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "cluster-acme-issuer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cluster-acme-issuer.name" . }}
{{- define "cluster-issuer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cluster-issuer.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "cluster-acme-issuer.serviceAccountName" -}}
{{- define "cluster-issuer.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "cluster-acme-issuer.fullname" .) .Values.serviceAccount.name }}
{{- default (include "cluster-issuer.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
21 changes: 21 additions & 0 deletions charts/cluster-issuer/templates/acme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.acme.enabled }}
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: {{ include "cluster-issuer.fullname" . }}-acme
labels:
{{- include "cluster-issuer.labels" . | nindent 4 }}
spec:
acme:
server: {{ .Values.acme.server }}
email: {{ .Values.acme.email }}
preferredChain: "ISRG Root X1"
privateKeySecretRef:
name: {{ include "cluster-issuer.fullname" . }}-privkey
solvers:
- dns01:
cloudflare:
apiTokenSecretRef:
name: {{ include "cluster-issuer.fullname" . }}
key: token
{{- end }}
21 changes: 21 additions & 0 deletions charts/cluster-issuer/templates/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.acme.enabled }}
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ include "cluster-issuer.fullname" . }}
labels:
{{- include "cluster-issuer.labels" . | nindent 4 }}
spec:
refreshInterval: 1h
target:
name: {{ include "cluster-issuer.fullname" . }}
deletionPolicy: Delete
creationPolicy: Owner
data:
- remoteRef:
key: {{ required "A valid .Values.acme.externalSecrets.remoteSecretName entry required!" .Values.acme.externalSecrets.remoteSecretName }}
secretKey: token
secretStoreRef:
name: {{ required "A valid .Values.acme.externalSecrets.secretStore.name entry required!" .Values.acme.externalSecrets.secretStore.name }}
kind: {{ required "A valid .Values.acme.externalSecrets.secretStore.kind entry required!" .Values.acme.externalSecrets.secretStore.kind }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/cluster-issuer/templates/self-signed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.selfSigned.enabled }}
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: {{ include "cluster-issuer.fullname" . }}-self-signed
labels:
{{- include "cluster-issuer.labels" . | nindent 4 }}
spec:
selfSigned: {}
{{- end }}
15 changes: 15 additions & 0 deletions charts/cluster-issuer/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
acme:
enabled: true

email: ""
# could be https://acme-staging-v02.api.letsencrypt.org/directory for testing
server: "https://acme-v02.api.letsencrypt.org/directory"

externalSecrets:
remoteSecretName: ""
secretStore:
name: ""
kind: ClusterSecretStore

selfSigned:
enabled: true

0 comments on commit b32b51c

Please sign in to comment.