-
Notifications
You must be signed in to change notification settings - Fork 6
/
eval.yml
337 lines (311 loc) · 7.95 KB
/
eval.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: tweed
name: broker
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
namespace: tweed
name: broker
rules:
- apiGroups: ["", "batch", "extensions", "apps", "autoscaling"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
namespace: tweed
name: broker
subjects:
- kind: ServiceAccount
namespace: tweed
name: broker
roleRef:
kind: ClusterRole
name: broker
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Secret
metadata:
name: tweed
namespace: tweed
stringData:
username: tweed
password: tweed
---
apiVersion: v1
kind: ConfigMap
metadata:
name: vault
namespace: tweed
data:
local.json: |
{
"disable_mlock": 1,
"backend": {
"file": {
"path": "/vault/data/file"
}
},
"listener": {
"tcp": {
"address": "0.0.0.0:8200",
"tls_disable": 1
},
},
"default_lease_ttl": "168h",
"max_lease_ttl": "720h"
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: tweed
namespace: tweed
data:
tweed.yml: |
prefix: ''
catalog.yml: |
catalog:
services:
- name: PostgreSQL
id: postgres
description: |
A standalone, single-node PostgreSQL RDBMS
metadata: {}
tags: [postgres, psql, pg, shared]
bindings_retrievable: true
instances_retrievable: true
plans:
- name: v9
id: v9
bindable: true
description: |
PostgreSQL version 9.x
tweed:
infrastructure: k8s
stencil: postgres/standalone
limit: 2
config:
version: '9'
credentials:
version: 9
tryit: (( concat "PGPASSWORD=" credentials.password " psql -h " credentials.host " -p " credentials.port " -U " credentials.username " " credentials.database ))
- name: v10
id: v10
bindable: true
description: |
PostgreSQL version 10.x
tweed:
infrastructure: k8s
stencil: postgres/standalone
limit: 1
config:
version: '10'
credentials:
version: 10
tryit: (( concat "PGPASSWORD=" credentials.password " psql -h " credentials.host " -p " credentials.port " -U " credentials.username " " credentials.database ))
- name: v11
id: v11
bindable: true
description: |
PostgreSQL version 11.x
tweed:
infrastructure: k8s
stencil: postgres/standalone
limit: 1
config:
version: '11'
credentials:
version: 11
tryit: (( concat "PGPASSWORD=" credentials.password " psql -h " credentials.host " -p " credentials.port " -U " credentials.username " " credentials.database ))
- name: v12
id: v12
bindable: true
description: |
PostgreSQL version 12.x
tweed:
infrastructure: k8s
stencil: postgres/standalone
limit: 1
config:
version: '12'
credentials:
version: 12
tryit: (( concat "PGPASSWORD=" credentials.password " psql -h " credentials.host " -p " credentials.port " -U " credentials.username " " credentials.database ))
- name: v13
id: v13
bindable: true
description: |
PostgreSQL version 13.x
tweed:
infrastructure: k8s
stencil: postgres/standalone
limit: 1
config:
version: '13'
credentials:
version: 13
tryit: (( concat "PGPASSWORD=" credentials.password " psql -h " credentials.host " -p " credentials.port " -U " credentials.username " " credentials.database ))
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: vault-pv
namespace: tweed
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 500Mi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tweed-pv
namespace: tweed
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 500Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: tweed
name: broker
labels:
app: tweed
spec:
replicas: 1
selector:
matchLabels:
app: tweed
template:
metadata:
labels:
app: tweed
spec:
serviceAccountName: broker
containers:
- name: vault
image: vault:latest
imagePullPolicy: Always
ports:
- name: tweed
containerPort: 8080
env:
- name: VAULT_API_ADDR
value: http://127.0.0.1:8200
command:
- vault
- server
- -config
- /vault/config/local.json
volumeMounts:
- name: vault
mountPath: /vault/config
- name: vault-data
mountPath: /vault/data
readOnly: false
- name: broker
image: tweedproject/kernel:broker
imagePullPolicy: Always
env:
- name: INIT_VAULT
value: http://127.0.0.1:8200
- name: USE_THIS_KUBERNETES
value: 'yes'
- name: TWEED_LISTEN
value: ':8080'
- name: TWEED_URL
value: http://127.0.0.1:8080
- name: TWEED_CONFIG_MOUNT
value: /tweed-provided
- name: TWEED_HTTP_USERNAME
valueFrom:
secretKeyRef:
name: tweed
key: username
- name: TWEED_USERNAME
valueFrom:
secretKeyRef:
name: tweed
key: username
- name: TWEED_HTTP_PASSWORD
valueFrom:
secretKeyRef:
name: tweed
key: password
- name: TWEED_PASSWORD
valueFrom:
secretKeyRef:
name: tweed
key: password
volumeMounts:
- name: tweed
mountPath: /tweed-provided
- name: tweed-data
mountPath: /tweed/etc/config.d
readOnly: false
volumes:
- name: tweed
configMap:
name: tweed
- name: vault
configMap:
name: vault
- name: tweed-data
persistentVolumeClaim:
claimName: tweed-pv
- name: vault-data
persistentVolumeClaim:
claimName: vault-pv
---
apiVersion: v1
kind: Service
metadata:
namespace: tweed
name: broker
labels:
app: tweed
spec:
type: ClusterIP
ports:
- name: tweed
port: 80
protocol: TCP
targetPort: tweed
selector:
app: tweed
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: tweed
name: broker
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
- tweed.starkandwayne.com
secretName: ingress-tls
rules:
- host: tweed.starkandwayne.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: broker
port:
name: tweed