Fix and improve helm update script

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-01-28 16:23:46 +01:00
parent 3102dbfaeb
commit 405162e103
27 changed files with 70 additions and 69 deletions

View file

@ -1,6 +1,6 @@
name: Nextcloud AIO Helm Chart
description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose
version: 4.0.1
version: 4.2.0
apiVersion: v1
keywords:
- latest

View file

@ -3,7 +3,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-apache
name: nextcloud-aio-apache
@ -16,7 +16,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-apache
@ -41,10 +41,11 @@ spec:
value: nextcloud-aio-talk
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-apache:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-apache:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-apache
ports:
- containerPort: {{ .Values.APACHE_PORT }}
hostIP: {{ .Values.APACHE_IP_BINDING }}
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-aio-nextcloud

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -3,7 +3,7 @@ kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-apache
name: nextcloud-aio-apache
@ -14,5 +14,3 @@ spec:
targetPort: {{ .Values.APACHE_PORT }}
selector:
io.kompose.service: nextcloud-aio-apache
status:
loadBalancer: {}

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-clamav
name: nextcloud-aio-clamav
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-clamav
@ -28,7 +28,7 @@ spec:
value: "90"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-clamav:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-clamav:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-clamav
volumeMounts:
- mountPath: /var/lib/clamav

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-collabora
name: nextcloud-aio-collabora
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-collabora
@ -32,7 +32,7 @@ spec:
value: "{{ .Values.COLLABORA_DICTIONARIES }}"
- name: extra_params
value: --o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true {{ .Values.COLLABORA_SECCOMP_POLICY }} --o:remote_font_config.url=https://{{ .Values.NC_DOMAIN }}/apps/richdocuments/settings/fonts.json
image: nextcloud/aio-collabora:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-collabora:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-collabora
volumeMounts:
- mountPath: /opt/cool/systemplate/tmpfonts

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -3,7 +3,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-database
name: nextcloud-aio-database
@ -16,7 +16,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-database
@ -33,7 +33,7 @@ spec:
value: nextcloud
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-postgresql:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-postgresql:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-database
volumeMounts:
- mountPath: /var/lib/postgresql/data

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-fulltextsearch
name: nextcloud-aio-fulltextsearch
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-fulltextsearch
@ -30,7 +30,7 @@ spec:
value: "{{ .Values.TIMEZONE }}"
- name: discovery.type
value: single-node
image: nextcloud/aio-fulltextsearch:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-fulltextsearch:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-fulltextsearch
volumeMounts:
- mountPath: /usr/share/elasticsearch/data

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-imaginary
name: nextcloud-aio-imaginary
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-imaginary
@ -26,6 +26,6 @@ spec:
- env:
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-imaginary:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-imaginary:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-imaginary
{{- end }}

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -3,7 +3,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-nextcloud
name: nextcloud-aio-nextcloud
@ -16,7 +16,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-nextcloud
@ -101,14 +101,14 @@ spec:
value: "{{ .Values.TIMEZONE }}"
- name: UPDATE_NEXTCLOUD_APPS
value: "{{ .Values.UPDATE_NEXTCLOUD_APPS }}"
image: nextcloud/aio-nextcloud:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-nextcloud:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-nextcloud
volumeMounts:
- mountPath: /var/www/html
name: nextcloud-aio-nextcloud
- mountPath: /mnt/ncdata
name: nextcloud-aio-nextcloud-data
- mountPath: /mnt/
- mountPath: /mnt
name: nextcloud-aio-nextcloud-mount
- mountPath: /usr/local/share/ca-certificates
name: nextcloud-aio-nextcloud-trusted-cacerts

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-onlyoffice
name: nextcloud-aio-onlyoffice
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-onlyoffice
@ -32,7 +32,7 @@ spec:
value: "{{ .Values.ONLYOFFICE_SECRET }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-onlyoffice:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-onlyoffice:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-onlyoffice
volumeMounts:
- mountPath: /var/lib/onlyoffice

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -3,7 +3,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-redis
name: nextcloud-aio-redis
@ -16,7 +16,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-redis
@ -27,7 +27,7 @@ spec:
value: "{{ .Values.REDIS_PASSWORD }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-redis:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-redis:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-redis
volumeMounts:
- mountPath: /data

View file

@ -9,7 +9,7 @@ spec:
storageClassName: {{ .Values.STORAGE_CLASS }}
{{- end }}
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.MAX_STORAGE_SIZE }}
storage: 1Gi

View file

@ -4,7 +4,7 @@ kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-talk
name: nextcloud-aio-talk
@ -17,7 +17,7 @@ spec:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.network/nextcloud-aio: "true"
io.kompose.service: nextcloud-aio-talk
@ -36,7 +36,7 @@ spec:
value: "{{ .Values.TURN_SECRET }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-talk:20221229_091124-{{ .Values.IMAGE_TAG }}
image: nextcloud/aio-talk:20230124_100035-{{ .Values.IMAGE_TAG }}
name: nextcloud-aio-talk
ports:
- containerPort: {{ .Values.TALK_PORT }}

View file

@ -4,7 +4,7 @@ kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml
kompose.version: 1.27.0 (b0ed6a2c9)
kompose.version: 1.28.0 (c4137012e)
labels:
io.kompose.service: nextcloud-aio-talk
name: nextcloud-aio-talk
@ -19,6 +19,4 @@ spec:
targetPort: {{ .Values.TALK_PORT }}
selector:
io.kompose.service: nextcloud-aio-talk
status:
loadBalancer: {}
{{- end }}

View file

@ -29,20 +29,26 @@ sed -i "s|\${TALK_PORT}:\${TALK_PORT}/|$TALK_PORT:$TALK_PORT/|g" latest.yml
sed -i "s|\${NEXTCLOUD_DATADIR}|$NEXTCLOUD_DATADIR|" latest.yml
sed -i "/NEXTCLOUD_DATADIR/d" latest.yml
sed -i "s|\${NEXTCLOUD_MOUNT}:\${NEXTCLOUD_MOUNT}:|nextcloud_aio_nextcloud_mount:$NEXTCLOUD_MOUNT:|" latest.yml
sed -i "/^volumes:/a\ \ nextcloud_aio_nextcloud_mount:\n \ \ \ \ name: nextcloud_aio_nextcloud_mount" latest.yml
sed -i "/^volumes:/a\ \ nextcloud_aio_nextcloud_trusted_cacerts:\n \ \ \ \ name: nextcloud_aio_nextcloud_trusted_cacerts" latest.yml
sed -i "s|\${NEXTCLOUD_TRUSTED_CACERTS_DIR}:|nextcloud_aio_nextcloud_trusted_cacerts:|g#" latest.yml
sed -i 's|\${|{{ .Values.|g' latest.yml
sed -i 's|}| }}|g' latest.yml
sed -i '/profiles: /d' latest.yml
cat latest.yml
kompose convert -c -f latest.yml
cd latest
mv ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ./templates/nextcloud-aio-networkpolicy.yaml
# shellcheck disable=SC1083
find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|storage: 100Mi|storage: {{ .Values.MAX_STORAGE_SIZE }}|" \{} \;
find ./ -name '*networkpolicy.yaml' -exec sed -i "s|manual-install-nextcloud-aio|nextcloud-aio|" \{} \;
# shellcheck disable=SC1083
find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|ReadOnlyMany|ReadWriteMany|" \{} \;
find ./ -name '*service.yaml' -exec sed -i "/^status:/,$ d" \{} \;
# shellcheck disable=SC1083
find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|ReadWriteOnce|ReadWriteMany|" \{} \;
find ./ -name '*deployment.yaml' -exec sed -i "s|manual-install-nextcloud-aio|nextcloud-aio|" \{} \;
# shellcheck disable=SC1083
find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|storage: 100Mi|storage: 1Gi|" \{} \;
# 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 }}" \{} \;
# shellcheck disable=SC1083
@ -85,14 +91,12 @@ sed -i "s|^version:.*|version: $AIO_VERSION|" ../helm-chart/Chart.yaml
# Conversion of sample.conf
cp sample.conf /tmp/
sed -i "/^APACHE_IP_BINDING/d" /tmp/sample.conf
sed -i 's|"||g' /tmp/sample.conf
sed -i 's|=|: |' /tmp/sample.conf
sed -i 's|= |: |' /tmp/sample.conf
sed -i '/^NEXTCLOUD_DATADIR/d' /tmp/sample.conf
sed -i 's|^NEXTCLOUD_MOUNT: .*|NEXTCLOUD_MOUNT: # Setting this to any value allows to enable external storages in Nextcloud|' /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
echo 'MAX_STORAGE_SIZE: 10Gi # You can adjust the max storage that each volume can use with this value' >> /tmp/sample.conf
echo 'STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes' >> /tmp/sample.conf
mv /tmp/sample.conf ../helm-chart/values.yaml

View file

@ -1,6 +1,7 @@
IMAGE_TAG: latest # Version of docker images, should be latest or latest-arm64. Note: latest-arm64 has no clamav support
AIO_TOKEN: 123456 # Has no function but needs to be set!
AIO_URL: localhost # Has no function but needs to be set!
APACHE_IP_BINDING: 0.0.0.0 # This can be changed to e.g. 127.0.0.1 if you want to run AIO behind a reverse proxy and if that is running on the same host and using localhost to connect
APACHE_MAX_SIZE: 10737418240 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT
APACHE_PORT: 443 # Changing this to a different value than 443 will allow you to run it behind a reverse proxy.
CLAMAV_ENABLED: no # Setting this to yes enables the option in Nextcloud automatically. Note: latest-arm64 has no clamav support
@ -30,5 +31,4 @@ TALK_PORT: 3478 # This allows to adjust the port that the talk containe
TIMEZONE: Europe/Berlin # TODO! This is the timezone that your containers will use.
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.
MAX_STORAGE_SIZE: 10Gi # You can adjust the max storage that each volume can use with this value
STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes