1
1
apiVersion : v1
2
- kind : Secret
3
- metadata :
4
- name : admission-tls
5
- type : Opaque
6
- data :
7
- webhook.crt : " " # base64 encoded certificate
8
- webhook.key : " " # base64 encoded private key
9
- ---
10
- apiVersion : v1
11
2
kind : Service
12
3
metadata :
13
- name : mutating-webhook
4
+ name : admission-controller
5
+ namespace : tpu-provisioner-system
14
6
spec :
15
7
selector :
16
- app : mutating-webhook
8
+ app : admission-controller
17
9
ports :
18
10
- port : 5000
19
11
---
20
12
apiVersion : admissionregistration.k8s.io/v1
21
13
kind : MutatingWebhookConfiguration
22
14
metadata :
23
- name : mutating-webhook
15
+ name : tpu-provisioner-admission-controller
16
+ annotations :
17
+ cert-manager.io/inject-ca-from : tpu-provisioner-system/admission-controller
24
18
webhooks :
25
- - name : mutating-webhook.default .svc
19
+ - name : admission-controller.tpu-provisioner-system .svc
26
20
matchPolicy : Equivalent
27
21
admissionReviewVersions : ["v1"]
28
22
sideEffects : None
@@ -32,34 +26,36 @@ webhooks:
32
26
apiVersions : ["v1"]
33
27
resources : ["jobs"]
34
28
scope : " Namespaced"
35
- failurePolicy : Ignore
29
+ failurePolicy : Fail
36
30
timeoutSeconds : 20
37
31
clientConfig :
38
- caBundle : # base64 CA bundle here
32
+ # caBundle: # base64 CA bundle here
39
33
service :
40
- namespace : default
41
- name : mutating-webhook
34
+ namespace : tpu-provisioner-system
35
+ name : admission-controller
42
36
path : /mutate
43
37
port : 5000
44
38
---
45
39
apiVersion : apps/v1
46
40
kind : Deployment
47
41
metadata :
48
- name : mutating-webhook
42
+ name : admission-controller
43
+ namespace : tpu-provisioner-system
49
44
spec :
50
45
replicas : 1
51
46
selector :
52
47
matchLabels :
53
- app : mutating-webhook
48
+ app : admission-controller
54
49
template :
55
50
metadata :
56
51
labels :
57
- app : mutating-webhook
52
+ app : admission-controller
58
53
spec :
59
54
containers :
60
- - name : mutating-webhook
61
- image : " " # build container image, push to repository and add it here
62
- imagePullPolicy : Always
55
+ - name : webhook
56
+ # build container image, push to repository and add it here
57
+ image : example.com/tpu-provisioner/admission-controller
58
+ imagePullPolicy : IfNotPresent
63
59
ports :
64
60
- containerPort : 5000
65
61
env :
75
71
volumes :
76
72
- name : certs-volume
77
73
secret :
78
- secretName : admission-tls
74
+ secretName : admission-controller-tls
75
+ ---
76
+ apiVersion : cert-manager.io/v1
77
+ kind : Issuer
78
+ metadata :
79
+ name : admission-controller-issuer
80
+ namespace : tpu-provisioner-system
81
+ spec :
82
+ selfSigned : {}
83
+ ---
84
+ apiVersion : cert-manager.io/v1
85
+ kind : Certificate
86
+ metadata :
87
+ name : admission-controller
88
+ namespace : tpu-provisioner-system
89
+ spec :
90
+ secretName : admission-controller-tls
91
+ dnsNames :
92
+ - admission-controller.tpu-provisioner-system.svc
93
+ issuerRef :
94
+ name : admission-controller-issuer
0 commit comments