adambkaplan / plex-operator

Yet another Plex operator for Kubernetes
Apache License 2.0
17 stars 4 forks source link

gpu transcoding support and resource limits #9

Open brunnels opened 3 years ago

brunnels commented 3 years ago

Where can I set container environment variables and resource limits to run the pod only on nodes that support hardware transcoding?

For instance with this chart https://github.com/k8s-at-home/charts/blob/master/charts/stable/plex/values.yaml I would have values.yml be something like this:

env:
  TZ: "America/Chicago"
  PLEX_CLAIM: "claim$$$$$$"
  PLEX_PREFERENCE_1: "FriendlyName=plex-k3s"
  PLEX_PREFERENCE_2: "EnableIPv6=0"
resources:
  limits:
    nvidia.com/gpu.present: true
adambkaplan commented 3 years ago

I think I'll want to split this out into a few issues that folks can contribute to:

  1. Timezone - IMO this can be a first class API field.
  2. Advanced preferences - per the support article, these can be defined in a Preferences.xml file [1]. Instead of environment variables, I'd rather have the API reference a ConfigMap that can be mounted in.
  3. Resources - this should be a first class API field. Not defining CPU and memory limits is not great...

Other things we should support:

  1. Node selectors
  2. Tolerations

[1] https://support.plex.tv/articles/201105343-advanced-hidden-server-settings/

adambkaplan commented 3 years ago

See #11 for updating the time zone.

adambkaplan commented 3 years ago

See #12 for providing Preferences.xml

adambkaplan commented 3 years ago

See #13 for node selectors and tolerations

adambkaplan commented 3 years ago

Marking this a good first issue if anyone wants to contribute. Since nvidia/gpu.present is a resource that can be specified by the standard k8s Resources object, we can add this feature by allowing users to set container resources in general.