forked from rayray221/seafile-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seafilePro.yaml
346 lines (345 loc) · 6.74 KB
/
seafilePro.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
344
345
346
## Created a secret in order to pull image from seafile
## kubectl create secret docker-registry seafilecred --docker-server=docker.seadrive.org --docker-username=<seafile repo username> --docker-password=<seafile repo password> -n=seafile-app
apiVersion: v1
kind: Secret
metadata:
name: seafile-db-cred
namespace: seafile-app
type: Opaque
data:
password: #<db root password base64>
---
apiVersion: v1
kind: Secret
metadata:
name: seafile-srv-cred
namespace: seafile-app
type: Opaque
data:
username: #<seafile admin logon base64>
password: #<seafile admin password base64>
---
apiVersion: v1
kind: Namespace
metadata:
name: seafile-app
labels:
apps: seafile
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: seafile-db-pv
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- hard
- nfsvers=4.2
nfs:
path: #<path to nfs share>
server: #<nfs searver>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: seafile-db-pvc
namespace: seafile-app
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: seafile-db
name: seafile-db
namespace: seafile-app
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: seafile-db
spec:
containers:
- env:
- name: MYSQL_LOG_CONSOLE
value: "true"
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: seafile-db-cred
key: password
image: mariadb:10.1
name: seafile-mysql
volumeMounts:
- mountPath: /var/lib/mysql
name: seafile-db-nfs
restartPolicy: Always
volumes:
- name: seafile-db-nfs
persistentVolumeClaim:
claimName: seafile-db-pvc
securityContext:
fsGroup: #<nfs permissions group>
---
apiVersion: v1
kind: Service
metadata:
labels:
app: seafile-db
name: db
namespace: seafile-app
spec:
ports:
- name: "3306"
port: 3306
targetPort: 3306
selector:
app: seafile-db
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: seafile-mc
name: seafile-mc
namespace: seafile-app
spec:
replicas: 1
template:
metadata:
labels:
app: seafile-mc
spec:
containers:
- command:
- memcached
- -m
- "256"
image: memcached:1.5.6
name: seafile-memcached
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: seafile-mc
name: memcached
namespace: seafile-app
spec:
ports:
- name: "11211"
port: 11211
targetPort: 11211
selector:
app: seafile-mc
type: ClusterIP
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: seafile-elk-pv
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- hard
- nfsvers=4.2
nfs:
path: #<path to nfs share>
server: #<nfs searver>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: seafile-elk-pvc
namespace: seafile-app
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: seafile-elk
name: seafile-elk
namespace: seafile-app
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: seafile-elk
spec:
containers:
- env:
- name: ES_JAVA_OPTS
value: -Xms1g -Xmx1g
- name: discovery.type
value: single-node
image: seafileltd/elasticsearch-with-ik:5.6.16
name: seafile-elasticsearch
resources:
limits:
memory: "2147483648"
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: seafile-elk-nfs
restartPolicy: Always
volumes:
- name: seafile-elk-nfs
persistentVolumeClaim:
claimName: seafile-elk-pvc
securityContext:
fsGroup: #<nfs permission group>
imagePullSecrets:
- name: seafilecred
---
apiVersion: v1
kind: Service
metadata:
labels:
app: seafile-elk
name: elasticsearch
namespace: seafile-app
spec:
ports:
- name: "9200"
port: 9200
targetPort: 9200
- name: "9300"
port: 9300
targetPort: 9300
selector:
app: seafile-elk
type: ClusterIP
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: seafile-srv-pv
spec:
capacity:
storage: 190Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
mountOptions:
- hard
- nfsvers=4.2
nfs:
path: #<path to nfs share>
server: #<nfs searver>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: seafile-srv-pvc
namespace: seafile-app
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 190Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: seafile-srv
name: seafile-srv
namespace: seafile-app
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: seafile-srv
spec:
containers:
- env:
- name: DB_HOST
value: db
- name: DB_ROOT_PASSWD
valueFrom:
secretKeyRef:
name: seafile-db-cred
key: password
- name: SEAFILE_ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: seafile-srv-cred
key: username
- name: SEAFILE_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: seafile-srv-cred
key: password
- name: SEAFILE_SERVER_HOSTNAME
value: #<Seafile Server Hostname>
- name: SEAFILE_SERVER_LETSENCRYPT
value: "true"
image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
name: seafile
ports:
- containerPort: 80
- containerPort: 443
volumeMounts:
- mountPath: /shared
name: seafile-srv-nfs
restartPolicy: Always
volumes:
- name: seafile-srv-nfs
persistentVolumeClaim:
claimName: seafile-srv-pvc
securityContext:
fsGroup: #<nfs permissions group>
imagePullSecrets:
- name: seafilecred
---
apiVersion: v1
kind: Service
metadata:
labels:
app: seafile-srv
name: seafile
namespace: seafile-app
spec:
ports:
- name: "80"
port: 80
targetPort: 80
- name: "443"
port: 443
targetPort: 443
selector:
app: seafile-srv
type: LoadBalancer