apiVersion: apps/v1 kind: Deployment metadata: name: nextcloud spec: replicas: 1 selector: matchLabels: name: nextcloud template: metadata: labels: name: nextcloud nginx: backend redis: client spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: kubernetes.io/arch operator: In values: - amd64 containers: - name: nextcloud image: qdii/nextcloud:28.0.2-apache env: - name: MYSQL_DATABASE value: "nextcloud" - name: MYSQL_USER value: "nextcloud" - name: MYSQL_HOST value: "mariadb.mariadb" - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: nextcloud key: mariadb-password - name: NEXTCLOUD_ADMIN_USER value: "qdii" - name: NEXTCLOUD_ADMIN_PASSWORD valueFrom: secretKeyRef: name: nextcloud key: admin-password - name: NEXTCLOUD_TRUSTED_DOMAINS value: "dodges.it" - name: APACHE_DISABLE_REWRITES value: "1" - name: TRUSTED_PROXIES value: "10.244.0.1/16" - name: OVERWRITEHOST value: "ng.dodges.it" - name: OVERWRITEPROTOCOL value: "https" - name: REDIS_HOST value: "redis-master" - name: REDIS_HOST_PORT value: "6379" - name: PHP_UPLOAD_LIMIT value: "4096M" - name: PHP_MEMORY_LIMIT value: "2048M" - name: REDIS_HOST_PASSWORD valueFrom: secretKeyRef: name: redis key: root-password volumeMounts: - name: nextcloud mountPath: /var/www/html ports: - containerPort: 80 name: http livenessProbe: initialDelaySeconds: 7200 timeoutSeconds: 10 httpGet: path: /index.php port: 80 httpHeaders: - name: Host value: "ng.dodges.it" resources: requests: memory: "500Mi" cpu: "30m" volumes: - name: nextcloud persistentVolumeClaim: claimName: nextcloud --- apiVersion: batch/v1 kind: CronJob metadata: name: nextcloud-backup spec: schedule: "@weekly" jobTemplate: spec: template: spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: arch operator: In values: - x86 containers: - name: nextcloud-backup image: qdii/backup-rsync:latest env: - name: LOCAL_FOLDER_PATH value: /mnt/data/qdii/files - name: REMOTE_USER value: "uab10c1ba4bc" - name: REMOTE_SERVER value: "bck.dodges.it" - name: REMOTE_FOLDER_PATH value: "/home/uab10c1ba4bc/data/vol0/nextcloud" volumeMounts: - name: backup mountPath: "/root/.ssh/id_rsa" subPath: ssh_private_key readOnly: true - name: backup mountPath: "/root/.ssh/id_rsa.pub" subPath: ssh_public_key readOnly: true - name: nextcloud mountPath: /mnt restartPolicy: Never volumes: - name: backup secret: secretName: backup defaultMode: 0400 - name: nextcloud persistentVolumeClaim: claimName: nextcloud --- apiVersion: batch/v1 kind: CronJob metadata: name: nextcloud-backup-jb spec: schedule: "@weekly" jobTemplate: spec: template: spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: arch operator: In values: - x86 containers: - name: nextcloud-backup-jb image: qdii/backup-rsync:latest env: - name: LOCAL_FOLDER_PATH value: /mnt/data/jb/files - name: REMOTE_USER value: "uab10c1ba4bc" - name: REMOTE_SERVER value: "bck.dodges.it" - name: REMOTE_FOLDER_PATH value: "/home/uab10c1ba4bc/data/vol0/jb" volumeMounts: - name: backup mountPath: "/root/.ssh/id_rsa" subPath: ssh_private_key readOnly: true - name: backup mountPath: "/root/.ssh/id_rsa.pub" subPath: ssh_public_key readOnly: true - name: nextcloud mountPath: /mnt restartPolicy: Never volumes: - name: backup secret: secretName: backup defaultMode: 0400 - name: nextcloud persistentVolumeClaim: claimName: nextcloud