nextcloud: persist web root in pvc

This commit is contained in:
Brad Stein 2026-01-07 09:40:25 -03:00
parent a711c450d3
commit 9bb90053a1
5 changed files with 55 additions and 0 deletions

View File

@ -66,6 +66,8 @@ spec:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
@ -85,6 +87,9 @@ spec:
- name: nextcloud-user-data
persistentVolumeClaim:
claimName: nextcloud-user-data
- name: nextcloud-web
persistentVolumeClaim:
claimName: nextcloud-web
- name: sync-script
configMap:
name: nextcloud-mail-sync-script

View File

@ -24,6 +24,8 @@ spec:
args:
- "cd /var/www/html && php -f cron.php"
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
@ -40,3 +42,6 @@ spec:
- name: nextcloud-user-data
persistentVolumeClaim:
claimName: nextcloud-user-data
- name: nextcloud-web
persistentVolumeClaim:
claimName: nextcloud-web

View File

@ -23,6 +23,26 @@ spec:
runAsUser: 33
runAsGroup: 33
initContainers:
- name: seed-nextcloud-web
image: nextcloud:29-apache
command: ["/bin/sh", "-c"]
args:
- |
if [ ! -f /var/www/html/version.php ]; then
echo "Seeding Nextcloud webroot..."
tar -C /usr/src/nextcloud -cf - \
--exclude=./config \
--exclude=./data \
--exclude=./custom_apps \
. | tar -C /var/www/html -xf -
chown -R 33:33 /var/www/html || true
fi
securityContext:
runAsUser: 0
runAsGroup: 0
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: fix-perms
image: alpine:3.20
command: ["/bin/sh", "-c"]
@ -166,6 +186,8 @@ spec:
name: nextcloud-oidc
key: client-secret
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
@ -257,6 +279,8 @@ spec:
- containerPort: 80
name: http
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
@ -274,6 +298,9 @@ spec:
cpu: 1
memory: 3Gi
volumes:
- name: nextcloud-web
persistentVolumeClaim:
claimName: nextcloud-web
- name: nextcloud-config-pvc
persistentVolumeClaim:
claimName: nextcloud-config

View File

@ -34,6 +34,8 @@ spec:
name: nextcloud-admin
key: admin-password
volumeMounts:
- name: nextcloud-web
mountPath: /var/www/html
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
@ -60,6 +62,9 @@ spec:
- name: nextcloud-user-data
persistentVolumeClaim:
claimName: nextcloud-user-data
- name: nextcloud-web
persistentVolumeClaim:
claimName: nextcloud-web
- name: maintenance-script
configMap:
name: nextcloud-maintenance-script

View File

@ -27,6 +27,19 @@ spec:
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nextcloud-web
namespace: nextcloud
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
storageClassName: astreae
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nextcloud-user-data
namespace: nextcloud