forked from topolvm/topolvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
certificates.yaml
49 lines (49 loc) · 1.16 KB
/
certificates.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Create a selfsigned Issuer, in order to create a root CA certificate for
# signing webhook serving certificates
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: webhook-selfsign
namespace: topolvm-system
spec:
selfSigned: {}
---
# Generate a CA Certificate used to sign certificates for the webhook
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: webhook-ca
namespace: topolvm-system
spec:
secretName: webhook-ca
duration: 87600h0m0s # 10y
issuerRef:
name: webhook-selfsign
commonName: "ca.webhook.topolvm"
isCA: true
---
# Create an Issuer that uses the above generated CA certificate to issue certs
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: webhook-ca
namespace: topolvm-system
spec:
ca:
secretName: webhook-ca
---
# Finally, generate a serving certificate for the webhook to use
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: mutatingwebhook
namespace: topolvm-system
spec:
secretName: mutatingwebhook
duration: 8760h0m0s # 1y
issuerRef:
name: webhook-ca
dnsNames:
- controller
- controller.topolvm-system
- controller.topolvm-system.svc