diff --git a/charts/plex-media-server/Chart.yaml b/charts/plex-media-server/Chart.yaml index ed4575de..a86fef98 100644 --- a/charts/plex-media-server/Chart.yaml +++ b/charts/plex-media-server/Chart.yaml @@ -22,7 +22,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/plex-media-server/README.md b/charts/plex-media-server/README.md index 6a0f7794..748c15b8 100644 --- a/charts/plex-media-server/README.md +++ b/charts/plex-media-server/README.md @@ -106,6 +106,7 @@ The following table lists the configurable parameters of the Pms-chart chart and | `ingress.annotations` | Extra annotations to add to the ingress. | `{}` | | `pms.storageClassName` | The storage class that will be used for the PMS configuration directory, if not specified the default will be used | `null` | | `pms.configStorage` | The amount of storage space that is allocated to the config volume, this will probably need to be much higher if thumbnails are enabled. | `"2Gi"` | +| `pms.gpu.nvidia.enabled` | Enabling this will add nvidia.com/gpu: 1 to limits, and will set environment for the nvidia operator | `false` | | `pms.resources` | | `{}` | | `initContainer.image.registry` | The registry that should be used to pull the image from | `"index.docker.io"` | | `initContainer.image.repository` | The docker repo that will be used for the init image to run the setup scripts| `"alpine"` | diff --git a/charts/plex-media-server/templates/statefulset.yaml b/charts/plex-media-server/templates/statefulset.yaml index 131a80c3..eb3d863a 100644 --- a/charts/plex-media-server/templates/statefulset.yaml +++ b/charts/plex-media-server/templates/statefulset.yaml @@ -85,11 +85,10 @@ spec: - name: {{ include "pms-chart.fullname" . }}-config image: {{ include "pms-chart.init_image" . }} command: - - cp + - sh + - -c args: - - -v - - /in/rclone.conf - - /out/rclone.conf + - cp -v /in/* /out/ volumeMounts: - name: rclone-config-data mountPath: /in @@ -113,10 +112,26 @@ spec: - name: {{ $key }} value: {{ $value | quote }} {{- end }} + {{- if .Values.pms.gpu.nvidia.enabled }} + - name: NVIDIA_VISIBLE_DEVICES + value: all + - name: NVIDIA_DRIVER_CAPABILITIES + value: compute,video,utility + {{- end }} {{- with .Values.pms.resources }} resources: -{{ toYaml . | indent 10 }} - {{- end }} + limits: + {{- with .limits }} + {{ toYaml . | indent 12 | trim }} + {{- end }} + {{- if and $.Values.pms.gpu.nvidia.enabled (not (hasKey .limits "nvidia.com/gpu")) }} + nvidia.com/gpu: 1 + {{- end }} + {{- if .requests }} + requests: + {{ toYaml .requests | indent 12 | trim }} + {{- end }} + {{- end }} volumeMounts: - name: pms-config mountPath: /config diff --git a/charts/plex-media-server/values.yaml b/charts/plex-media-server/values.yaml index 9930bc35..05503c16 100644 --- a/charts/plex-media-server/values.yaml +++ b/charts/plex-media-server/values.yaml @@ -36,6 +36,12 @@ pms: # NOTE: When set, 'configStorage' and 'storageClassName' are ignored. configExistingClaim: "" + # Enabling this will add nvidia.com/gpu: 1 to limits, and will set + # environment for the nvidia operator + gpu: + nvidia: + enabled: false + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -101,7 +107,10 @@ rclone: pullPolicy: IfNotPresent # The name of the secret that contains the rclone configuration file. - # The key must be called `rclone.conf` in the secret + # The rclone config key must be called `rclone.conf` in the secret + # + # All keys in configSecret will be available in /etc/rclone/. This might + # be useful if other files are needed, such as a private key for sftp mode. configSecret: "" @@ -189,15 +198,16 @@ extraEnv: {} # Optionally specify additional volume mounts for the PMS and init containers. extraVolumeMounts: [] # extraVolumeMounts: -# - name: some-volume-name -# mountPath: /path/in/container - +# - name: dev-dri +# mountPath: /dev/dri # Optionally specify additional volumes for the pod. extraVolumes: [] # extraVolumes: -# - name: some-volume-name -# emptyDir: {} +# - name: dev-dri +# hostPath: +# path: /dev/dri +# type: Directory extraContainers: [] # extraContainers: