Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple GPU support and improve rclone secret usage in Helm chart #113

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/plex-media-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions charts/plex-media-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down
27 changes: 21 additions & 6 deletions charts/plex-media-server/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 16 additions & 6 deletions charts/plex-media-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ""


Expand Down Expand Up @@ -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:
Expand Down
Loading