I’m trying to get redis to work only on the private subnet (eg. shared only with other docker containers).
This is not working well.
I’ve turned protected mode to no
I’ve tried turning bind off AND I’ve tried binding to 0.0.0.0
The server will work if I expose the port, binding it to the container’s port and make it publicly accessible, but that is not the end goal. I really would like redis to run on the 10.42.* subnet, and only be visible to my other docker containers. I want the host to be ephemeral as I’m not stating redis to disk at all, I don’t want to set up firewall rules on the host etc.
I’m sure a bunch of you folks out there have done this, I would just like a direction to head. Thank you very much for reading this!
I am running several servers on the private network, unexposed, and they are all accessible to their downstream consumers, but redis is being a butthead.
It turns out that when the process starts, for some reason the subnet is unavailable, but the host networks are. I’ve “fixed” it by deferring all connections until after init() and just adding a redis connection checker to the healthcheck.
This doesn’t seem to be a problem with anything other than redis though. And how I found it was I stopped launching the service, and spawned with a shell, then logged into the instance and started the service manually (this worked! o.0)
It would be nice to have a final answer but it isn’t necessary anymore. Thanks for reading this!