munnerz / kube-plex

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

Transcode not working #56

Open vFondevilla opened 5 years ago

vFondevilla commented 5 years ago

Hi,

I just deployed the chart in a K8s 1.14.1 cluster, using NFS PVC. The PMS server starts correctly and when transcoding the stream fails with the following errors in the transcoding pod: [tcp @ 0x7f040c047a00] Connection to tcp://127.0.0.1:32400 failed: Connection refused [libx264 @ 0x33d9d60] frame=1455 QP=30.87 NAL=2 Slice:B Poc:350 I:0 P:11 SKIP:499 size=86 bytes [http @ 0x357d8c0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy' [tcp @ 0x33d94c0] Connection to tcp://127.0.0.1:32400 failed: Connection refused

Checked if the no auth network multiple times and It were correctly configured (I tried multiple values) to no avail.

Greets

knucklehead101 commented 5 years ago

I am getting this as well in a 2.x cluster. working on figuring it out but has anyone else figured it out yet?

tardich commented 5 years ago

Got the same here as well (K8S 1.13.5). Added the 127.0.0.1 (as I thought it would be possible that the transcoder pod to try the loopback for connection back to the media server) bt it didn't help

tardich commented 5 years ago

Apparently, the latest plex image (1.16.0.1226-7eb2c8f6f) fixes the "Connection refused" issue. Updated the values file, then updated the helm deployment,.

The logs of the transcoder now shows me that it connects to the plex-kube-plex service, That said, I don't have more success rate on the overall thing. The trnscoding seem to be damn slow. Maybe because my storage is ceph underneat?

jp83 commented 5 years ago

When I recently tried this for the first time a couple weeks ago it seemed to be working, as in the dynamic transcode worker pod spun up and was creating files in it's directory, however the playback from the browser was just stuck spinning and never streamed any video. Any ideas on that? I didn't realize it myself either, but I think the delay you're experiencing is one of the problems with this approach and there's a few other issues with ideas on how to have a worker waiting and ready. I'm looking forward to some updates eventually, but in the meantime, just disabled it since my family won't want to be patient enough wait for it to start.

vFondevilla commented 5 years ago

Same here, I disabled the transcoding pods and I'm using the parent pod for the transcoding, that way works correctly.

tardich commented 5 years ago

How did you do it? In the helm chart only or if you need to do something else?

tardich commented 5 years ago

Ah! Got it, and I can now stream easily (well.... I can now see the video from Firefox in my workstation

Another issue I have is the ability to "discover" my plex server from a uPNP/DLNA client (for example Kodi), now that my server resides inside Kubernetes. My network design, basically, is this:

Workstations are located on a flat lan. From there, I have a router, which also connects the kubernetes nodes on a different vlan (no nat, direct routing), and the plex pod exposes itself as a LoadBalancer service IP which, again, is directly reachable from the workstation lan, without NAT.

Is there anything I need to modify for my plex server to be reachable / discoverable?

knucklehead101 commented 5 years ago

I will have to give it another go. I have been playing with UnicornTranscoder but having some issues in putting it behind the Layer-7 LB in Rancher/Kubernetes. Is anyone else playing with Kube-Plex in Rancher?

chtardif commented 5 years ago

That's a Rancher setup I have, by the way.

billimek commented 5 years ago

@knucklehead101 I'm running kube-plex as a helm chart in a k8s cluster provisioned by rke (which is a rancher thing but not running rancher directly). I also pass-through the intel iGPU to the k8s worker node where plex is provisioned so plex native transcoder can use GPU transcoding.

jp83 commented 5 years ago

I used rancher to setup my cluster with a master and 2 worker nodes in RancherOS VMs. I'm using MetalLB L2 loadbalancer and traefik reverse proxy for ingress. I had some problems defining the LAN, no auth, and services addresses in the config besides just putting in the cluster IPs. I gave my VMs 2 network interfaces, one on my LAN and another on a separate storage network VLAN. What I'm stuck on at the moment is that the Plex dashboard shows any streaming clients are all the IP of my storage interface on the VM. It doesn't make sense because that network isn't even routable and I defined an IP in the LAN subnet for metallb. I figured this was some sort of confusion like reverse lookup from metallb or interworkings of k8s networking I've yet to understand. But at the moment since everything seems to be coming in on this so it's all or nothing LAN or remote.

knucklehead101 commented 5 years ago

@jp83 I have seen weird things come about such as what you're experiencing when the interfaces are in the wrong order. try flip flopping them

@billimek I am now officially jealous. I have an old medical imaging system with an NVIDIA Tesla card in it. I may try to see if I can get that to work. What OS are you using for your host?

jp83 commented 5 years ago

@knucklehead101 thanks for the suggestion, i do have the storage vlan first in the VM settings on ESXi, but I defined the static IPs in relation to the mac addresses via cloud-config when I set it up. I just tried swapping them, and that definitely hosed things up because some things on the dashboard were in failed states related to that node. Is that what you meant, any other ideas?

knucklehead101 commented 5 years ago

@jp83 yea that is what I had on my mind. I think that some apps consider the first NIC as the default so it reports the wrong IP. I tinker a lot so if this were happening in my lab I would likely tear it all down and rebuild it while having the NICs ordered differently to see if that fixes it. Since I am still quite a noob I know no other way to do it, unfortunately.

tardich commented 5 years ago

You may likely be having to play with iproute2 and different routing tables. SHould do the job

tardich commented 5 years ago

@knucklehead101 And how did you manage to see your plex server outside of Kubernetes? As far as I know, DLNA is a multicast protocol which does not play well with Kubernetes... well in fact, my k8s cluster sits behind a router from my workstations point of view, which make things even more difficult...

jp83 commented 5 years ago

I haven't see @munnerz active in a bit, hopefully it's ok to continue these types of discussions here not sure if it's better to separate out issues.

@tardich I'm not specifically using DLNA but I'm using MetalLB so the plex pod gets an IP directly on my LAN not just inside the cluster.

@knucklehead101 my network interfaces are in the "correct" order on a second node and when running over there the remote streaming IP corresponds to the LAN IP of that node, I'm not sure if that's the correct behavior or if I should see the actual LAN client, I'll double check my settings.

knucklehead101 commented 5 years ago

@tardich I don't use the DLNA function so that isn't an issue. However, the setup that I was trying to use most recently didn't utilize kube for plex itself. WIth UnicornTranscoder it does some http redirects from their load-balancer to the transcode containers but I would rather get this solution up and running. As of 30 min ago I have 3 proxmox hosts up and running and I am trying to follow the instructions that @billimek wrote :D. I have never used Proxmox so I am trying to figure a few things out that aren't just "working" but what fun would it be if everything just "worked" lol

mcadam commented 4 years ago

Anybody got it working even with the error "connection refused on 127.0.0.1". I created myself a kubernetes operator to have the idle pool of workers waiting etc, all that is kind of working for now, but now the stream does not start :(

mcadam commented 4 years ago

Ok never mind got it working now, I removed the ReadOnly flags on the volumes of the pod doing the transcode and its now working, maybe some other have that issue as well. Anyway now running the last version and transcode jobs dispatch in new pods. Having idle pods in a queue waiting for the next job is getting me really good results. It looks as fast as it was all in the same container :)

scruplelesswizard commented 4 years ago

@mcadam how did you remove the ReadOnly flags from the transcode pods?

mcadam commented 4 years ago

I am using my own kubernetes operator to create to transcode pods so just dealing with the volumes differently than the script used in that repo. But you could modify the main.go file and remove the flag in there, recompile and use that instead of the one created from this repo.

red-avtovo commented 4 years ago

If someone is still guessing how to disable on-demand transcoding pods - just add this argument to helm command --set kubePlex.enabled=false