This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
forked from tobru/nextcloud-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextcloud.yaml
343 lines (343 loc) · 8.82 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
340
341
342
343
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: "jngrb"
template.openshift.io/documentation-url: "https://github.com/jngrb/nextcloud-openshift/blob/master/README.md"
template.openshift.io/support-url: "https://github.com/jngrb/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_IMAGESTREAM_NAME
description: Name of the image stream for the nextcloud deployment
value: nextcloud
- name: NEXTCLOUD_IMAGE_TAG
description: Tag of the Nextcloud Docker Image to deploy
value: 18.0.4-fpm
- name: NGINX_DOCKERFILE_REPO
description: Nginx Dockerfile source repository
value: https://github.com/jngrb/nextcloud-openshift.git
- name: GIT_BRANCH
description: branch in source repository
value: master
- name: MYSQL_HOST
description: Host of the mysql/mariadb service
value: mariadb.nextcloud.svc
- name: REDIS_HOST
description: Host of the redis service
value: redis.nextcloud.svc
- name: PVC_SIZE
description: PVC size for Apps, Config and Data
value: 20Gi
- name: REPLICAS
description: Number of Nextcloud replicas
value: '1'
- name: FPM_PARAMETERS
description: Configuration of the FPM server
value: |-
;[www]
;pm = dynamic
;pm.max_children = 120
;pm.start_servers = 12
;pm.min_spare_servers = 6
;pm.max_spare_servers = 18
- name: ALLOWED_CORS_ORIGINS
description: "|-separated list of allowed CORS origins"
value: "^https?://(localhost:3000|localhost:8080|feather\\.apps\\.typeerror\\.eu)"
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nextcloud-data
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: ${PVC_SIZE}
storageClassName: glusterfs-storage
- 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:
dockerbuild: 'true'
output:
to:
kind: ImageStreamTag
name: nginx:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
uri: ${NGINX_DOCKERFILE_REPO}
ref: ${GIT_BRANCH}
type: Git
contextDir: nginx
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: ${{REPLICAS}}
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:
nodeSelector:
appclass: main
containers:
- env:
- name: MYSQL_USER
valueFrom:
secretKeyRef:
key: database-user
name: mariadb
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: mariadb
- name: MYSQL_DATABASE
value: nextcloud
- name: MYSQL_HOST
value: ${MYSQL_HOST}
- name: REDIS_HOST
value: ${REDIS_HOST}
- name: REDIS_HOST_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: redis
image: nextcloud
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
tcpSocket:
port: 9000
timeoutSeconds: 5
name: nextcloud
ports:
- containerPort: 9000
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
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
- mountPath: /usr/local/etc/php-fpm.d/www.overloaded.conf
name: fpm-confd
subPath: www.overloaded.conf
readOnly: true
- env:
- name: ALLOWED_CORS_ORIGINS
value: ${ALLOWED_CORS_ORIGINS}
image: nginx
imagePullPolicy: Always
livenessProbe:
exec:
command:
- curl
- '-f'
- 'localhost:8080/status.php'
failureThreshold: 3
initialDelaySeconds: 20
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
name: nginx
ports:
- containerPort: 8080
protocol: TCP
readinessProbe:
exec:
command:
- curl
- '-f'
- 'localhost:8080/status.php'
failureThreshold: 3
initialDelaySeconds: 20
periodSeconds: 15
successThreshold: 1
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
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: nextcloud-source
- name: nextcloud-data
persistentVolumeClaim:
claimName: nextcloud-data
- name: fpm-confd
configMap:
name: fpm-confd
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- nextcloud
from:
kind: ImageStreamTag
name: ${NEXTCLOUD_IMAGESTREAM_NAME}:${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: 80
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
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: nextcloud
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: ConfigMap
data:
www.overloaded.conf: |-
${FPM_PARAMETERS}
metadata:
name: fpm-confd