munnerz / kube-plex

Scalable Plex Media Server on Kubernetes -- dispatch transcode jobs as pods on your cluster!
Apache License 2.0
1.22k stars 191 forks source link

support nfs mounts in kube-plex? #41

Open justinrush opened 5 years ago

justinrush commented 5 years ago

Was easy enough to modify the main kube plex chart to mount in nfs ephemeral volumes, but the go script looks a bit more complicated and I'm unfamiliar with GO so can't really modify it. Looks like the plex transcode pod generated by the go script expects to be able to read from the directory.

Ideally I'd have this in the values.yaml to allow for overrides: `media:

- name: nfs-tv

#path: /media/tv
#mountPath: /media/tv
#server: myMediaServer
#readOnly: true

`

and then in the deployments yaml I had this: ` volumeMounts: {{- range .Values.media }}

JSteeleIR commented 5 years ago

I've been able to get NFS mounts to work in kube-plex, but it seems that the kube-plex started PMS container (the one responsible for doing the actual transcoding) doesn't run the traditional PMS "first-run" script, and therefore doesn't apply the UID/GID that's been passed to Plex. This leaves the transcoding container trying to operate on files in the NFS mount as root, while the PMS container is running as the plex UID/GID.

justinrush commented 5 years ago

Mind passing along the go script you used to do that?

Get Outlook for Androidhttps://aka.ms/ghei36


From: JSteeleIR notifications@github.com Sent: Tuesday, December 25, 2018 4:49:17 AM To: munnerz/kube-plex Cc: Justin Rush; Author Subject: Re: [munnerz/kube-plex] support nfs mounts in kube-plex? (#41)

I've been able to get NFS mounts to work in kube-plex, but it seems that the kube-plex started PMS container (the one responsible for doing the actual transcoding) doesn't run the traditional PMS "first-run" script, and therefore doesn't apply the UID/GID that's been passed to Plex. This leaves the transcoding container trying to operate on files in the NFS mount as root, while the PMS container is running as the plex UID/GID.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/munnerz/kube-plex/issues/41#issuecomment-449839320, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXhFK-kmYE0-OuHQXOtPuI74Rx8tOM65ks5u8gKtgaJpZM4Zgm0v.

JSteeleIR commented 5 years ago

Thus far, I haven't had to modify any of the go.

To get NFS working, I manually created the PVs and PVCs corresponding to my config, data, and transcode directories, and specified them in the appropriate places in the chart values.yaml. With some tweaks to the values/deployment template, I managed to get the plex UID/GID pushed into the created container, and it seems to be behaving aside from transcoding (but that might be something else to do with my environment, not sure yet.)

Here are the changes I made to push UID/GID into the containers: https://github.com/JSteeleIR/kube-plex/commit/ba8a0f7bf592a408c538cbe5da4bb540c0afea99

justinrush commented 5 years ago

Ah, I have multiple NFS mounts for the media, so that won't work for me. But +1 for documenting the enabled flag :) that got me a few times.

I'll take a look at the GO script later this week and see if I can come up with a proposal that works for more than just me.