-
Notifications
You must be signed in to change notification settings - Fork 23
/
clowdapp.yaml
362 lines (355 loc) · 10.3 KB
/
clowdapp.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
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
---
apiVersion: v1
kind: Template
metadata:
name: ros-backend
objects:
- apiVersion: cloud.redhat.com/v1alpha1
kind: ClowdApp
metadata:
name: ros-backend
spec:
envName: ${ENV_NAME}
featureFlags: true
dependencies:
- host-inventory
- rbac
- engine
deployments:
- name: api
replicas: ${{API_REPLICA_COUNT}}
webServices:
public:
enabled: true
apiPath: ros
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["sh"]
args: ["-c", "export FLASK_APP=manage.py && poetry run flask db upgrade && poetry run flask seed && poetry run gunicorn ros.api.main:app"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSRHEL}
memory: ${MEMORY_REQUEST_ROSRHEL}
limits:
cpu: ${CPU_LIMIT_ROSRHEL}
memory: ${MEMORY_LIMIT_ROSRHEL}
livenessProbe:
failureThreshold: 3
httpGet:
path: /api/ros/v1/status
port: 8000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /api/ros/v1/status
port: 8000
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: PATH_PREFIX
value: /api
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: ENABLE_RBAC
value: "${ENABLE_RBAC}"
- name: DB_POOL_SIZE
value: ${DB_POOL_SIZE}
- name: DB_MAX_OVERFLOW
value: ${DB_MAX_OVERFLOW}
- name: UNLEASH_URL
value: ${UNLEASH_URL}
- name: UNLEASH_TOKEN
valueFrom:
secretKeyRef:
name: ${UNLEASH_SECRET_NAME}
key: CLIENT_ACCESS_TOKEN
optional: true
- name: BYPASS_UNLEASH
value: ${BYPASS_UNLEASH}
- name: inventory-events-processor
replicas: ${{INVENTORY_PROCESSOR_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["bash"]
args: ["-c", "python -m ros.processor.inventory_events_consumer"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSRHEL}
memory: ${MEMORY_REQUEST_ROSRHEL}
limits:
cpu: ${CPU_LIMIT_ROSRHEL}
memory: ${MEMORY_LIMIT_ROSRHEL}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: DB_POOL_SIZE
value: ${DB_POOL_SIZE}
- name: DB_MAX_OVERFLOW
value: ${DB_MAX_OVERFLOW}
- name: UNLEASH_URL
value: ${UNLEASH_URL}
- name: UNLEASH_TOKEN
valueFrom:
secretKeyRef:
name: ${UNLEASH_SECRET_NAME}
key: CLIENT_ACCESS_TOKEN
optional: true
- name: BYPASS_UNLEASH
value: ${BYPASS_UNLEASH}
- name: engine-result-processor
replicas: ${{ENGINE_PROCESSOR_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["bash"]
args: ["-c", "python -m ros.processor.insights_engine_consumer"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSRHEL}
memory: ${MEMORY_REQUEST_ROSRHEL}
limits:
cpu: ${CPU_LIMIT_ROSRHEL}
memory: ${MEMORY_LIMIT_ROSRHEL}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: DB_POOL_SIZE
value: ${DB_POOL_SIZE}
- name: DB_MAX_OVERFLOW
value: ${DB_MAX_OVERFLOW}
- name: UNLEASH_URL
value: ${UNLEASH_URL}
- name: UNLEASH_TOKEN
valueFrom:
secretKeyRef:
name: ${UNLEASH_SECRET_NAME}
key: CLIENT_ACCESS_TOKEN
optional: true
- name: BYPASS_UNLEASH
value: ${BYPASS_UNLEASH}
- name: garbage-collector-processor
replicas: ${{GARBAGE_COLLECTOR_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["bash"]
args: ["-c", "python -m ros.processor.garbage_collector"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSRHEL}
memory: ${MEMORY_REQUEST_ROSRHEL}
limits:
cpu: ${CPU_LIMIT_ROSRHEL}
memory: ${MEMORY_LIMIT_ROSRHEL}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: GARBAGE_COLLECTION_INTERVAL
value: ${GARBAGE_COLLECTION_INTERVAL}
- name: DAYS_UNTIL_STALE
value: ${DAYS_UNTIL_STALE}
- name: DB_POOL_SIZE
value: ${DB_POOL_SIZE}
- name: DB_MAX_OVERFLOW
value: ${DB_MAX_OVERFLOW}
- name: UNLEASH_URL
value: ${UNLEASH_URL}
- name: UNLEASH_TOKEN
valueFrom:
secretKeyRef:
name: ${UNLEASH_SECRET_NAME}
key: CLIENT_ACCESS_TOKEN
optional: true
- name: BYPASS_UNLEASH
value: ${BYPASS_UNLEASH}
database:
name: ros
version: 13
inMemoryDb: true
kafkaTopics:
- topicName: platform.inventory.events
partitions: 1
- topicName: platform.engine.results
partitions: 1
- topicName: platform.notifications.ingress
partitions: 1
testing:
iqePlugin: ros
jobs:
- name: org-id-populator
podSpec:
image: quay.io/cloudservices/tenant-utils:latest
command:
- ./org-id-column-populator
- -C
- -a
- account
- -o
- org_id
- -t
- rh_accounts
- --ean-translator-addr
- http://${TENANT_TRANSLATOR_HOST}:${TENANT_TRANSLATOR_PORT}
- --prometheus-push-addr
- ${PROMETHEUS_PUSHGATEWAY}
env:
- name: TENANT_TRANSLATOR_HOST
value: ${TENANT_TRANSLATOR_HOST}
- name: TENANT_TRANSLATOR_PORT
value: ${TENANT_TRANSLATOR_PORT}
- name: LOG_FORMAT
value: ${POPULATOR_LOG_FORMAT}
- name: LOG_BATCH_FREQUENCY
value: '1s'
resources:
limits:
cpu: 300m
memory: 1Gi
requests:
cpu: 50m
memory: 512Mi
parameters:
- description: Enable rbac needs to be "True" or "False"
name: ENABLE_RBAC
value: "True"
- description : ClowdEnvironment name
name: ENV_NAME
required: true
- description: Replica count for api pod
name: API_REPLICA_COUNT
value: "1"
- description: Replica count for inventory processor pod
name: INVENTORY_PROCESSOR_REPLICA_COUNT
value: "1"
- description: Replica count for engine processor pod
name: ENGINE_PROCESSOR_REPLICA_COUNT
value: "1"
- description: Replica count for garbage collector pod
name: GARBAGE_COLLECTOR_REPLICA_COUNT
value: "1"
- description: Image NAME
name: IMAGE
required: true
value: quay.io/redhat-services-prod/insights-management-tenant/insights-resource-optimization/ros-backend
- description: Image tag
name: IMAGE_TAG
required: true
- description: Initial cpu request.
displayName: CPU Request
name: CPU_REQUEST_ROSRHEL
required: true
value: 500m
- description: Initial amount of memory the container will request.
displayName: Memory Request
name: MEMORY_REQUEST_ROSRHEL
required: true
value: 1Gi
- description: Maximum amount of memory the Django container can use.
displayName: Memory Limit
name: MEMORY_LIMIT_ROSRHEL
required: true
value: 1Gi
- description: Maximum amount of CPU the build container can use.
displayName: CPU Limit
name: CPU_LIMIT_ROSRHEL
required: true
value: '1'
- description: Is clowder enabled
name: CLOWDER_ENABLED
value: "True"
- description: The interval at which garbage collection should run (in seconds)
name: GARBAGE_COLLECTION_INTERVAL
value: "86400"
- description: Number of days after which data is considered to be outdated
name: DAYS_UNTIL_STALE
value: "45"
- description: Host for the EAN to OrgId translator.
name: TENANT_TRANSLATOR_HOST
required: true
value: 'gateway.3scale-dev.svc.cluster.local'
- description: Port for the EAN to OrgId translator.
name: TENANT_TRANSLATOR_PORT
value: '8892'
- name: PROMETHEUS_PUSHGATEWAY
value: "localhost"
- name: POPULATOR_LOG_FORMAT
value: cloudwatch
- name: DB_POOL_SIZE
value: "20"
- name: DB_MAX_OVERFLOW
value: "20"
# Feature flags
- description: Unleash secret name
name: UNLEASH_SECRET_NAME
value: bypass
- description: Unleash API url
name: UNLEASH_URL
- description: disable Unleash (feature flags), defaulting to fallback values
name: BYPASS_UNLEASH
value: 'false'