-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cert-manager-setup] allow for multiple clusterissuers
- Loading branch information
1 parent
36ceabf
commit 756183c
Showing
9 changed files
with
202 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,43 @@ | ||
clusterissuer: | ||
name: kubernetes-ca | ||
spec: | ||
ca: | ||
secretName: kubernetes-intermediate-ca | ||
issuers: | ||
- name: kubernetes-root-issuer | ||
secretName: kubernetes-root-ca | ||
|
||
certificates: | ||
- name: kubernetes-intermediate-ca | ||
# where to store this certificate | ||
secretName: kubernetes-intermediate-ca | ||
issuerRef: | ||
name: kubernetes-root-issuer | ||
kind: Issuer | ||
# These are the default usages for reference | ||
usages: | ||
- "digital signature" | ||
- "key encipherment" | ||
commonName: cert-manager | ||
duration: 87600h | ||
dnsNames: [] | ||
- name: my-certificate | ||
# where to store this certificate | ||
secretName: my-certificate-secret | ||
issuerRef: | ||
name: kubernetes-root-issuer | ||
kind: Issuer | ||
# These are the default usages for reference | ||
usages: | ||
- "digital signature" | ||
- "key encipherment" | ||
commonName: cert-manager | ||
duration: 87600h | ||
dnsNames: | ||
- example.com | ||
- www.example.com | ||
|
||
clusterissuers: | ||
- name: kubernetes-ca | ||
spec: | ||
ca: | ||
secretName: kubernetes-intermediate-ca | ||
- name: my-ca | ||
spec: | ||
ca: | ||
secretName: my-certificate-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{- if .Values.certificates }} | ||
{{- range .Values.certificates }} | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ .name }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-3" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
isCA: true | ||
commonName: cert-manager | ||
duration: {{ .duration | default "87600h" | quote }} | ||
secretName: {{ .secretName }} | ||
issuerRef: | ||
name: {{ .issuerRef.name }} | ||
kind: {{ .issuerRef.kind }} | ||
{{- if .issuerRef.usages }} | ||
usages: | ||
{{- range .issuerRef.usages }} | ||
- {{ . | quote -}} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .dnsNames }} | ||
dnsNames: | ||
{{- range .dnsNames }} | ||
- {{ . | quote -}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# DEPRECATED, this file should be deleted soon | ||
{{ if .Values.clusterissuer }} | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Issuer | ||
metadata: | ||
name: kubernetes-root-issuer | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-4" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
ca: | ||
secretName: kubernetes-root-ca | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Certificate | ||
metadata: | ||
name: kubernetes-intermediate-ca | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-3" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
isCA: true | ||
commonName: cert-manager | ||
duration: 87600h | ||
secretName: kubernetes-intermediate-ca | ||
issuerRef: | ||
name: kubernetes-root-issuer | ||
kind: Issuer | ||
# These are the default usages for reference | ||
usages: | ||
- "digital signature" | ||
- "key encipherment" | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: {{ required "clusterissuer must have a name" .Values.clusterissuer.name }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-2" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
{{ required "clusterissuer must have a spec" .Values.clusterissuer.spec | toYaml | indent 4 }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.clusterissuers }} | ||
{{- range .Values.clusterissuers }} | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: {{ required "clusterissuer must have a name" .name }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-2" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
{{ required "clusterissuer must have a spec" .spec | toYaml | indent 4 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,19 @@ | ||
{{ if .Values.clusterissuer }} | ||
{{- if .Values.issuers }} | ||
{{- $namespace := .Release.Namespace }} | ||
{{- range .Values.issuers }} | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Issuer | ||
metadata: | ||
name: kubernetes-root-issuer | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ .name }} | ||
namespace: {{ .namespace }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-4" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
ca: | ||
secretName: kubernetes-root-ca | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Certificate | ||
metadata: | ||
name: kubernetes-intermediate-ca | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-3" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
isCA: true | ||
commonName: cert-manager | ||
duration: 87600h | ||
secretName: kubernetes-intermediate-ca | ||
issuerRef: | ||
name: kubernetes-root-issuer | ||
kind: Issuer | ||
# These are the default usages for reference | ||
usages: | ||
- "digital signature" | ||
- "key encipherment" | ||
--- | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: {{ required "clusterissuer must have a name" .Values.clusterissuer.name }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-2" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
{{ required "clusterissuer must have a spec" .Values.clusterissuer.spec | toYaml | indent 4 }} | ||
{{ end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters