Selaa lähdekoodia

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
Stavros Kois 2 vuotta sitten
vanhempi
commit
de11f581ef

+ 1 - 1
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'

+ 1 - 0
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:

+ 9 - 0
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"

+ 9 - 0
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

+ 7 - 0
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 }}