From de11f581ef07d478760581be45fe99b50fe6738b Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:58:23 +0300 Subject: [PATCH] NAS-123307 / 23.10 / nextcloud: allow tuning opcache memory consuption (#1420) * nextcloud: allow tuning opcache memory consuption * Update library/ix-dev/charts/nextcloud/questions.yaml --- library/ix-dev/charts/nextcloud/Chart.yaml | 2 +- library/ix-dev/charts/nextcloud/ci/test-values.yaml | 1 + library/ix-dev/charts/nextcloud/questions.yaml | 9 +++++++++ .../ix-dev/charts/nextcloud/templates/deployment.yaml | 9 +++++++++ .../charts/nextcloud/templates/nextcloud-configmap.yaml | 7 +++++++ 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 library/ix-dev/charts/nextcloud/templates/nextcloud-configmap.yaml diff --git a/library/ix-dev/charts/nextcloud/Chart.yaml b/library/ix-dev/charts/nextcloud/Chart.yaml index c3292b7ddc..b735c9d441 100644 --- a/library/ix-dev/charts/nextcloud/Chart.yaml +++ b/library/ix-dev/charts/nextcloud/Chart.yaml @@ -4,7 +4,7 @@ description: A file sharing server that puts the control and security of your ow annotations: title: Nextcloud type: application -version: 1.6.37 +version: 1.6.38 apiVersion: v2 appVersion: 27.0.1 kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/charts/nextcloud/ci/test-values.yaml b/library/ix-dev/charts/nextcloud/ci/test-values.yaml index 5f72e6884d..89921092fa 100644 --- a/library/ix-dev/charts/nextcloud/ci/test-values.yaml +++ b/library/ix-dev/charts/nextcloud/ci/test-values.yaml @@ -18,6 +18,7 @@ nextcloud: install_ffmpeg: true install_smbclient: true max_upload_size: 5 + opcache_memory_consumption: 128 password: changeme username: admin postgresAppVolumeMounts: diff --git a/library/ix-dev/charts/nextcloud/questions.yaml b/library/ix-dev/charts/nextcloud/questions.yaml index 7e34009277..7ce469b48b 100644 --- a/library/ix-dev/charts/nextcloud/questions.yaml +++ b/library/ix-dev/charts/nextcloud/questions.yaml @@ -148,6 +148,15 @@ questions: default: 3 min: 1 required: true + - variable: opcache_memory_consumption + label: "Opcache Memory Consumption (Mega Bytes)" + description: "Configures the memory consumption of the opcache" + schema: + type: int + min: 128 + max: 1024 + default: 128 + required: true - variable: cronjob description: "Setup cronjob for nextcloud" diff --git a/library/ix-dev/charts/nextcloud/templates/deployment.yaml b/library/ix-dev/charts/nextcloud/templates/deployment.yaml index 1f73b03050..522d295abe 100644 --- a/library/ix-dev/charts/nextcloud/templates/deployment.yaml +++ b/library/ix-dev/charts/nextcloud/templates/deployment.yaml @@ -178,6 +178,11 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} - name: nextcloud-data mountPath: /var/www/html/themes subPath: "themes" + - name: nextcloud-configuration + # We use -z-99 to ensure that this file is loaded + # after the default opcache file nextcloud provides. + mountPath: /usr/local/etc/php/conf.d/opcache-z-99.ini + subPath: opcache.ini {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} - name: extrappvolume-{{ $index }} mountPath: {{ $hostPathConfiguration.mountPath }} @@ -198,6 +203,10 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} {{ end }} {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} volumes: + - name: nextcloud-configuration + configMap: + defaultMode: 0755 + name: "nextcloud-configuration" - name: nginx-configuration configMap: defaultMode: 0700 diff --git a/library/ix-dev/charts/nextcloud/templates/nextcloud-configmap.yaml b/library/ix-dev/charts/nextcloud/templates/nextcloud-configmap.yaml new file mode 100644 index 0000000000..414e8986c5 --- /dev/null +++ b/library/ix-dev/charts/nextcloud/templates/nextcloud-configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "nextcloud-configuration" +data: + opcache.ini: | + opcache.memory_consumption={{ .Values.nextcloud.opcache_memory_consumption }}