blob: 59caf22db36bc89b2f7a0c3432ebc25606bb2a26 [file] [log] [blame]
Giorgi Lekveishviliae1a4a42023-12-07 13:23:17 +04001---
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 "cert-manager-webhook-pcloud.selfSignedIssuer" . }}
8 namespace: {{ .Values.certManager.namespace | quote }}
9 labels:
10 app: {{ include "cert-manager-webhook-pcloud.name" . }}
11 chart: {{ include "cert-manager-webhook-pcloud.chart" . }}
12 release: {{ .Release.Name }}
13 heritage: {{ .Release.Service }}
14spec:
15 selfSigned: {}
16---
17# Generate a CA Certificate used to sign certificates for the webhook
18apiVersion: cert-manager.io/v1
19kind: Certificate
20metadata:
21 name: {{ include "cert-manager-webhook-pcloud.rootCACertificate" . }}
22 namespace: {{ .Values.certManager.namespace | quote }}
23 labels:
24 app: {{ include "cert-manager-webhook-pcloud.name" . }}
25 chart: {{ include "cert-manager-webhook-pcloud.chart" . }}
26 release: {{ .Release.Name }}
27 heritage: {{ .Release.Service }}
28spec:
29 secretName: {{ include "cert-manager-webhook-pcloud.rootCACertificate" . }}
30 duration: 43800h # 5y
31 issuerRef:
32 name: {{ include "cert-manager-webhook-pcloud.selfSignedIssuer" . }}
33 commonName: "ca.cert-manager-webhook-pcloud.cert-manager"
34 isCA: true
35---
36# Create an Issuer that uses the above generated CA certificate to issue certs
37apiVersion: cert-manager.io/v1
38kind: Issuer
39metadata:
40 name: {{ include "cert-manager-webhook-pcloud.rootCAIssuer" . }}
41 namespace: {{ .Values.certManager.namespace | quote }}
42 labels:
43 app: {{ include "cert-manager-webhook-pcloud.name" . }}
44 chart: {{ include "cert-manager-webhook-pcloud.chart" . }}
45 release: {{ .Release.Name }}
46 heritage: {{ .Release.Service }}
47spec:
48 ca:
49 secretName: {{ include "cert-manager-webhook-pcloud.rootCACertificate" . }}
50---
51# Finally, generate a serving certificate for the webhook to use
52apiVersion: cert-manager.io/v1
53kind: Certificate
54metadata:
55 name: {{ include "cert-manager-webhook-pcloud.servingCertificate" . }}
56 namespace: {{ .Values.certManager.namespace | quote }}
57 labels:
58 app: {{ include "cert-manager-webhook-pcloud.name" . }}
59 chart: {{ include "cert-manager-webhook-pcloud.chart" . }}
60 release: {{ .Release.Name }}
61 heritage: {{ .Release.Service }}
62spec:
63 secretName: {{ include "cert-manager-webhook-pcloud.servingCertificate" . }}
64 duration: 8760h # 1y
65 issuerRef:
66 name: {{ include "cert-manager-webhook-pcloud.rootCAIssuer" . }}
67 dnsNames:
68 - {{ include "cert-manager-webhook-pcloud.fullname" . }}
69 - {{ include "cert-manager-webhook-pcloud.fullname" . }}.{{ .Values.certManager.namespace }}
70 - {{ include "cert-manager-webhook-pcloud.fullname" . }}.{{ .Values.certManager.namespace }}.svc