forked from tobru/nextcloud-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextcloud.yaml
339 lines (339 loc) · 8.78 KB
/
nextcloud.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
apiVersion: v1
kind: Template
metadata:
name: nextcloud
annotations:
description: "Nextcloud - A safe home for all your data"
tags: "fileshare,nextcloud"
iconClass: fa-cloud-upload
template.openshift.io/provider-display-name: "tobrunet"
template.openshift.io/documentation-url: "https://github.com/tobru/nextcloud-openshift/blob/master/README.md"
template.openshift.io/support-url: "https://github.com/tobru/nextcloud-openshift/issues"
parameters:
- name: NEXTCLOUD_HOST
description: Application URL of Nextcloud (Route/host)
required: true
- name: NEXTCLOUD_IMAGE
description: Image to deploy
value: docker.io/nextcloud
- name: NEXTCLOUD_IMAGE_TAG
description: Tag of the Nextcloud Docker Image to deploy
value: 12-fpm
- name: NGINX_DOCKERFILE_REPO
description: Nginx Dockerfile source repository
value: https://github.com/tobru/nextcloud-openshift.git
- name: PVC_SIZE
description: PVC size for Apps, Config and Data
value: 5Gi
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nextcloud-data
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: ${PVC_SIZE}
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: nextcloud
name: nextcloud
spec:
tags:
- annotations:
openshift.io/imported-from: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
from:
kind: DockerImage
name: ${NEXTCLOUD_IMAGE}:${NEXTCLOUD_IMAGE_TAG}
importPolicy:
scheduled: true
name: ${NEXTCLOUD_IMAGE_TAG}
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
labels:
build: nginx
app: nextcloud
name: nginx
spec:
tags:
- annotations: null
from:
kind: DockerImage
name: nginx:latest
generation: null
importPolicy: {}
name: latest
referencePolicy:
type: ""
- apiVersion: v1
kind: BuildConfig
metadata:
creationTimestamp: null
labels:
build: nginx
app: nextcloud
name: nginx
spec:
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: nginx:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
uri: ${NGINX_DOCKERFILE_REPO}
type: Git
strategy:
dockerStrategy:
from:
kind: DockerImage
name: nginx:alpine
type: Docker
triggers:
- type: ConfigChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: nextcloud
name: nextcloud
spec:
replicas: 1
selector:
app: nextcloud
deploymentconfig: nextcloud
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: nextcloud
deploymentconfig: nextcloud
spec:
containers:
- env:
- name: NC_dbhost
value: mariadb
- name: NC_dbuser
valueFrom:
secretKeyRef:
key: database-user
name: mariadb
- name: NC_dbpassword
valueFrom:
secretKeyRef:
key: database-password
name: mariadb
- name: NC_dbname
value: nextcloud
image: nextcloud
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 9000
timeoutSeconds: 5
name: nextcloud
ports:
- containerPort: 9000
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 9000
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-source
- mountPath: /var/www/html/data
name: nextcloud-data
subPath: data
- mountPath: /var/www/html/config
name: nextcloud-data
subPath: config
- mountPath: /var/www/html/custom_apps
name: nextcloud-data
subPath: apps
- image: nginx
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 8080
timeoutSeconds: 1
name: nginx
ports:
- containerPort: 8080
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 8080
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-source
- mountPath: /var/www/html/data
name: nextcloud-data
subPath: data
- mountPath: /var/www/html/config
name: nextcloud-data
subPath: config
- mountPath: /var/www/html/custom_apps
name: nextcloud-data
subPath: apps
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: nextcloud-source
- name: nextcloud-data
persistentVolumeClaim:
claimName: nextcloud-data
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- nextcloud
from:
kind: ImageStreamTag
name: nextcloud:${NEXTCLOUD_IMAGE_TAG}
type: ImageChange
- imageChangeParams:
automatic: true
containerNames:
- nginx
from:
kind: ImageStreamTag
name: nginx:latest
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
labels:
app: nextcloud
name: nextcloud
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: nextcloud
deploymentconfig: nextcloud
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
name: nextcloud
spec:
host: ${NEXTCLOUD_HOST}
port:
targetPort: 8080-tcp
to:
kind: Service
name: nextcloud
weight: 100
wildcardPolicy: None
- apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: nextcloud-cron
spec:
concurrencyPolicy: Replace
jobTemplate:
spec:
activeDeadlineSeconds: 3600
template:
spec:
containers:
- args:
- php
- -f
- /var/www/html/cron.php
env:
- name: NEXTCLOUD_UPDATE
value: "1"
- name: NC_dbhost
value: mariadb
- name: NC_dbuser
valueFrom:
secretKeyRef:
key: database-user
name: mariadb
- name: NC_dbpassword
valueFrom:
secretKeyRef:
key: database-password
name: mariadb
- name: NC_dbname
value: nextcloud
image: nextcloud:${NEXTCLOUD_IMAGE_TAG}
imagePullPolicy: Always
name: nextcloud-cron
resources: {}
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-source
- mountPath: /var/www/html/data
name: nextcloud-data
subPath: data
- mountPath: /var/www/html/config
name: nextcloud-data
subPath: config
- mountPath: /var/www/html/custom_apps
name: nextcloud-data
subPath: apps
dnsPolicy: ClusterFirst
restartPolicy: Never
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: nextcloud-source
- name: nextcloud-data
persistentVolumeClaim:
claimName: nextcloud-data
schedule: '*/15 * * * *'
suspend: false