浏览代码

Allow specifying extra volumes for nextcloud

Waqar Ahmed 4 年之前
父节点
当前提交
abeede7359
共有 2 个文件被更改,包括 34 次插入0 次删除
  1. 25 0
      test/nextcloud/1.2.2/questions.yaml
  2. 9 0
      test/nextcloud/1.2.2/templates/deployment.yaml

+ 25 - 0
test/nextcloud/1.2.2/questions.yaml

@@ -134,6 +134,31 @@ questions:
                         type: hostpath
                         required: true
 
+  - variable: extraAppVolumeMounts
+    label: "Nextcloud Extra Host Path Volumes"
+    group: "Storage"
+    schema:
+      type: list
+      items:
+        - variable: extraAppVolume
+          label: "Nextcloud Host Path Volume"
+          description: "Add an extra host path volume for nextcloud application"
+          schema:
+            type: dict
+            attrs:
+              - variable: mountPath
+                label: "Mount Path in Pod"
+                description: "Path where the volume will be mounted inside the pod"
+                schema:
+                  type: path
+                  required: true
+              - variable: hostPath
+                label: "Host Path"
+                description: "Host path"
+                schema:
+                  type: hostpath
+                  required: true
+
   - variable: postgresAppVolumeMounts
     label: "Postgres Storage"
     group: "Storage"

+ 9 - 0
test/nextcloud/1.2.2/templates/deployment.yaml

@@ -48,7 +48,16 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
         - name: nextcloud-data
           mountPath: /var/www/html/themes
           subPath: "themes"
+        {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
+        - name: extrappvolume-{{ $index }}
+          mountPath: {{ $hostPathConfiguration.mountPath }}
+        {{ end }}
 {{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
+      {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
+        - name: extrappvolume-{{ $index }}
+          hostPath:
+            path: {{ $hostPathConfiguration.hostPath }}
+      {{ end }}
       # Will mount configuration files as www-data (id: 33) for nextcloud
       securityContext:
         fsGroup: 33