-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yml
101 lines (99 loc) · 2.19 KB
/
deployment.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
apiVersion: apps/v1
kind: Deployment
metadata:
name: inovex-webhook
namespace: default
labels:
app: inovex-webhook
spec:
replicas: 1
selector:
matchLabels:
app: inovex-webhook
template:
metadata:
labels:
app: inovex-webhook
spec:
containers:
- name: inovex-webhook
image: webhooktest:0.1.0
imagePullPolicy: IfNotPresent
volumeMounts:
- name: webhook-certs
mountPath: /etc/certs
resources:
limits:
memory: "128Mi"
cpu: "100m"
securityContext:
readOnlyRootFilesystem: true
ports:
- containerPort: 8443
volumes:
- name: webhook-certs
secret:
secretName: inovex-webhook-certs
---
apiVersion: v1
kind: Service
metadata:
name: inovex-webhook
namespace: default
labels:
app: inovex-webhook
spec:
selector:
app: inovex-webhook
ports:
- name: webhook
port: 8443
targetPort: 8443
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: inovex-webhook-mutate
webhooks:
- name: webhook-mutate.inovex.io
clientConfig:
service:
name: inovex-webhook
namespace: default
path: "/mutate"
port: 8443
caBundle: "$CA_BUNDLE"
rules:
- operations: ["CREATE","UPDATE"]
apiGroups: ["apps"]
apiVersions: ["v1"]
resources: ["deployments"]
scope: "*"
failurePolicy: Fail
admissionReviewVersions: ["v1"]
sideEffects: None
timeoutSeconds: 10
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: inovex-webhook-validate
webhooks:
- name: webhook-validate.inovex.io
clientConfig:
service:
name: inovex-webhook
namespace: default
path: "/validate"
port: 8443
caBundle: "$CA_BUNDLE"
rules:
- operations: ["CREATE","UPDATE"]
apiGroups: ["apps"]
apiVersions: ["v1"]
resources: ["deployments"]
scope: "*"
failurePolicy: Fail
admissionReviewVersions: ["v1"]
sideEffects: None
timeoutSeconds: 10