From 333871914d9cabb4468f32351de1e88b3953d8ce Mon Sep 17 00:00:00 2001 From: Marshall Asch Date: Mon, 19 Jun 2023 12:30:00 -0400 Subject: [PATCH] chore: move the individual pms env variables to a generic global varaibles value --- charts/plex-media-server/README.md | 9 +--- .../templates/statefulset.yaml | 30 +++---------- charts/plex-media-server/values.yaml | 44 ++++++------------- 3 files changed, 21 insertions(+), 62 deletions(-) diff --git a/charts/plex-media-server/README.md b/charts/plex-media-server/README.md index 270a0a16..4677b2cf 100644 --- a/charts/plex-media-server/README.md +++ b/charts/plex-media-server/README.md @@ -81,14 +81,6 @@ The following table lists the configurable parameters of the Pms-chart chart and | `ingress.ingressClassName` | | `"ingress-nginx"` | | `ingress.url` | The url that will be used for the ingress, this should be manually configured as the app URL in PMS. | `""` | | `ingress.annotations` | Extra annotations to add to the ingress. | `{}` | -| `pms.claim` | The optional PMS claim token that can be used when started a PMS server for the first time | `""` | -| `pms.name` | The optional name that will be given to the PMS | `"PlexServer"` | -| `pms.timeZone` | The timezone to use for the PMS container | `"Etc/UTC"` | -| `pms.updateChannel` | The number to use to specify the release channel to check for new PMS versions. | `null` | -| `pms.uid` | The user ID that PMS will run as | `null` | -| `pms.gid` | The group ID that PMS will run as | `null` | -| `pms.allowedNetworks` | An optional list of network CIDRs that are allowed to access PMS without authentication | `null` | -| `pms.advertiseIp` | An optional list of additional IPs that PMS will advertise that it can be found at | `null` | | `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.resources` | | `{}` | @@ -124,6 +116,7 @@ The following table lists the configurable parameters of the Pms-chart chart and | `tolerations` | | `[]` | | `affinity` | | `{}` | | `commonLabels` | Labels that will be added to all resources created by the chart | `{}` | +| `extraEnv` | Environment variables that will be added to the PMS container | `{}` | | `extraVolumeMounts` | Additional volume mount configuration blocks for the pms container | `[]` | | `extraVolumes` | Extra volume configurations | `[]` | | `extraContainers` | Extra contain configuration blocks that will be run alongside the PMS container _after_ the init container finishes | `[]` | diff --git a/charts/plex-media-server/templates/statefulset.yaml b/charts/plex-media-server/templates/statefulset.yaml index e3b7b4dc..33e83298 100644 --- a/charts/plex-media-server/templates/statefulset.yaml +++ b/charts/plex-media-server/templates/statefulset.yaml @@ -85,31 +85,13 @@ spec: - containerPort: 32400 name: pms env: - - name: PLEX_CLAIM - value: {{ .Values.pms.claim }} - - name: HOSTNAME - value: {{ .Values.pms.name}} - - name: TZ - value: {{ .Values.pms.timeZone }} - {{- if .Values.pms.updateChannel }} - - name: PLEX_UPDATE_CHANNEL - value: {{ .Values.pms.updateChannel }} - {{- end }} - {{- if .Values.pms.uid }} - - name: PLEX_UID - value: {{ .Values.pms.uid }} - {{- end }} - {{- if .Values.pms.gid }} - - name: PLEX_GID - value: {{ .Values.pms.gid }} - {{- end }} - {{- if .Values.pms.allowedNetworks }} - - name: ALLOWED_NETWORKS - value: {{ .Values.pms.allowedNetworks }} - {{- end }} - {{- if .Values.pms.advertiseIp }} + {{- if .Values.ingress.enabled }} - name: ADVERTISE_IP - value: {{ .Values.pms.advertiseIp }} + value: {{ trimPrefix "https://" .Values.ingress.url }} + {{- end }} + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key }} + value: {{ $value }} {{- end }} {{- with .Values.pms.resources }} resources: diff --git a/charts/plex-media-server/values.yaml b/charts/plex-media-server/values.yaml index 960e619f..81c7d51b 100644 --- a/charts/plex-media-server/values.yaml +++ b/charts/plex-media-server/values.yaml @@ -30,36 +30,6 @@ ingress: annotations: {} pms: - # This claim is optional, and is only used for the first startup of PMS - # The claim is obtained from https://www.plex.tv/claim/ is is only valid for a few minutes - claim: "" - - # the name to use for the plex server - # this is only used for the first startup of PMS - name: "PlexServer" - - # The timezone to use in the container - timeZone: "Etc/UTC" - - # the optional update channel to use for the server - updateChannel: null - - # the plex user id to use inside the container - # this is only used for the first startup of PMS - uid: null - - # the plex user group id to use inside the container - # this is only used for the first startup of PMS - gid: null - - # a list of CIDRs that can use the server without authentication - # this is only used for the first startup of PMS - allowedNetworks: null - - # additional ips to advertise that the server can be found, optional - # this is only used for the first startup of PMS - advertiseIp: null - # The storage class to use when provisioning the pms config volume # this needs to be created manually, null will use the default storageClassName: null @@ -193,6 +163,20 @@ affinity: {} # Common Labels for all resources created by this chart. commonLabels: {} +extraEnv: {} +# extraEnv: + # This claim is optional, and is only used for the first startup of PMS + # The claim is obtained from https://www.plex.tv/claim/ is is only valid for a few minutes +# PLEX_CLAIM: "claim" +# HOSTNAME: "PlexServer" +# TZ: "Etc/UTC" +# PLEX_UPDATE_CHANNEL: "5" +# PLEX_UID: "uid of plex user" +# PLEX_GID: "group id of plex user" + # a list of CIDRs that can use the server without authentication + # this is only used for the first startup of PMS +# ALLOWED_NETWORKS: "0.0.0.0/0" + # Optionally specify additional volume mounts for the PMS and init containers. extraVolumeMounts: []