forked from kapicorp/kapitan-reference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tesoro-bundle.yml
206 lines (206 loc) · 6.47 KB
/
tesoro-bundle.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
manifests.kapicorp.com/generated: 'true'
labels:
name: tesoro
name: tesoro
namespace: tesoro
spec:
replicas: 1
selector:
matchLabels:
name: tesoro
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
name: tesoro
spec:
containers:
- args:
- --ca-file=/certs/cacert.pem
- --cert-file=/certs/cert.pem
- --key-file=/certs/cert.key
- --port=443
image: kapicorp/tesoro
imagePullPolicy: IfNotPresent
name: tesoro
ports:
- containerPort: 443
name: tesoro-api
protocol: TCP
- containerPort: 9095
name: tesoro-metrics
protocol: TCP
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
volumeMounts:
- mountPath: /certs
name: secrets
restartPolicy: Always
serviceAccountName: tesoro
terminationGracePeriodSeconds: 30
volumes:
- name: secrets
secret:
defaultMode: 420
secretName: tesoro
---
apiVersion: v1
kind: Service
metadata:
labels:
name: tesoro
name: tesoro
namespace: tesoro
spec:
ports:
- name: tesoro-api
port: 443
protocol: TCP
targetPort: tesoro-api
- name: tesoro-metrics
port: 9095
protocol: TCP
targetPort: tesoro-metrics
selector:
name: tesoro
sessionAffinity: None
type: ClusterIP
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
labels:
name: tesoro
name: tesoro
webhooks:
- clientConfig:
caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUV1akNDQXFJQ0NRRDZIdzJDZld6ZVp6QU5CZ2txaGtpRzl3MEJBUXNGQURBZk1SMHdHd1lEVlFRRERCUkQKUVMxMFpYTnZjbTh1ZEdWemIzSnZMbk4yWXpBZUZ3MHlNREV4TWpFeU1ERTVNemhhRncweU16QTVNVEV5TURFNQpNemhhTUI4eEhUQWJCZ05WQkFNTUZFTkJMWFJsYzI5eWJ5NTBaWE52Y204dWMzWmpNSUlDSWpBTkJna3Foa2lHCjl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUEzbVlZNXIvTVYrSU9hMy9DZGxuRGVrdk9yQnVpeUd5MXUwZUYKOHU2RGQzdkNRcnp3MytLUmZrSXlHOW1lcDl3NW16bm5IMjdDZzVDN0t5Y040NVRaTnE3cHFESmhHVXVMWC9uRwpqNmxvM01qdnVpS0dtTG5JaHlEVjQyS1hDamxnbWVRaGhOdjFScFQ0cTFZeWhBWlF5RDU1a2FHUHQ0UmtQd21pCnkxMU04TTBXTUZDeW50OFhYZUNqcHVYVXdTV1V3cVE2ZVNJRFFnM1d1cnp6V1dJbVVwWTNPUDVTVWNYSHhFd2UKakFaT1hqSEJkZzJwWHVFK2hYN2VwektJUXMwbkpnbmFtakVPRlZhNnMxNDlEWkpjOU82VTg4dmVJMTNyZ3A4QwpPVUphdUlDOHBQNDdyZ2xadkNadEo2YmRPSDhaK1E2SEl1UGRic2tUM2JkS1dlTmMzTnBZSGI5U0tRNW82M3NqCmhBWUNpU3Q4YUVjbEtLdDF6U0xXMm5qZk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3SFYwVThHa0hWQTZMdU1lM05Sc3Y1WGRZL2QydEoKSlhLNFFYL082WWlHRFpCeGtlZVJDVzMwWFhMTWw1REJWTUFGK2o2WUg1M3BjSnE4R2NHdkVDUk8zSGxCSmJVMwp2a3FFVFV0L1Q3ZE5LRFFISzM2azhuMWdlTEhJVndqRm16NHIzdkVieWdZZUlNVGRaZTQ3c2hTcjhTajNITm4rCklWRnhSZlV4anpuTXdSNjB3bm5JVk5lM2t0YmFMM1lFMFFmdnJiV2xaanAwZG1zQWh6UE5qYWJob0JBVFVCVWUKd0NpMk5vQzVJRU5pSU1MY1VjUT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
service:
name: tesoro
namespace: tesoro
path: /mutate
failurePolicy: Fail
name: tesoro.kapicorp.com
objectSelector:
matchLabels:
tesoro.kapicorp.com: enabled
rules:
- apiGroups:
- ''
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
resources:
- '*'
- apiGroups:
- apps
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
resources:
- deployments
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
name: tesoro-metrics
name: tesoro-metrics
namespace: tesoro
spec:
endpoints:
- interval: 15s
path: /
targetPort: 9095
jobLabel: tesoro-metrics
namespaceSelector:
matchNames:
- tesoro
selector:
matchLabels:
name: tesoro
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
name: tesoro.rules
name: tesoro.rules
namespace: tesoro
spec:
groups:
- name: tesoro.rules
rules:
- alert: TesoroFailedRequests
annotations:
message: tesoro_requests_failed_total has increased above 0
expr: sum by (job, namespace, service, env) (increase(tesoro_requests_failed_total[5m]))
> 0
for: 1m
labels:
severity: warning
- alert: KapitanRevealRequestFailures
annotations:
message: kapitan_reveal_requests_failed_total has increased above 0
expr: sum by (job, namespace, service, env) (increase(kapitan_reveal_requests_failed_total[5m]))
> 0
for: 1m
labels:
severity: warning
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
name: tesoro
name: tesoro
rules:
- apiGroups:
- ''
resources:
- pods
- events
- secrets
- configmaps
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
name: tesoro
name: tesoro
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tesoro
subjects:
- kind: ServiceAccount
name: tesoro
namespace: tesoro