apiVersion: apps/v1 kind: Deployment metadata: name: nextcloud labels: app: nextcloud spec: selector: matchLabels: app: nextcloud template: metadata: labels: app: nextcloud spec: containers: - name: nextcloud image: nextcloud:19.0.2 env: - name: TRUSTED_PROXIES value: 10.0.0.0/8 - name: MYSQL_HOST valueFrom: secretKeyRef: name: mariadb-credentials-secret key: host - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: mariadb-credentials-secret key: database - name: MYSQL_USER valueFrom: secretKeyRef: name: mariadb-credentials-secret key: username - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: mariadb-credentials-secret key: password ports: - name: http containerPort: 80 volumeMounts: - name: nextcloud-data mountPath: /var/www/html volumes: - name: nextcloud-data persistentVolumeClaim: claimName: nextcloud-data --- apiVersion: v1 kind: PersistentVolume metadata: name: nextcloud-data-nfs labels: app: nextcloud spec: accessModes: - ReadWriteMany capacity: storage: 100Mi nfs: server: nfs-localhost path: /nextcloud mountOptions: ["vers=4"] --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nextcloud-data labels: app: nextcloud spec: storageClassName: "" accessModes: - ReadWriteMany resources: requests: storage: 100Mi selector: matchLabels: app: nextcloud --- apiVersion: v1 kind: Service metadata: name: nextcloud labels: app: nextcloud spec: selector: app: nextcloud ports: - name: http protocol: TCP port: 80 targetPort: http