This repository contains the files I use to provision my Plex Media Server (PMS) container inside of Kubernetes using Helm.
- You are running Kubernetes 1.25 under Microk8s w/ DNS addon, on Ubuntu Linux 22.04 add link to Documentation
- Your Media files are exposed via an SMB Share
- You don't care about using Host Networking (will be swapping out for Bridged-mode eventually)
File | Description |
---|---|
/csi-driver-smb/microk8s-values.yml |
Used when installing the csi-driver-smb CSI to make it work with Microk8s. |
/persistent-volume-claims.yml |
Collection of PersistentVolumeClaims used for PMS |
- plex-data-pvc |
- Reserves its corresponding PersistentVolume (plex-data-pv ) so that it will be pre-existing to pass into the K8s-at-home Helm Chart. |
- media-pvc |
- Reserves its corresponding PersistentVolume (media-pv ) so that it will be pre-existing to pass into the K8s-at-home Helm Chart. |
/persistent-volumes.yml |
Collection of PersistentVolumes used for PMS |
- plex-data-pv |
- Points to wherever you want to store your Plex Media Server data. |
- media-pv |
- Points to wherever you host your Media files. |
/values.yml |
Overrides and preferences for the k8s-at-home/plex Helm chart. Do all your big configuration stuff here. |
- TZ |
- Set the Pod/Container timezone |
- env.PLEX_PREFERENCE_XX |
- Override/Set a buttload of PMS settings up-front, so we can re-create / not have to go through Web UI |
- hostNetwork |
- Set to true (for now, until Bridged Networking is solved) |
- dnsPolicy |
- Set this to ClusterFirstWithHostNet to work with hostNetwork |
- dnsConfig |
- Had to configure ndots to 1 in order for DNS lookups to function under Microk8s / CoreDNS / hostNetwork mode |
- persistence.transcode |
- Set medium: Memory to put /transcode mapped-volume into memory-backed tmpfs |
helm repo add csi-driver-smb https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
helm install csi-driver-smb csi-driver-smb/csi-driver-smb --create-namespace --namespace csi-driver-smb --version v1.9.0 -f ./csi-driver-smb/microk8s-values.yml
kubectl create namespace plex-media-server
kubectl -n plex-media-server create secret generic smbcreds --from-literal username=<SMB Share username> --from-literal password="<SMB Share password>"
kubectl create -f persistent-volumes.yml
kubectl -n plex-media-server create -f persistent-volume-claims.yml
Visit https://www.plex.tv/claim/, login, and get a Claims Token prepared.
helm install plex-media-server k8s-at-home/plex -n plex-media-server -f values.yml --set env.PLEX_CLAIM=<claims token here>
-
Quick Commands Reference
helm delete plex-media-server -n plex-media-server
kubectl -n plex-media-server delete -f persistent-volume-claims.yml
kubectl delete -f persistent-volumes.yml
kubectl -n plex-media-server delete secret smbcreds
kubectl delete namespace plex-media-server
-
If you
sudo snap remove microk8s
to wipe the slate clean...- Be sure to
ip a
and check for calico/flannel related interfaces. Sometimes they don't all get cleaned up properly, and you need tosudo ip link del <if name>
them - Be sure to cleanup any saved snapshots you no longer care about (
sudo snap saved
andsudo snap forget
)
- Be sure to
-
Directories to be aware of
plex-data-pv:Library/Application Support/Plex Media Server
plex-data-pv:Library/Application Support/Plex Media Server/Crash Reports
plex-data-pv:Library/Application Support/Plex Media Server/Logs
plex-data-pv:Library/Application Support/Plex Media Server/Preferences.xml
-
Found a buttload of PMS configuration/env var settings located at
http://127.0.0.1:32400/:/prefs
when the Web UI loads up. (Watch the Network / XHR tab for this) -
Found an interesting project to look into possibly: kube-plex
- plex: Claim Code (Claims Token)
- DockerHub: Official PMS Docker Image
- GitHub: Official PMS Docker Image Repo
- GitHub: k8s-at-home/charts repo
- GitHub: k8s-at-home/library-charts
- csi-driver-smb
- CIFS Mount not performed despite logs indicating "mount succeeded"
- How to reclaim your server after resetting your account password, if you can't access the server directly.
- Plexopedia: Server Capabilities
- plex: Opening Plex Web App (mainly for the section Opening the Plex Web App on a Device Other than the Server Itself)
- plex: Advanced, Hidden Server Settings
- plex: Troubleshooting Remote Access
- plex: Why am I locked out of Server Settings and how do I get in?
- plex: Cannot claim server
- Persistent Volumes
- Self-host your Media Center On Kubernetes with Plex, Sonarr, Radarr, Transmission and Jackett
- PSA for Server Claiming: Check allowedNetworks
- Plex running in docker, can't find server
- plex-claim-server.sh
- claimpms.sh