diff --git a/helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml index c6d9271d..35c851a6 100755 --- a/helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_100M_STORAGE_SIZE }} + storage: {{ .Values.APACHE_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml index e2379616..68709d1f 100755 --- a/helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_1G_STORAGE_SIZE }} + storage: {{ .Values.CLAMAV_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-collabora-fonts-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-collabora-fonts-persistentvolumeclaim.yaml index e06d64d1..ea0b9c00 100755 --- a/helm-chart/templates/nextcloud-aio-collabora-fonts-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-collabora-fonts-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_100M_STORAGE_SIZE }} + storage: {{ .Values.COLLABORA_FONTS_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml index 2c87ac91..78ff6742 100755 --- a/helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DATABASE_STORAGE_SIZE }} + storage: {{ .Values.DATABASE_DUMP_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml index 04bee927..8ec6bbb4 100755 --- a/helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.FULLTEXTSEARCH_STORAGE_SIZE }} + storage: {{ .Values.ELASTICSEARCH_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml index d6b26e25..d07e3b61 100755 --- a/helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_1G_STORAGE_SIZE }} + storage: {{ .Values.NEXTCLOUD_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml index ed827317..58384bde 100755 --- a/helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_100M_STORAGE_SIZE }} + storage: {{ .Values.NEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml index a6fab5f5..674ad7b6 100755 --- a/helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_1G_STORAGE_SIZE }} + storage: {{ .Values.ONLYOFFICE_STORAGE_SIZE }} diff --git a/helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml b/helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml index 06c64253..10f3e7da 100755 --- a/helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml +++ b/helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml @@ -12,4 +12,4 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.DEFAULT_1G_STORAGE_SIZE }} + storage: {{ .Values.REDIS_STORAGE_SIZE }} diff --git a/helm-chart/update-helm.sh b/helm-chart/update-helm.sh index 84ce9cb5..91216e48 100755 --- a/helm-chart/update-helm.sh +++ b/helm-chart/update-helm.sh @@ -47,18 +47,6 @@ find ./ -name '*deployment.yaml' -exec sed -i "s|manual-install-nextcloud-aio|ne # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "/^ spec:/a\ \ \ \ \ \ securityContext:\n\ \ \ \ \ \ \ \ fsGroup: 65534\n\ \ \ \ \ \ \ \ fsGroupChangePolicy: \"OnRootMismatch\"" \{} \; # shellcheck disable=SC1083 -find ./ \( -not -name '*apache*' -not -name '*collabora-fonts*' -not -name '*trusted-cacerts*' -name '*persistentvolumeclaim.yaml' \) -exec sed -i "s|storage: 100Mi|storage: 1Gi|" \{} \; -# shellcheck disable=SC1083 -find ./ -name '*nextcloud-data-persistentvolumeclaim.yaml' -exec sed -i "s|storage: 1Gi|storage: {{ .Values.NEXTCLOUD_DATA_STORAGE_SIZE }}|" \{} \; -# shellcheck disable=SC1083 -find ./ -name '*database*persistentvolumeclaim.yaml' -exec sed -i "s|storage: 1Gi|storage: {{ .Values.DATABASE_STORAGE_SIZE }}|" \{} \; -# shellcheck disable=SC1083 -find ./ -name '*elasticsearch-persistentvolumeclaim.yaml' -exec sed -i "s|storage: 1Gi|storage: {{ .Values.FULLTEXTSEARCH_STORAGE_SIZE }}|" \{} \; -# shellcheck disable=SC1083 -find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|storage: 100Mi|storage: {{ .Values.DEFAULT_100M_STORAGE_SIZE }}|" \{} \; -# shellcheck disable=SC1083 -find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|storage: 1Gi|storage: {{ .Values.DEFAULT_1G_STORAGE_SIZE }}|" \{} \; -# shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|ReadOnlyMany|ReadWriteOnce|" \{} \; # shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "/accessModes:/i\ \ {{- if .Values.STORAGE_CLASS }}" \{} \; @@ -86,6 +74,14 @@ find ./ \( -not -name '*service.yaml' -name '*.yaml' \) -exec sed -i "/^status:/ find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i "/creationTimestamp: null/d" \{} \; +VOLUMES="$(find ./ -name '*persistentvolumeclaim.yaml' | sed 's|-persistentvolumeclaim.yaml||g;s|.*nextcloud-aio-||g')" +mapfile -t VOLUMES <<< "$VOLUMES" +for variable in "${VOLUMES[@]}"; do + name="$(echo "$variable" | sed 's|-|_|g' | tr '[:lower:]' '[:upper:]')_STORAGE_SIZE" + VOLUME_VARIABLE+=("$name") + # shellcheck disable=SC1083 + find ./ -name "*nextcloud-aio-$variable-persistentvolumeclaim.yaml" -exec sed -i "s|storage: 100Mi|storage: {{ .Values.$name }}|" \{} \; +done cd ../ mkdir -p ../helm-chart/ @@ -110,16 +106,9 @@ sed -i '/^NEXTCLOUD_MOUNT/d' /tmp/sample.conf sed -i 's|^NEXTCLOUD_TRUSTED_CACERTS_DIR: .*|NEXTCLOUD_TRUSTED_CACERTS_DIR: # Setting this to any value allows to automatically import root certificates into the Nextcloud container|' /tmp/sample.conf # shellcheck disable=SC2129 echo 'STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes' >> /tmp/sample.conf -# shellcheck disable=SC2129 -echo 'NEXTCLOUD_DATA_STORAGE_SIZE: 10Gi # You can change the size of Nextclouds Datadir with this value' >> /tmp/sample.conf -# shellcheck disable=SC2129 -echo 'DATABASE_STORAGE_SIZE: 1Gi # You can change the size of the database volume with this value' >> /tmp/sample.conf -# shellcheck disable=SC2129 -echo 'FULLTEXTSEARCH_STORAGE_SIZE: 1Gi # You can change the size of the fulltextsearch volume with this value' >> /tmp/sample.conf -# shellcheck disable=SC2129 -echo 'DEFAULT_100M_STORAGE_SIZE: 100Mi # You can change the size of the remaining volumes that default to 100Mi with this value' >> /tmp/sample.conf -# shellcheck disable=SC2129 -echo 'DEFAULT_1G_STORAGE_SIZE: 1Gi # You can change the size of the remaining volumes that default to 1Gi with this value' >> /tmp/sample.conf +for variable in "${VOLUME_VARIABLE[@]}"; do + echo "$variable: 1Gi # You can change the size of the $(echo "$variable" | sed 's|_STORAGE_SIZE||;s|_|-|g' | tr '[:upper:]' '[:lower:]') volume that default to 1Gi with this value" >> /tmp/sample.conf +done mv /tmp/sample.conf ../helm-chart/values.yaml ENABLED_VARIABLES="$(grep -oP '^[A-Z]+_ENABLED' ../helm-chart/values.yaml)" diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 53c4204d..d0232f5e 100755 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -31,8 +31,14 @@ TIMEZONE: Europe/Berlin # TODO! This is the timezone that your containe TURN_SECRET: # TODO! This needs to be a unique and good password! UPDATE_NEXTCLOUD_APPS: no # When setting to yes, it will automatically update all installed Nextcloud apps upon container startup on saturdays. STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes -NEXTCLOUD_DATA_STORAGE_SIZE: 10Gi # You can change the size of Nextclouds Datadir with this value -DATABASE_STORAGE_SIZE: 1Gi # You can change the size of the database volume with this value -FULLTEXTSEARCH_STORAGE_SIZE: 1Gi # You can change the size of the fulltextsearch volume with this value -DEFAULT_100M_STORAGE_SIZE: 100Mi # You can change the size of the remaining volumes that default to 100Mi with this value -DEFAULT_1G_STORAGE_SIZE: 1Gi # You can change the size of the remaining volumes that default to 1Gi with this value +ELASTICSEARCH_STORAGE_SIZE: 1Gi # You can change the size of the elasticsearch volume that default to 1Gi with this value +NEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE: 1Gi # You can change the size of the nextcloud-trusted-cacerts volume that default to 1Gi with this value +COLLABORA_FONTS_STORAGE_SIZE: 1Gi # You can change the size of the collabora-fonts volume that default to 1Gi with this value +ONLYOFFICE_STORAGE_SIZE: 1Gi # You can change the size of the onlyoffice volume that default to 1Gi with this value +CLAMAV_STORAGE_SIZE: 1Gi # You can change the size of the clamav volume that default to 1Gi with this value +DATABASE_DUMP_STORAGE_SIZE: 1Gi # You can change the size of the database-dump volume that default to 1Gi with this value +NEXTCLOUD_DATA_STORAGE_SIZE: 1Gi # You can change the size of the nextcloud-data volume that default to 1Gi with this value +NEXTCLOUD_STORAGE_SIZE: 1Gi # You can change the size of the nextcloud volume that default to 1Gi with this value +REDIS_STORAGE_SIZE: 1Gi # You can change the size of the redis volume that default to 1Gi with this value +DATABASE_STORAGE_SIZE: 1Gi # You can change the size of the database volume that default to 1Gi with this value +APACHE_STORAGE_SIZE: 1Gi # You can change the size of the apache volume that default to 1Gi with this value