Explorar el Código

Allow specifying host path volumes for chia app

Waqar Ahmed hace 4 años
padre
commit
624e33baa4
Se han modificado 2 ficheros con 36 adiciones y 2 borrados
  1. 25 0
      charts/chia/1.1.0/questions.yaml
  2. 11 2
      charts/chia/1.1.0/templates/deployment.yaml

+ 25 - 0
charts/chia/1.1.0/questions.yaml

@@ -79,3 +79,28 @@ questions:
                       schema:
                         type: hostpath
                         required: true
+
+  - variable: extraAppVolumeMounts
+    label: "Chia Extra Host Path Volumes"
+    group: "Storage"
+    schema:
+      type: list
+      items:
+        - variable: extraAppVolume
+          label: "Chia Host Path Volume"
+          description: "Add an extra host path volume for chia 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

+ 11 - 2
charts/chia/1.1.0/templates/deployment.yaml

@@ -18,11 +18,20 @@ spec:
       containers:
         - name: {{ .Chart.Name }}
           {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
-          {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
+          volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
+          {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
+            - name: extrappvolume-{{ $index }}
+              mountPath: {{ $hostPathConfiguration.mountPath }}
+          {{ end }}
           ports:
             - name: chia-network
               protocol: TCP
               containerPort: 8444
               hostPort: 8444
 {{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }}
-{{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
+      volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
+      {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
+        - name: extrappvolume-{{ $index }}
+          hostPath:
+            path: {{ $hostPathConfiguration.hostPath }}
+      {{ end }}