Closed dcplaya closed 4 years ago
I think a sidecar might be a better option here?
Probably, I'm new to all of k8s. I can see if I can re-work it into a sidecar (once I actually learn what a sidecar does! :D)
Edit: Looks like I can run a alpine socat container and share the /dev mounts between the two. Not sure if HA will like doing that but I will give it a try and update the PR when I get it
Anyone have any experience sharing a /dev
device between pods? I shared them like one would share a volume between the two but it does not seem to like that (either HA or Kubernetes). I am still re-working/mucking with it to see if I screwed something up but if anyone has a idea/suggestion, please chime in.
Branch location is here, while I mess around trying to get it to work.
@dcplaya I bashed my head against doing this same thing for a week or so and eventually gave up. There is a lot of deliberate isolation around things in /dev/* as things like /dev/mem exist. I eventually rolled my own docker image to get socat working, but socat was spotty and the image was tedious to maintain.
Ultimately, I deployed zwave2mqtt on my raspberry pi that hosts the usb controller, and then stood up an mqtt broker in Kubernetes. Works flawless, much more stable than socat/ser2net, I would highly recommend.
If you're intent on a sidecar :), the 1.17 feature PodShareProcessNamespace
may get you somewhere.
I had a feeling things in /dev
were special. I haven't revisited it this week, moved on to some other charts to clear my head (got to get some wins every now and then for a moral booster). I'll check out the PodShareProcessNamespace
but have a feeling zigbee2mqtt is going to be where I end up. And luckily someone recently added that to the HA chart! I will just have to bite the bullet and re-do some Node-Red flows, not the end of the world.
Officially giving up on this. The PodShareProcessNamespace
is useful for this scenario but since the PID changes on each pod creation, there is no way to consistently link the two pods together. I will leave the branch active if someone wants to try again but I will be flipping to zigbee2mqtt
and re-configuring my setup to use that instead.
Special notes for your reviewer:
Allowed me to use a Nortek zigbee/zwave device by ser2sock and a custom configMap to run socat before HA starts. The default is disabled and also runs HA if it is enabled
Example configMap
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
[radarr]
)