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
|
#
# Copyright 2016-2017 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: Template
metadata:
name: hawkular-services
annotations:
openshift.io/display-name: Hawkular Services
description: Hawkular-Services all-in-one (including Hawkular Metrics, Hawkular Alerts and Hawkular Inventory).
iconClass: icon-wildfly
tags: hawkular,hawkular-services,metrics,alerts,manageiq,cassandra
parameters:
- name: HAWKULAR_SERVICES_IMAGE
description: What docker image should be used for hawkular-services.
displayName: Hawkular Services Docker Image
value: registry.access.redhat.com/jboss-mm-7-tech-preview/middleware-manager:latest
- name: CASSANDRA_IMAGE
description: What docker image should be used for cassandra node.
displayName: Cassandra Docker Image
value: registry.access.redhat.com/openshift3/metrics-cassandra:3.5.0
- name: CASSANDRA_MEMORY_LIMIT
description: Maximum amount of memory for Cassandra container.
displayName: Cassandra Memory Limit
value: 2Gi
- name: CASSANDRA_DATA_LIMIT
description: Maximum amount data used by Cassandra container.
displayName: Cassandra Container Data Limit
value: 2Gi
- name: HAWKULAR_SERVICES_DATA_LIMIT
description: Maximum amount data used by hawkular-services container (mostly logging).
displayName: Hawkular Services Container Data Limit
value: 1Gi
- name: ROUTE_NAME
description: Public route with this name will be created.
displayName: Route Name
value: hawkular-services
- name: ROUTE_HOSTNAME
description: Under this hostname the Hawkular Services will be accessible, if left blank a value will be defaulted.
displayName: Hostname
- name: HAWKULAR_USER
description: Username that is used for accessing the Hawkular Services, if left blank a value will be generated.
displayName: Hawkular User
from: '[a-zA-Z0-9]{16}'
generate: expression
- name: HAWKULAR_PASSWORD
description: Password that is used for accessing the Hawkular Services, if left blank a value will be generated.
displayName: Hawkular Password
from: '[a-zA-Z0-9]{16}'
generate: expression
labels:
template: hawkular-services
message: Credentials for hawkular-services are ${HAWKULAR_USER}:${HAWKULAR_PASSWORD}
objects:
- apiVersion: v1
kind: Service
metadata:
annotations:
description: Exposes and load balances the application pods
service.alpha.openshift.io/dependencies: '[{"name":"hawkular-cassandra","namespace":"","kind":"Service"}]'
name: hawkular-services
spec:
ports:
- name: http-8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: admin-9990-tcp
port: 9990
protocol: TCP
targetPort: 9990
selector:
name: hawkular-services
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
annotations:
description: Cassandra Service
name: hawkular-cassandra
spec:
ports:
- name: cql-9042-tcp
port: 9042
protocol: TCP
targetPort: 9042
selector:
name: hawkular-cassandra
- apiVersion: v1
kind: Route
metadata:
name: ${ROUTE_NAME}
spec:
host: ${ROUTE_HOSTNAME}
to:
kind: Service
name: hawkular-services
port:
targetPort: http-8080-tcp
- apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
description: Defines how to deploy the application server
name: hawkular-services
spec:
replicas: 1
selector:
name: hawkular-services
strategy:
type: Rolling
template:
metadata:
labels:
name: hawkular-services
spec:
containers:
- image: ${HAWKULAR_SERVICES_IMAGE}
env:
- name: HAWKULAR_BACKEND
value: remote
- name: CASSANDRA_NODES
value: hawkular-cassandra
- name: HAWKULAR_USER
value: ${HAWKULAR_USER}
- name: HAWKULAR_PASSWORD
value: ${HAWKULAR_PASSWORD}
imagePullPolicy: IfNotPresent
name: hawkular-services
volumeMounts:
- name: h-services-data
mountPath: /var/opt/hawkular
ports:
- containerPort: 8080
- containerPort: 9990
livenessProbe:
exec:
command:
- /opt/hawkular/bin/ready.sh
initialDelaySeconds: 180
timeoutSeconds: 3
readinessProbe:
exec:
command:
- /opt/hawkular/bin/ready.sh
initialDelaySeconds: 120
timeoutSeconds: 3
periodSeconds: 5
successThreshold: 1
failureThreshold: 12
resources:
requests:
memory: 1024Mi
cpu: 2000m
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- name: h-services-data
persistentVolumeClaim:
claimName: h-services-pvc
- apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
description: Defines how to deploy the cassandra
name: hawkular-cassandra
spec:
replicas: 1
selector:
name: hawkular-cassandra
strategy:
type: Recreate
rollingParams:
timeoutSeconds: 300
template:
metadata:
labels:
name: hawkular-cassandra
spec:
containers:
- image: ${CASSANDRA_IMAGE}
imagePullPolicy: IfNotPresent
name: hawkular-cassandra
env:
- name: DATA_VOLUME
value: /var/lib/cassandra
volumeMounts:
- name: cassandra-data
mountPath: /var/lib/cassandra
ports:
- containerPort: 9042
- containerPort: 9160
readinessProbe:
exec:
command: ['nodetool', 'status']
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 15
successThreshold: 1
failureThreshold: 3
livenessProbe:
exec:
command: ['nodetool', 'status']
initialDelaySeconds: 300
timeoutSeconds: 10
periodSeconds: 15
successThreshold: 1
failureThreshold: 3
resources:
limits:
memory: ${CASSANDRA_MEMORY_LIMIT}
volumes:
- name: cassandra-data
persistentVolumeClaim:
claimName: cassandra-pvc
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: h-services-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cassandra-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
|