diff --git a/k3s/apps/Nextcloud/manifest/collabora-deployment.yaml b/k3s/apps/Nextcloud/manifest/collabora-deployment.yaml new file mode 100644 index 0000000..d6ab262 --- /dev/null +++ b/k3s/apps/Nextcloud/manifest/collabora-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: collabora + namespace: nextcloud +spec: + replicas: 1 + selector: + matchLabels: + app: collabora + template: + metadata: + labels: + app: collabora + spec: + containers: + - name: collabora + image: collabora/code:latest + imagePullPolicy: Always + ports: + - containerPort: 9980 + env: + - name: domain + value: "henryathome.home64.de" + - name: extra_params + value: "--o:ssl.enable=false --o:ssl.termination=true" + resources: + requests: + memory: "1Gi" + cpu: "500m" + limits: + memory: "4Gi" + cpu: "2" \ No newline at end of file diff --git a/k3s/apps/Nextcloud/manifest/collabora-service.yaml b/k3s/apps/Nextcloud/manifest/collabora-service.yaml new file mode 100644 index 0000000..60c6004 --- /dev/null +++ b/k3s/apps/Nextcloud/manifest/collabora-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: collabora-nodeport + namespace: nextcloud +spec: + type: NodePort + selector: + app: collabora + ports: + - port: 9980 + targetPort: 9980 + nodePort: 30980 \ No newline at end of file diff --git a/k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml b/k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml index 8eb9c2a..2808824 100644 --- a/k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml +++ b/k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml @@ -28,10 +28,17 @@ spec: value: nextcloud ports: - containerPort: 3306 + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "512Mi" + cpu: "500m" volumeMounts: - name: mariadb-data mountPath: /var/lib/mysql volumes: - name: mariadb-data persistentVolumeClaim: - claimName: pvc-mariadb \ No newline at end of file + claimName: nextcloud-mariadb-pvc \ No newline at end of file diff --git a/k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml b/k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml index c777d52..eb78c6c 100644 --- a/k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml +++ b/k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: pvc-mariadb + name: nextcloud-mariadb-pvc namespace: nextcloud spec: accessModes: @@ -14,7 +14,7 @@ spec: apiVersion: v1 kind: PersistentVolume metadata: - name: pv-mariadb + name: nextcloud-mariadb-pv labels: app: mariadb spec: @@ -26,7 +26,7 @@ spec: storageClassName: local-path claimRef: namespace: nextcloud - name: pvc-mariadb + name: nextcloud-mariadb-pvc hostPath: - path: /var/lib/mariadb-data + path: /var/lib/nextcloud/mariadb-data type: DirectoryOrCreate diff --git a/k3s/apps/Nextcloud/manifest/nextcloud-apps-pv-pvc.yaml b/k3s/apps/Nextcloud/manifest/nextcloud-apps-pv-pvc.yaml new file mode 100644 index 0000000..d31a769 --- /dev/null +++ b/k3s/apps/Nextcloud/manifest/nextcloud-apps-pv-pvc.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nextcloud-apps-pvc + namespace: nextcloud +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeName: nextcloud-apps-pv +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nextcloud-apps-pv + labels: + app: nextcloud +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + claimRef: + namespace: nextcloud + name: nextcloud-apps-pvc + hostPath: + path: /var/lib/nextcloud/custom_apps + type: DirectoryOrCreate diff --git a/k3s/apps/Nextcloud/manifest/nextcloud-config-pv-pvc.yaml b/k3s/apps/Nextcloud/manifest/nextcloud-config-pv-pvc.yaml new file mode 100644 index 0000000..9348e3b --- /dev/null +++ b/k3s/apps/Nextcloud/manifest/nextcloud-config-pv-pvc.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nextcloud-config-pvc + namespace: nextcloud +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: local-path # match mariadb local-path style +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: pv-nextcloud-config + labels: + app: nextcloud +spec: + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: local-path + claimRef: + namespace: nextcloud + name: nextcloud-config-pvc + hostPath: + path: /var/lib/nextcloud/nextcloud-config + type: DirectoryOrCreate diff --git a/k3s/apps/Nextcloud/manifest/nextcloud-cron-job.yaml b/k3s/apps/Nextcloud/manifest/nextcloud-cron-job.yaml new file mode 100644 index 0000000..800df43 --- /dev/null +++ b/k3s/apps/Nextcloud/manifest/nextcloud-cron-job.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: nextcloud-webcron + namespace: nextcloud +spec: + schedule: "*/5 * * * *" # alle 5 Minuten + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + jobTemplate: + spec: + activeDeadlineSeconds: 300 + template: + spec: + restartPolicy: Never + containers: + - name: webcron + image: curlimages/curl:8.5.0 + command: ["/bin/sh", "-c"] + args: + - 'until curl -fsS http://nextcloud.nextcloud.svc.cluster.local/status.php; do echo "waiting for nextcloud..."; sleep 5; done; curl -s -o /dev/null -w "%{http_code}\n" http://nextcloud.nextcloud.svc.cluster.local/cron.php' \ No newline at end of file diff --git a/k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml b/k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml index 8e44ae3..62bae71 100644 --- a/k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml +++ b/k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml @@ -38,18 +38,36 @@ spec: - name: REDIS_HOST value: redis.nextcloud.svc.cluster.local - name: NEXTCLOUD_TRUSTED_DOMAINS - value: "henryathome.home64.de,192.168.178.0/24,192.168.178.138" - # resources: - # requests: - # memory: "512Mi" - # cpu: "250m" - # limits: - # memory: "1Gi" - # cpu: "1000m" + value: "henryathome.home64.de,192.168.178.0/24,192.168.178.138,nextcloud.nextcloud.svc.cluster.local" + - name: TRUSTED_PROXIES + value: "192.168.178.120" + - name: OVERWRITEHOST + value: "henryathome.home64.de" + - name: OVERWRITEPROTOCOL + value: "https" + - name: OVERWRITECLIURL + value: "https://henryathome.home64.de" + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "4Gi" + cpu: "3000m" volumeMounts: - name: data - mountPath: /var/www/html/data # angepasst auf Standard Nextcloud Datadir + mountPath: /var/www/html/data + - name: config + mountPath: /var/www/html/config + - name: apps + mountPath: /var/www/html/custom_apps volumes: - name: data persistentVolumeClaim: - claimName: nextcloud-data-pvc \ No newline at end of file + claimName: nextcloud-data-pvc + - name: config + persistentVolumeClaim: + claimName: nextcloud-config-pvc + - name: apps + persistentVolumeClaim: + claimName: nextcloud-apps-pvc \ No newline at end of file diff --git a/k3s/apps/photo/immich/immich-server-deployment.yaml b/k3s/apps/photo/immich/immich-server-deployment.yaml index 15e9656..4761b24 100644 --- a/k3s/apps/photo/immich/immich-server-deployment.yaml +++ b/k3s/apps/photo/immich/immich-server-deployment.yaml @@ -112,4 +112,4 @@ spec: claimName: immich-library-pvc - name: ext-library persistentVolumeClaim: - claimName: photoprism-storage + claimName: photoprism-library-pvc diff --git a/k3s/apps/photo/photoprism/photoprism-storrage-pvc.yaml b/k3s/apps/photo/photoprism/photoprism-storrage-pvc.yaml new file mode 100644 index 0000000..7f57b1c --- /dev/null +++ b/k3s/apps/photo/photoprism/photoprism-storrage-pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: photoprism-library-pvc + namespace: photoprism +spec: + storageClassName: nfs + volumeName: photos-nfs-pv + accessModes: + - ReadWriteMany + resources: + requests: + storage: 50Gi \ No newline at end of file diff --git a/k3s/apps/photo/photoprism/photoprism.yaml b/k3s/apps/photo/photoprism/photoprism.yaml index 90d126d..7917721 100644 --- a/k3s/apps/photo/photoprism/photoprism.yaml +++ b/k3s/apps/photo/photoprism/photoprism.yaml @@ -1,31 +1,3 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: photoprism-storage - namespace: photoprism -spec: - storageClassName: nfs - volumeName: nfs-pv - accessModes: - - ReadWriteMany - resources: - requests: - storage: 50Gi ---- -#apiVersion: v1 -#kind: PersistentVolumeClaim -#metadata: -# name: photoprism-originals -# namespace: photoprism -#spec: -# storageClassName: nfs -# volumeName: nfs-pv -# accessModes: -# - ReadWriteMany -# resources: -# requests: -# storage: 100Gi ---- apiVersion: apps/v1 kind: Deployment metadata: @@ -101,7 +73,7 @@ spec: # memory: "512Mi" volumeMounts: - mountPath: /photoprism/ - name: photoprism-storage + name: photoprism-library-pvc # - mountPath: /photoprism/storage # name: photoprism-storage # - mountPath: /photoprism/originals @@ -111,9 +83,9 @@ spec: # runAsUser: 1000 # runAsGroup: 1000 volumes: - - name: photoprism-storage + - name: photoprism-library-pvc persistentVolumeClaim: - claimName: photoprism-storage + claimName: photoprism-library-pvc # - name: photoprism-originals # persistentVolumeClaim: # claimName: photoprism-originals diff --git a/k3s/apps/photo/photos-pv.yaml b/k3s/apps/photo/photos-pv.yaml new file mode 100644 index 0000000..4ebb2c4 --- /dev/null +++ b/k3s/apps/photo/photos-pv.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: photos-nfs-pv +spec: + capacity: + storage: 200Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + server: 192.168.178.186 + path: /volume1/Photos + mountOptions: + - hard + - nfsvers=4 \ No newline at end of file