-
Notifications
You must be signed in to change notification settings - Fork 24
/
kruize-clowdapp.yaml
284 lines (281 loc) · 8.83 KB
/
kruize-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
---
apiVersion: v1
kind: Template
metadata:
name: kruize
objects:
- apiVersion: cloud.redhat.com/v1alpha1
kind: ClowdApp
metadata:
name: kruize
spec:
envName: ${ENV_NAME}
deployments:
- name: recommendations
replicas: ${{KRUIZE_REPLICA_COUNT}}
webServices:
private:
enabled: true
podSpec:
image: ${KRUIZE_IMAGE}:${KRUIZE_IMAGE_TAG}
command: ["sh"]
args: ["-c", "export DB_CONFIG_FILE=${ACG_CONFIG} && export KRUIZE_CONFIG_FILE=${ACG_CONFIG} && bash target/bin/Autotune"]
resources:
requests:
cpu: ${CPU_REQUEST_KRUIZE}
memory: ${MEMORY_REQUEST_KRUIZE}
limits:
cpu: ${CPU_LIMIT_KRUIZE}
memory: ${MEMORY_LIMIT_KRUIZE}
livenessProbe:
httpGet:
path: /health
port: 10000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 300
timeoutSeconds: 300
readinessProbe:
httpGet:
path: /health
port: 10000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 300
timeoutSeconds: 5
env:
- name: JAVA_TOOL_OPTIONS
value: "-XX:MaxRAMPercentage=80"
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: AUTOTUNE_SERVER_PORT
value: ${KRUIZE_PORT}
- name: AUTH_TOKEN
value: ""
- name: LOGGING_LEVEL
value: ${KRUIZE_LOGGING_LEVEL}
- name: ROOT_LOGGING_LEVEL
value: "error"
- name: dbdriver
value: "jdbc:postgresql://"
- name: clustertype
value: "kubernetes"
- name: k8stype
value: "openshift"
- name: authtype
value: "openshift"
- name: monitoringagent
value: "prometheus"
- name: monitoringservice
value: "prometheus-k8s"
- name: monitoringendpoint
value: "prometheus-k8s"
- name: savetodb
value: "true"
- name: local
value: "false"
- name: LOG_ALL_HTTP_REQ_AND_RESPONSE
value: "true"
- name: hibernate_dialect
value: "org.hibernate.dialect.PostgreSQLDialect"
- name: hibernate_driver
value: "org.postgresql.Driver"
- name: hibernate_c3p0minsize
value: "5"
- name: hibernate_c3p0maxsize
value: "10"
- name: hibernate_c3p0timeout
value: "300"
- name: hibernate_c3p0maxstatements
value: "100"
- name: hibernate_hbm2ddlauto
value: "none"
- name: hibernate_showsql
value: "false"
- name: hibernate_timezone
value: "UTC"
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: logging_cloudwatch_logStream
value: ${KRUIZE_CW_LOG_STREAM}
- name: logging_cloudwatch_logLevel
value: ${KRUIZE_CW_LOGGING_LEVEL}
- name: plots
value: ${PLOTS_DATA}
jobs:
- name: delete-kruize-partitions
schedule: ${KRUIZE_PARTITION_INTERVAL}
podSpec:
name: kruizecrondeletejob
image: ${KRUIZE_IMAGE}:${KRUIZE_IMAGE_TAG}
imagePullPolicy: Always
restartPolicy: OnFailure
command: [ "sh" ]
args: [ "-c", "export DB_CONFIG_FILE=${ACG_CONFIG} && /home/autotune/app/target/bin/RetentionPartition" ]
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: START_AUTOTUNE
value: "false"
- name: LOGGING_LEVEL
value: "info"
- name: ROOT_LOGGING_LEVEL
value: "error"
- name: dbdriver
value: "jdbc:postgresql://"
- name: clustertype
value: "kubernetes"
- name: k8stype
value: "openshift"
- name: authtype
value: "openshift"
- name: monitoringagent
value: "prometheus"
- name: monitoringservice
value: "prometheus-k8s"
- name: monitoringendpoint
value: "prometheus-k8s"
- name: savetodb
value: "true"
- name: hibernate_dialect
value: "org.hibernate.dialect.PostgreSQLDialect"
- name: hibernate_driver
value: "org.postgresql.Driver"
- name: hibernate_c3p0minsize
value: "5"
- name: hibernate_c3p0maxsize
value: "10"
- name: hibernate_c3p0timeout
value: "300"
- name: hibernate_c3p0maxstatements
value: "100"
- name: hibernate_hbm2ddlauto
value: "none"
- name: hibernate_showsql
value: "false"
- name: hibernate_timezone
value: "UTC"
- name: deletepartitionsthreshold
value: "16"
- name: local
value: "false"
- name: create-kruize-partitions
schedule: "0 0 25 * *" # Run on 25th of every month at midnight
podSpec:
image: ${KRUIZE_IMAGE}:${KRUIZE_IMAGE_TAG}
command: ["sh"]
args: ["-c", "export DB_CONFIG_FILE=${ACG_CONFIG} && /home/autotune/app/target/bin/CreatePartition"]
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
- name: SSL_CERT_DIR
value: ${SSL_CERT_DIR}
- name: START_AUTOTUNE
value: "false"
- name: LOGGING_LEVEL
value: "info"
- name: ROOT_LOGGING_LEVEL
value: "error"
- name: dbdriver
value: "jdbc:postgresql://"
- name: clustertype
value: "kubernetes"
- name: k8stype
value: "openshift"
- name: authtype
value: "openshift"
- name: monitoringagent
value: "prometheus"
- name: monitoringservice
value: "prometheus-k8s"
- name: monitoringendpoint
value: "prometheus-k8s"
- name: savetodb
value: "true"
- name: hibernate_dialect
value: "org.hibernate.dialect.PostgreSQLDialect"
- name: hibernate_driver
value: "org.postgresql.Driver"
- name: hibernate_c3p0minsize
value: "5"
- name: hibernate_c3p0maxsize
value: "10"
- name: hibernate_c3p0timeout
value: "300"
- name: hibernate_c3p0maxstatements
value: "100"
- name: hibernate_hbm2ddlauto
value: "none"
- name: hibernate_showsql
value: "false"
- name: hibernate_timezone
value: "UTC"
- name: local
value: "false"
database:
name: postgres
version: 13
- apiVersion: cloud.redhat.com/v1alpha1
kind: ClowdJobInvocation
metadata:
name: create-kruize-partitions
spec:
appName: kruize
jobs:
- create-kruize-partitions
parameters:
- description : ClowdEnvironment name
name: ENV_NAME
required: true
- description: Is clowder enabled
name: CLOWDER_ENABLED
value: "True"
- description: Kruize image name
name: KRUIZE_IMAGE
required: true
value: quay.io/cloudservices/autotune
- description: Kruize image tag
name: KRUIZE_IMAGE_TAG
required: true
value: "96be0e5"
- description: Kruize server port
name: KRUIZE_PORT
required: true
value: "10000"
- description: Initial kruize cpu request.
displayName: KRUIZE CPU Request
name: CPU_REQUEST_KRUIZE
required: true
value: 500m
- description: Initial amount of memory kruize container will request.
displayName: KRUIZE Memory Request
name: MEMORY_REQUEST_KRUIZE
required: true
value: 1Gi
- description: Maximum amount of CPU kruize container can use.
displayName: KRUIZE CPU Limit
name: CPU_LIMIT_KRUIZE
required: true
value: '1'
- description: Maximum amount of memory kruize container can use.
displayName: KRUIZE Memory Limit
name: MEMORY_LIMIT_KRUIZE
required: true
value: 1Gi
- description: Replica count for kruize pod
name: KRUIZE_REPLICA_COUNT
value: "1"
- name: SSL_CERT_DIR
value: '/etc/ssl/certs:/etc/pki/tls/certs:/system/etc/security/cacerts:/cdapp/certs'
- name: KRUIZE_LOGGING_LEVEL
value: "info"
- name: KRUIZE_PARTITION_INTERVAL
value: "0 0 * * *" # Run the cronjob every day at midnight. Earlier it was set for 16th day
- name: KRUIZE_CW_LOG_STREAM
value: "kruize-recommendations"
- name: KRUIZE_CW_LOGGING_LEVEL
value: "INFO"
- name: PLOTS_DATA
value: "false"