blob: a5125d53c848aa5ead27130b8cf382de4e3038d7 [file] [log] [blame]
Mohammed Naser7c211b72023-02-21 16:39:19 +00001---
2# Create a selfsigned Issuer, in order to create a root CA certificate for
3# signing webhook serving certificates
4apiVersion: cert-manager.io/v1
5kind: Issuer
6metadata:
7 name: {{ include "webhook.selfSignedIssuer" . }}
8 namespace: {{ .Release.Namespace | quote }}
9 labels:
10 app: {{ include "webhook.name" . }}
11 chart: {{ include "webhook.chart" . }}
12 release: {{ .Release.Name }}
13 heritage: {{ .Release.Service }}
14spec:
15 selfSigned: {}
16
17---
18
19# Generate a CA Certificate used to sign certificates for the webhook
20apiVersion: cert-manager.io/v1
21kind: Certificate
22metadata:
23 name: {{ include "webhook.rootCACertificate" . }}
24 namespace: {{ .Release.Namespace | quote }}
25 labels:
26 app: {{ include "webhook.name" . }}
27 chart: {{ include "webhook.chart" . }}
28 release: {{ .Release.Name }}
29 heritage: {{ .Release.Service }}
30spec:
31 secretName: {{ include "webhook.rootCACertificate" . }}
32 duration: {{ .Values.rootCACertificate.duration }}
33 issuerRef:
34 name: {{ include "webhook.selfSignedIssuer" . }}
35 commonName: "ca.webhook.cert-manager"
36 isCA: true
37
38---
39
40# Create an Issuer that uses the above generated CA certificate to issue certs
41apiVersion: cert-manager.io/v1
42kind: Issuer
43metadata:
44 name: {{ include "webhook.rootCAIssuer" . }}
45 namespace: {{ .Release.Namespace | quote }}
46 labels:
47 app: {{ include "webhook.name" . }}
48 chart: {{ include "webhook.chart" . }}
49 release: {{ .Release.Name }}
50 heritage: {{ .Release.Service }}
51spec:
52 ca:
53 secretName: {{ include "webhook.rootCACertificate" . }}
54
55---
56
57# Finally, generate a serving certificate for the webhook to use
58apiVersion: cert-manager.io/v1
59kind: Certificate
60metadata:
61 name: {{ include "webhook.servingCertificate" . }}
62 namespace: {{ .Release.Namespace | quote }}
63 labels:
64 app: {{ include "webhook.name" . }}
65 chart: {{ include "webhook.chart" . }}
66 release: {{ .Release.Name }}
67 heritage: {{ .Release.Service }}
68spec:
69 secretName: {{ include "webhook.servingCertificate" . }}
70 duration: {{ .Values.servingCertificate.duration }}
71 issuerRef:
72 name: {{ include "webhook.rootCAIssuer" . }}
73 dnsNames:
74 - {{ include "webhook.fullname" . }}
75 - {{ include "webhook.fullname" . }}.{{ .Release.Namespace }}
76 - {{ include "webhook.fullname" . }}.{{ .Release.Namespace }}.svc