-
Notifications
You must be signed in to change notification settings - Fork 24
/
clowdapp.yaml
308 lines (305 loc) · 8.93 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
---
apiVersion: v1
kind: Template
metadata:
name: ros-ocp-backend
objects:
- apiVersion: cloud.redhat.com/v1alpha1
kind: ClowdApp
metadata:
name: ros-ocp-backend
spec:
envName: ${ENV_NAME}
dependencies:
- ingress
- rbac
- sources-api
deployments:
- name: processor
replicas: ${{PROCESSOR_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["sh"]
args: ["-c", "./rosocp db migrate up && ./rosocp start processor"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSOCP}
memory: ${MEMORY_REQUEST_ROSOCP}
limits:
cpu: ${CPU_LIMIT_ROSOCP}
memory: ${MEMORY_LIMIT_ROSOCP}
livenessProbe:
failureThreshold: 3
httpGet:
path: /metrics
port: 9000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /metrics
port: 9000
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: KRUIZE_HOST
value: ${KRUIZE_HOST}
- name: KRUIZE_PORT
value: ${KRUIZE_PORT}
- name: KRUIZE_WAIT_TIME
value: ${KRUIZE_WAIT_TIME}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: SERVICE_NAME
value: "rosocp-processor"
- name: CW_LOG_STREAM_NAME
value: "rosocp-backend"
- name: LOG_LEVEL
value: ${LOG_LEVEL}
- name: recommendation-poller
replicas: ${{POLLER_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["sh"]
args: ["-c", "./rosocp db migrate up && ./rosocp start recommendation-poller"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSOCP}
memory: ${MEMORY_REQUEST_ROSOCP}
limits:
cpu: ${CPU_LIMIT_ROSOCP}
memory: ${MEMORY_LIMIT_ROSOCP}
livenessProbe:
failureThreshold: 3
httpGet:
path: /metrics
port: 9000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /metrics
port: 9000
scheme: HTTP
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: KRUIZE_HOST
value: ${KRUIZE_HOST}
- name: KRUIZE_PORT
value: ${KRUIZE_PORT}
- name: KRUIZE_WAIT_TIME
value: ${KRUIZE_WAIT_TIME}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: SERVICE_NAME
value: "rosocp-recommendation-poller"
- name: CW_LOG_STREAM_NAME
value: "rosocp-backend"
- name: LOG_LEVEL
value: ${RECOMMENDATION_POLLER_LOG_LEVEL}
- name: api
replicas: ${{API_REPLICA_COUNT}}
webServices:
public:
enabled: true
apiPath: cost-management
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["sh"]
args: ["-c", "./rosocp db migrate up && ./rosocp start api"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSOCP}
memory: ${MEMORY_REQUEST_ROSOCP}
limits:
cpu: ${CPU_LIMIT_ROSOCP}
memory: ${MEMORY_LIMIT_ROSOCP}
livenessProbe:
failureThreshold: 3
httpGet:
path: /status
port: 8000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /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: RBAC_ENABLE
value: "${RBAC_ENABLE}"
- name: DB_POOL_SIZE
value: ${DB_POOL_SIZE}
- name: DB_MAX_OVERFLOW
value: ${DB_MAX_OVERFLOW}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: SERVICE_NAME
value: "rosocp-api"
- name: CW_LOG_STREAM_NAME
value: "rosocp-api"
- name: LOG_LEVEL
value: ${LOG_LEVEL}
- name: housekeeper
replicas: ${{HOUSEKEEPER_REPLICA_COUNT}}
podSpec:
image: ${IMAGE}:${IMAGE_TAG}
command: ["sh"]
args: ["-c", "./rosocp db migrate up && ./rosocp start housekeeper --sources"]
resources:
requests:
cpu: ${CPU_REQUEST_ROSOCP}
memory: ${MEMORY_REQUEST_ROSOCP}
limits:
cpu: ${CPU_LIMIT_ROSOCP}
memory: ${MEMORY_LIMIT_ROSOCP}
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: SERVICE_NAME
value: "rosocp-housekeeper-sources"
- name: CW_LOG_STREAM_NAME
value: "rosocp-housekeeper"
- name: LOG_LEVEL
value: ${LOG_LEVEL}
- name: KRUIZE_HOST
value: ${KRUIZE_HOST}
- name: KRUIZE_PORT
value: ${KRUIZE_PORT}
jobs:
- name: delete-rosocp-partitions
schedule: ${PARTITION_DELETE_INTERVAL}
podSpec:
name: rosocpcronjob
image: ${IMAGE}:${IMAGE_TAG}
imagePullPolicy: Always
restartPolicy: OnFailure
command: ["sh"]
args: ["-c", "./rosocp db migrate up && ./rosocp start housekeeper --partitions"]
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: SERVICE_NAME
value: "rosocp-housekeeper-partition"
- name: CW_LOG_STREAM_NAME
value: "rosocp-housekeeper"
- name: LOG_LEVEL
value: ${LOG_LEVEL}
database:
name: rosocp
version: 13
kafkaTopics:
- topicName: hccm.ros.events
partitions: 1
- topicName: rosocp.kruize.recommendations
partitions: 1
- topicName: platform.sources.event-stream
partitions: 1
testing:
iqePlugin: ros-ocp
parameters:
- description : ClowdEnvironment name
name: ENV_NAME
required: true
- description: Replica count for processor pod
name: PROCESSOR_REPLICA_COUNT
value: "1"
- description: Replica count for recommendation-poller pod
name: POLLER_REPLICA_COUNT
value: "1"
- description: Image NAME
name: IMAGE
required: true
value: quay.io/redhat-services-prod/insights-management-tenant/insights-ocp-resource-optimization/ros-ocp-backend
- description: Image tag
name: IMAGE_TAG
required: true
- description: Kruize server host
name: KRUIZE_HOST
required: true
value: "kruize-recommendations"
- description: Kruize server port
name: KRUIZE_PORT
required: true
value: "10000"
- description: Initial cpu request.
displayName: CPU Request
name: CPU_REQUEST_ROSOCP
required: true
value: 500m
- description: Initial amount of memory the container will request.
displayName: Memory Request
name: MEMORY_REQUEST_ROSOCP
required: true
value: 1Gi
- description: Maximum amount of memory the container can use.
displayName: Memory Limit
name: MEMORY_LIMIT_ROSOCP
required: true
value: 1Gi
- description: Maximum amount of CPU the build container can use.
displayName: CPU Limit
name: CPU_LIMIT_ROSOCP
required: true
value: '1'
- description: Is clowder enabled
name: CLOWDER_ENABLED
value: "True"
- name: SSL_CERT_DIR
value: '/etc/ssl/certs:/etc/pki/tls/certs:/system/etc/security/cacerts:/cdapp/certs'
- description: Replica count for api pod
name: API_REPLICA_COUNT
value: "1"
- description: Replica count for recommender pod
name: RECOMMENDER_REPLICA_COUNT
value: "1"
- description: Replica count for recommender pod
name: HOUSEKEEPER_REPLICA_COUNT
value: "1"
- description: Time to wait before hitting listRecommendation API
name: KRUIZE_WAIT_TIME
value: "120"
- description: Enable the RBAC
name: RBAC_ENABLE
value: "true"
- name: LOG_LEVEL
value: 'INFO'
- name: RECOMMENDATION_POLLER_LOG_LEVEL
value: 'INFO'
- name: PARTITION_DELETE_INTERVAL
value: "0 0 */15 * *" # Runs at 12:00 AM, every 15 days.