-
Notifications
You must be signed in to change notification settings - Fork 3
/
k8s.yaml
112 lines (112 loc) · 2.16 KB
/
k8s.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
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
101
102
103
104
105
106
107
108
109
110
111
112
apiVersion: v1
kind: Namespace
metadata:
name: ca-injector
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: injector
namespace: admission
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ca-injector
namespace: admission
spec:
replicas: 1
selector:
matchLabels:
app: ca-injector
template:
metadata:
labels:
app: ca-injector
spec:
serviceAccount: injector
containers:
- name: ca-injector
image: andrewstuart/ca-injector
imagePullPolicy: Always
resources:
requests:
cpu: 100m
memory: 200Mi
limits:
cpu: 1
memory: 200Mi
ports:
- containerPort: 8443
volumeMounts:
- name: cert
mountPath: /cert
volumes:
- name: cert
secret:
secretName: injector.admission.svc.cluster.local.tls
---
apiVersion: v1
kind: Service
metadata:
name: ca-injector
namespace: admission
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/scheme: https
prometheus.io/address: ca-injector.admission.svc.cluster.local
# prometheus.io/port: "8443"
spec:
ports:
- port: 443
targetPort: 8443
selector:
app: ca-injector
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: injector-mwh-cert
namespace: admission
spec:
secretName: injector.admission.svc.cluster.local.tls
dnsNames:
- ca-injector.admission.svc.cluster.local
- ca-injector.admission.svc
issuerRef:
name: vault # Replace this issuer with your own issuer
kind: ClusterIssuer
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ca-injector
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- read
- list
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ca-injector-list-delete-pods
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ca-injector
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: system:serviceaccount:admission:injector