kubedeploy-k3s/apps/nextcloud/base/deployment.yaml
2024-05-14 20:56:34 +02:00

122 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nextcloud
name: nextcloud
spec:
replicas: 1
selector:
matchLabels:
app: nextcloud
strategy:
type: Recreate
template:
metadata:
labels:
app: nextcloud
spec:
containers:
- name: cron
image: nextcloud:latest
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-pvc
subPath: 99f37b73-8f14-44b2-9211-af5de21de749/html
- mountPath: /var/www/html/data
name: nextcloud-data
command: [ "/cron.sh" ]
resources: {}
- image: mariadb
name: mariadb
args:
- --transaction-isolation=READ-COMMITTED
- --binlog-format=ROW
- --innodb-file-per-table=1
- --skip-innodb-read-only-compressed
env:
- name: MARIADB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: nextcloud-secret
key: MARIADB_ROOT_PASSWORD
- name: MYSQL_DATABASE
value: nextcloud
- name: MYSQL_USER
value: nextcloud
- name: REDIS_HOST
value: 127.0.0.1
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: nextcloud-secret
key: MYSQL_PASSWORD
resources:
limits:
cpu: "0.3"
memory: "1G"
ports:
- name: mariadb
containerPort: 3306
protocol: TCP
volumeMounts:
- mountPath: /var/lib/mysql
name: nextcloud-pvc
subPath: 99f37b73-8f14-44b2-9211-af5de21de749/db-storage
- image: redis:alpine
name: redis
resources:
limits:
cpu: "0.1"
memory: "250M"
ports:
- name: redis
containerPort: 6379
protocol: TCP
- image: nextcloud
name: nextcloud
env:
- name: MYSQL_DATABASE
value: nextcloud
- name: MYSQL_HOST
value: 127.0.0.1:3306
- name: MYSQL_USER
value: nextcloud
- name: PHP_MEMORY_LIMIT
value: 2G
- name: PHP_UPLOAD_LIMIT
value: 100G
- name: REDIS_HOST
value: 127.0.0.1
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: nextcloud-secret
key: MYSQL_PASSWORD
ports:
- name: nextcloud
containerPort: 80
protocol: TCP
resources:
limits:
cpu: "0.5"
memory: "2G"
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-pvc
subPath: 99f37b73-8f14-44b2-9211-af5de21de749/html
- mountPath: /var/www/html/data
name: nextcloud-data
restartPolicy: Always
volumes:
- name: nextcloud-pvc
persistentVolumeClaim:
claimName: nextcloud-pvc
- name: nextcloud-data
nfs:
server: 192.168.178.4
path: /mnt/storage/service/nextcloud/data
readOnly: false