-
Notifications
You must be signed in to change notification settings - Fork 9
/
openshift-template.yaml
277 lines (268 loc) · 6.35 KB
/
openshift-template.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
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: mosquitto
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: mosquitto
name: mosquitto
spec:
output:
to:
kind: ImageStreamTag
name: mosquitto:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
uri: ${SOURCE_REPOSITORY_URL}
type: Git
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: eclipse-mosquitto:1.4.12
type: Docker
triggers:
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
- type: ConfigChange
- imageChange: {}
type: ImageChange
status:
lastVersion: 0
- apiVersion: v1
kind: ImageStream
metadata:
generation: 2
labels:
app: mosquitto
name: eclipse-mosquitto
spec:
tags:
- annotations:
openshift.io/imported-from: eclipse-mosquitto:1.4.12
from:
kind: DockerImage
name: eclipse-mosquitto:1.4.12
generation: 2
importPolicy: {}
name: 1.4.12
- apiVersion: v1
kind: ImageStream
metadata:
generation: 1
labels:
app: mosquitto
name: mosquitto
spec:
tags:
- annotations: null
from:
kind: DockerImage
name: mosquitto:latest
generation: null
importPolicy: {}
name: latest
- apiVersion: v1
kind: DeploymentConfig
metadata:
generation: 16
labels:
app: mosquitto
name: mosquitto
spec:
replicas: 1
selector:
app: mosquitto
deploymentconfig: mosquitto
strategy:
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: mosquitto
deploymentconfig: mosquitto
spec:
containers:
- image: mosquitto
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 1883
timeoutSeconds: 2
name: mosquitto
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 1883
timeoutSeconds: 2
resources: {}
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /mosquitto/config
name: config-volume
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
name: mosquitto
name: config-volume
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- mosquitto
from:
kind: ImageStreamTag
name: mosquitto:latest
type: ImageChange
status:
availableReplicas: 1
observedGeneration: 16
replicas: 1
updatedReplicas: 1
- apiVersion: v1
kind: Route
metadata:
labels:
app: mosquitto
name: mosquitto-websocket
spec:
host: ${MQTT_WEBSOCKET_URL}
port:
targetPort: mqttwebsocket
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: mosquitto
weight: 100
- apiVersion: v1
kind: Service
metadata:
labels:
app: mosquitto
name: mosquitto
spec:
ports:
- name: mqtt
port: 1883
protocol: TCP
targetPort: 1883
- name: mqtts
port: 8883
protocol: TCP
targetPort: 8883
- name: mqttwebsocket
port: 9002
protocol: TCP
targetPort: 9002
selector:
app: mosquitto
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}
- apiVersion: v1
kind: ConfigMap
metadata:
name: mosquitto
data:
mosquitto.conf: |
# Config file for mosquitto
user mosquitto
retry_interval 20
sys_interval 10
max_inflight_messages 40
max_queued_messages 200
queue_qos0_messages false
message_size_limit 0
allow_zero_length_clientid true
persistent_client_expiration 3m
allow_duplicate_messages false
autosave_interval 60
autosave_on_changes false
# Persistence configuration
persistence true
persistence_location /mosquitto/data/
# Logging
connection_messages true
log_dest stderr
log_dest stdout
log_dest file /mosquitto/log/mosquitto.log
log_type error
log_type warning
log_type notice
log_type information
log_type all
log_type debug
log_timestamp true
# Listeners
listener 1883
#listener 8883
#cafile /mosquitto/config/ca.crt
#certfile /mosquitto/config/mosquitto.crt
#keyfile /mosquitto/config/mosquitto.key
#require_certificate false
listener 9002
protocol websockets
# Security
#password_file /mosquitto/config/mosquitto.passwd
#acl_file /mosquitto/config/mosquitto.acl
mosquitto.acl: |
# This affects access control for clients with no username.
topic read $SYS/#
#user jane
#topic owntracks/jjolie/phone
# This affects all clients.
pattern write $SYS/broker/connection/%c/state
mosquitto.passwd: |
myuser:HTPASSWDPASSWORD
mosquitto.crt: |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
mosquitto.key: |
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
ca.crt: |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
parameters:
- name: SOURCE_REPOSITORY_URL
displayName: Source Repository URL
description: The URL of the repository with your application source code
value: https://github.com/tobru/mosquitto-openshift.git
required: true
- name: GITHUB_WEBHOOK_SECRET
description: A secret string used to configure the GitHub webhook
generate: expression
from: "[a-zA-Z0-9]{40}"
- name: MQTT_WEBSOCKET_URL
displayName: URL for MQTT Websocket route
required: true
message: "The GitHub webhook secret is ${GITHUB_WEBHOOK_SECRET}"