scripts/fogcutter/k8s/nextcloud.yml

169 lines
3.4 KiB
YAML

# to scan new files: su -l www-data -s /bin/bash -c "/var/www/html/occ files:scan --path='/USER/files'"
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: nextcloud
name: nextcloud
namespace: pew
spec:
replicas: 1
selector:
matchLabels:
run: nextcloud
template:
metadata:
labels:
run: nextcloud
spec:
containers:
- name: nextcloud
image: nextcloud:20.0.1-apache
env:
- name: OVERWRITEHOST
value: "nc.seaturtle.pw"
- name: OVERWRITEPROTOCOL
value: "https"
- name: MYSQL_DATABASE
value: "nextcloud"
- name: MYSQL_USER
value: "nextcloud"
- name: MYSQL_PASSWORD
value: "nextcloud"
- name: MYSQL_HOST
value: "nextcloud-mariadb.pew"
- name: REDIS_HOST
value: "nextcloud-redis.pew"
- name: REDIS_HOST_PASSWORD
value: "nextcloud"
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-data
readOnly: false
ports:
- name: http
containerPort: 80
volumes:
- name: nextcloud-data
hostPath:
path: /opt/NEXTCLOUD-K8S/data
---
apiVersion: v1
kind: Service
metadata:
labels:
run: nextcloud
name: nextcloud
namespace: pew
spec:
selector:
run: nextcloud
ports:
- name: http
port: 80
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: nextcloud-mariadb
name: nextcloud-mariadb
namespace: pew
spec:
replicas: 1
selector:
matchLabels:
run: nextcloud-mariadb
template:
metadata:
labels:
run: nextcloud-mariadb
spec:
containers:
- name: mariadb
image: mariadb:10.5.6
env:
- name: MYSQL_RANDOM_ROOT_PASSWORD
value: "notnullvalue"
- name: MYSQL_PASSWORD
value: "nextcloud"
- name: MYSQL_DATABASE
value: "nextcloud"
- name: MYSQL_USER
value: "nextcloud"
volumeMounts:
- mountPath: /var/lib/mysql
name: nextcloud-mariadb
readOnly: false
ports:
- name: mysql
containerPort: 3306
volumes:
- name: nextcloud-mariadb
hostPath:
path: /opt/NEXTCLOUD-K8S/mariadb
---
apiVersion: v1
kind: Service
metadata:
labels:
run: nextcloud-mariadb
name: nextcloud-mariadb
namespace: pew
spec:
selector:
run: nextcloud-mariadb
ports:
- name: mysql
port: 3306
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: nextcloud-redis
name: nextcloud-redis
namespace: pew
spec:
replicas: 1
selector:
matchLabels:
run: nextcloud-redis
template:
metadata:
labels:
run: nextcloud-redis
spec:
containers:
- name: redis
image: redis:6.0.9
args:
- --requirepass nextcloud
ports:
- name: redis
containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
labels:
run: nextcloud-redis
name: nextcloud-redis
namespace: pew
spec:
selector:
run: nextcloud-redis
ports:
- name: redis
port: 6379
protocol: TCP