{{ template "chart.header" . }} {{ template "chart.deprecationWarning" . }} {{ template "chart.badgesSection" . }} {{ template "chart.homepageLine" . }} {{ template "chart.description" . }} While Plex is responsible for maintaining this Helm chart, we cannot provide support for troubleshooting related to its usage. For community assistance, please visit our [support forums](https://forums.plex.tv/). ### Installation via Helm 1. Add the Helm chart repo ```bash helm repo add plex https://raw.githubusercontent.com/plexinc/pms-docker/gh-pages ``` 2. Inspect & modify the default values (optional) ```bash helm show values plex/plex-media-server > values.yaml ``` 3. Install the chart ```bash helm upgrade --install plex plex/plex-media-server --values values.yaml ``` [Additional details available here](https://www.plex.tv/blog/plex-pro-week-23-a-z-on-k8s-for-plex-media-server/) ### Sample init Container scripts If you already have a different PMS server running elsewhere and wish to migrate it to be running in Kubernetes the easiest way to do that is to import the existing PMS database through the use of a custom init script. **Note: the init script must include a mechanism to exit early if the pms database already exists to prevent from overwriting its contents** The following script is an example (using the default `alpine` init container) that will pull a tar gziped file that contains the pms `Library` directory from some web server. ```sh #!/bin/sh echo "fetching pre-existing pms database to import..." if [ -d "/config/Library" ]; then echo "PMS library already exists, exiting." exit 0 fi apk --no-cache add curl curl http://example.com/pms.tgz -o pms.tgz tar -xvzf pms.tgz -C /config rm pms.tgz echo "Done." ``` This next example could be used if you don't have or can't host the existing pms database archive on a web server. However, this one _does_ require that two commands are run manually once the init container starts up. 1. Manually copy the pms database into the pod: `kubectl cp pms.tgz /:/pms.tgz.up -c -pms-chart-pms-init` 2. Once the file is uploaded copy rename it on the pod to the correct name that will be processed `kubectl exec -n --stdin --tty -c -pms-chart-pms-init h -- mv /pms.tgz.up /pms.tgz` The file is being uploaded with a temporary name so that the script does not start trying to unpack the database until it has finished uploading. ```sh #!/bin/sh echo "waiting for pre-existing pms database to uploaded..." if [ -d "/config/Library" ]; then echo "PMS library already exists, exiting." exit 0 fi # wait for the database archive to be manually copied to the server while [ ! -f /pms.tgz ]; do sleep 2; done; tar -xvzf /pms.tgz -C /config rm pms.tgz echo "Done." ``` ## Contributing Before contributing, please read the [Code of Conduct](../../CODE_OF_CONDUCT.md). ## License [GNU GPLv3](./LICENSE) {{ template "chart.maintainersSection" . }} {{ template "chart.sourcesSection" . }} {{ template "chart.requirementsSection" . }} {{ template "chart.valuesSection" . }} {{ template "helm-docs.versionFooter" . }}