Configuring Plex on Deepthot
I’ve got a conundrum about this. I want to use the official helmchart, but I also want my media on the lan in the regular place. That means that I can’t use their helmchart. The problem is that they are using persistent storage which is not flat as far as I can tell. There is a ‘nfs’ pod volume definition that you just specify the location of the share. That’s exactly what I want, but there isn’t a way to put it in.
I think what I’m going to do is in the helmchart there is a place where the volumes are declared. I’m going to add a variable that will expand to whatever volumes you want to declare in the pod definition and whatever
I found someone who already did the changes I wanted to do on a fork. I guess I’ll go with his rather than reinventing the wheel. I’m going to store my configuration in a repo on my gitlab. I’m also going to fork the original helm chart and then pull in the other guy’s fork.
So I forked munnerz/kube-plex and sucked it into my repo at deepthot. Now I’m going to fetch gandazgul/kube-plex and merge his branch.
I’m glad he did what he did. It would be nice if they’d said that it’s not possible to easily add more volumes. The basic design of kube-plex contains this code:
func generatePod(cwd string, env []string, args []string) *corev1.Pod {
envVars := toCoreV1EnvVar(env)
return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "pms-elastic-transcoder-",
},
Spec: corev1.PodSpec{
NodeSelector: map[string]string{
"beta.kubernetes.io/arch": "amd64",
},
RestartPolicy: corev1.RestartPolicyNever,
Containers: []corev1.Container{
{
Name: "plex",
Command: args,
Image: pmsImage,
Env: envVars,
WorkingDir: cwd,
VolumeMounts: []corev1.VolumeMount{
{
Name: "data",
MountPath: "/data",
ReadOnly: true,
},
{
Name: "config",
MountPath: "/config",
ReadOnly: true,
},
{
Name: "transcode",
MountPath: "/transcode",
},
},
},
},
Volumes: []corev1.Volume{
{
Name: "data",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: dataPVC,
},
},
},
{
Name: "config",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: configPVC,
},
},
},
{
Name: "transcode",
VolumeSource: corev1.VolumeSource{
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
ClaimName: transcodePVC,
},
},
},
},
},
}
}
This is hard wiring the data structure that the is in the config file for a pod. It’s not really possible with the current design to have an arbitrary batch of config file be reflected in this code. Instead it’s going to have to call the parser and pass it the configuration. This is beyond my current level of understanding. Perhaps later. Maybe refactor plex to actually pull out the transcoder into a stand alone application. Or maybe there’s a transcoder that already exists.
For right now, what I think I should do is create another node in the cluster that’s really beefy and then disable this addon and ask for a much beefier container.
Plex Media Server on Deepthot
These are the stats I’m going to use:
| Memory | Cores |
|---|---|
| 16G | 6 |
Same setup as usual.
Not too bad. Had to touch a few of the docs here. I think I need to fix them all, make them pretty, and stuff.
OK, here is the configuration:
# Default values for kube-plex.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
repository: plexinc/pms-docker
tag: 1.16.0.1226-7eb2c8f6f
pullPolicy: IfNotPresent
kubePlex:
enabled: false
image:
repository: quay.io/munnerz/kube-plex
tag: latest
pullPolicy: IfNotPresent
# Override this with the plex claim token from plex.tv/claim
claimToken: ""
# Set the timezone of the plex server
timezone: America/Phoenix
service:
# type: ClusterIP
port: 32400
type: NodePort
nodePort: 32400
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport ## # nodePort: ## Provide any additional annotations which may be required. This can be used to ## set the LoadBalancer service type to internal only. ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer ## annotations: {}
labels: {}
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank ## # loadBalancerIP: # loadBalancerSourceRanges: [] ## Set the externalTrafficPolicy in the Service to either Cluster or Local # externalTrafficPolicy: Local
ingress:
enabled: false
# Used to create an Ingress record.
hosts:
- chart-example.local
annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" tls:
# Secrets must be manually created in the namespace.
# - secretName: chart-example-tls # hosts: # - chart-example.local
rbac:
create: true
# Specify create: false and serviceAccountName to manually manage the service
# account for this deployment ## serviceAccountName: ""
nodeSelector:
beta.kubernetes.io/arch: amd64
persistence:
transcode:
# Optionally specify claimName to manually override the PVC to be used for
# the transcode directory. If claimName is specified, storageClass and size # are ignored. ## claimName: "plex-transcode-pvc" # Optionally specify a storage class to be used for the transcode directory. # If not specified and claimName is not specified, the default storage # class will be used. storageClass: ""
# Optionally specify a sub path to mount a specific folder from the volume
# https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath ## subPath: "some-subpath" # The requested size of the volume to be used when creating a # PersistentVolumeClaim. size: 20Gi
data:
# Optionally specify claimName to manually override the PVC to be used for
# the data directory. If claimName is specified, storageClass and size are # ignored. ## claimName: "plex-data-pvc" # Optionally specify a storage class to be used for the data directory. # If not specified and claimName is not specified, the default storage # class will be used. storageClass: ""
# Optionally specify a sub path to mount a specific folder from the volume
# https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath ## subPath: "some-subpath" # The requested size of the volume to be used when creating a # PersistentVolumeClaim. size: 40Gi
config:
# Optionally specify claimName to manually override the PVC to be used for
# the config directory. If claimName is specified, storageClass and size # are ignored. ## claimName: "plex-config-pvc" # Optionally specify a storage class to be used for the config directory. # If not specified and claimName is not specified, the default storage # class will be used. storageClass: ""
# Optionally specify a sub path to mount a specific folder from the volume
# https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath ## subPath: "some-subpath" # The requested size of the volume to be used when creating a # PersistentVolumeClaim. size: 20Gi
accessMode: ReadWriteMany
# Additionally to the built-in volume mount you can specify custom volume mounts here to mount other folders
#customVolumeMounts: #- name: data # mountPath: "/data1" # subPath: "optional/subpath" #- name: data2 # mountPath: "/data2" # Additionally to the built-in volumes you can specify custom volumes here #customVolumes: #- name: data2 ## Specify either a claim or emptyDir or anything else supported by kubernetes # persistentVolumeClaim: # claimName: "data2 claim" # emptyDir: {} customVolumeMounts:
- mountPath: /media/movies
name: video
subPath: movies
- mountPath: /media/tv_shows
name: video
subPath: tv_shows
customVolumes:
- name: video
nfs:
server: h2gt2g.deepthot.aa
path: /volume1/video
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 # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. # limits: # cpu: 100m # memory: 128Mi # requests: # cpu: 100m# memory: 128Mi
podAnnotations: {}
proxy:
# This allows to set a proxy environment variable, which PMS uses to fetch the token and assets like movie cover
enable: false
# http: "http://proxy:8080"
# https: "https://proxy:8080" # noproxy: "localhost,127.0.0.1,10.96.0.0/12,10.244.0.0/12"
A few comments here. The whole point of this exercise was to put the customVolumes in near the end of the file. This allows us to put the media on the public file servers like they’ve always been. I want to be able to see them from like windows boxes and stuff.
The removal of ClusterIP and replacing it with nodeport is for the first try. I’ve got the connection nailed up through the router as well. I want all this stuff fixed. We need an ingress controller and an external dns, but that’s going to be in a bit.
Right now it only sorta works. It doesn’t do chromecast. The roku works though, whoda thunk? It’s not doing upnp. I think it doesn’t know what it’s external ip is and it certainly is confused about what is local. I haven’t figure out what’s going on with that yet. Again, I’m going to get ingress up and that will take care of it. I hope anyway ;-)
So it’s working okish, I’ll start copying the external drives onto it tomorrow.
Written with StackEdit.
No comments:
Post a Comment