Преглед изворни кода

plex: allow changing logs dir storage type (#2346)

* plex: allow changing logs dir storage type

* fix dataset name
Stavros Kois пре 1 година
родитељ
комит
955366e9b9

+ 1 - 1
library/ix-dev/charts/plex/Chart.yaml

@@ -4,7 +4,7 @@ description: Plex is a media server that allows you to stream your media to any
 annotations:
   title: Plex
 type: application
-version: 2.0.3
+version: 2.0.4
 apiVersion: v2
 appVersion: 1.40.1.8227
 kubeVersion: '>=1.16.0-0'

+ 5 - 0
library/ix-dev/charts/plex/ci/basic-values.yaml

@@ -10,6 +10,11 @@ plexStorage:
     type: pvc
   config:
     type: pvc
+  logs:
+    type: emptyDir
+    emptyDirConfig:
+      medium: ""
+      size: ""
   transcode:
     type: emptyDir
     emptyDirConfig:

+ 9 - 4
library/ix-dev/charts/plex/ci/extra-values.yaml

@@ -6,13 +6,18 @@ plexStorage:
     type: pvc
   config:
     type: pvc
+  logs:
+    type: emptyDir
+    emptyDirConfig:
+      medium: ""
+      size: ""
   transcode:
     type: emptyDir
     emptyDirConfig:
       medium: ""
       size: ""
   additionalStorages:
-  - type: pvc
-    mountPath: /action_movies
-  - type: pvc
-    mountPath: /adventure_movies
+    - type: pvc
+      mountPath: /action_movies
+    - type: pvc
+      mountPath: /adventure_movies

+ 5 - 0
library/ix-dev/charts/plex/ci/hostNet-values.yaml

@@ -7,6 +7,11 @@ plexStorage:
     type: pvc
   config:
     type: pvc
+  logs:
+    type: emptyDir
+    emptyDirConfig:
+      medium: ""
+      size: ""
   transcode:
     type: emptyDir
     emptyDirConfig:

+ 109 - 0
library/ix-dev/charts/plex/questions.yaml

@@ -327,6 +327,115 @@ questions:
                         type: hostpath
                         show_if: [["aclEnable", "=", false]]
                         required: true
+        - variable: logs
+          label: Plex Logs Storage
+          description: The path to store Plex Logs.
+          schema:
+            type: dict
+            attrs:
+              - variable: type
+                label: Type
+                description: |
+                  ixVolume: Is dataset created automatically by the system.</br>
+                  Host Path: Is a path that already exists on the system.<br/>
+                  emptyDir: Is a temporary directory that will be created on the disk or in memory.
+                schema:
+                  type: string
+                  required: true
+                  immutable: true
+                  default: "emptyDir"
+                  enum:
+                    - value: "hostPath"
+                      description: Host Path (Path that already exists on the system)
+                    - value: "ixVolume"
+                      description: ixVolume (Dataset created automatically by the system)
+                    - value: "emptyDir"
+                      description: emptyDir (Temporary directory that will be created on the disk or in memory)
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
+                schema:
+                  type: dict
+                  show_if: [["type", "=", "ixVolume"]]
+                  $ref:
+                    - "normalize/ixVolume"
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "logs"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: emptyDirConfig
+                label: emptyDir Configuration
+                schema:
+                  type: dict
+                  show_if: [["type", "=", "emptyDir"]]
+                  attrs:
+                    - variable: medium
+                      label: emptyDir Medium
+                      description: |
+                        Disk: Creates a temporary directory on the disk.</br>
+                        Memory: Creates a temporary directory in memory.
+                      schema:
+                        type: string
+                        default: ""
+                        enum:
+                          - value: ""
+                            description: Disk (Temporary directory created on the disk)
+                          - value: "Memory"
+                            description: Memory (Temporary directory created in memory)
+                    - variable: size
+                      label: emptyDir Size Limit (in Gi)
+                      description: |
+                        The maximum size (in Gi) of the temporary directory.</br>
+                        For example: 2
+                      schema:
+                        type: int
+                        "null": true
+                        default: 2
+              - variable: hostPathConfig
+                label: Host Path Configuration
+                schema:
+                  type: dict
+                  show_if: [["type", "=", "hostPath"]]
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
         - variable: transcode
           label: Plex Transcode Storage
           description: The path to store Plex Transcode.

+ 4 - 1
library/ix-dev/charts/plex/templates/_persistence.tpl

@@ -30,7 +30,10 @@ persistence:
           mountPath: /shared
   logs:
     enabled: true
-    type: emptyDir
+    {{- if not .Values.plexStorage.logs -}}
+      {{- $_ := set .Values.plexStorage "logs" (dict "type" "emptyDir" "emptyDirConfig" (dict "medium" "" "size" "")) -}}
+    {{- end }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.plexStorage.logs) | nindent 4 }}
     targetSelector:
       plex:
         plex:

+ 4 - 0
library/ix-dev/charts/plex/values.yaml

@@ -34,6 +34,10 @@ plexStorage:
     type: ixVolume
     ixVolumeConfig:
       datasetName: config
+  logs:
+    type: ixVolume
+    ixVolumeConfig:
+      datasetName: logs
   transcode:
     type: ixVolume
     ixVolumeConfig: