move nc to distributed pods

This commit is contained in:
Steffen Illium 2024-05-22 00:12:26 +02:00
parent c510c00bae
commit 205a37741e
6 changed files with 122 additions and 24 deletions

View File

@ -46,16 +46,13 @@ spec:
- name: MYSQL_USER
value: nextcloud
- name: REDIS_HOST
value: 127.0.0.1
value: redis
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: nextcloud-secret
key: MYSQL_PASSWORD
resources:
limits:
cpu: "0.3"
memory: "1G"
resources: {}
ports:
- name: mariadb
containerPort: 3306
@ -64,23 +61,13 @@ spec:
- 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
value: maridb:3306
- name: MYSQL_USER
value: nextcloud
- name: PHP_MEMORY_LIMIT
@ -88,7 +75,7 @@ spec:
- name: PHP_UPLOAD_LIMIT
value: 100G
- name: REDIS_HOST
value: 127.0.0.1
value: redis
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
@ -98,10 +85,7 @@ spec:
- name: nextcloud
containerPort: 80
protocol: TCP
resources:
limits:
cpu: "0.5"
memory: "2G"
resources: {}
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-pvc
@ -118,6 +102,4 @@ spec:
server: 192.168.178.4
path: /mnt/storage/service/nextcloud/data
readOnly: false

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: mariadb
spec:
ports:
- name: mariadb
port: 3306
targetPort: mariadb
selector:
app: mariadb

View File

@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mariadb
name: mariadb
spec:
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app: mariadb
strategy:
type: Recreate
template:
metadata:
labels:
app: mariadb
spec:
containers:
- 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
restartPolicy: Always
volumes:
- name: nextcloud-pvc
persistentVolumeClaim:
claimName: nextcloud-pvc

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
ports:
- name: redis
port: 6379
targetPort: redis
selector:
app: redis

View File

@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: redis
name: redis
spec:
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app: redis
strategy:
type: Recreate
template:
metadata:
labels:
app: redis
spec:
containers:
- image: redis:alpine
name: redis
resources:
limits: {}
ports:
- name: redis
containerPort: 6379
protocol: TCP
restartPolicy: Always