3 ms·
Somewhat unrelated (but maybe it's actually related). I've been trying to setup a local development environment for Kubernetes on mac. On mac, docker does not a
by brigadier132 3y ago
Somewhat unrelated (but maybe it's actually related). I've been trying to setup a local development environment for Kubernetes on mac. On mac, docker does not allow for connecting directly to the pods, you need to either setup a tunnel or service. The problem for my use case is that each pod could have a different port and local address and a load balancer does not make sense for what I'm building which requires connecting directly to a specific pod. Does Podman solve this problem? I think the problem is dockerd on mac. As of now, I just have a completely separate environment in the cloud that I run test on but it's very inefficient.
I tried switching to nerdctl and containerd but the problem is that I have existing workflows that make use of docker_init files and nerdctl breaks those.
- stonemetal12 3y ago>docker does not allow for connecting directly to the pods, you need to either setup a tunnel or service That isn't docker, Kubernetes is designed to work that way. To be infinitely horizontally scalable, and automatically handle pods (and servers) going down, caring about which instance you are talking to is generally a bad thing.
- deleted 3y ago[deleted]
- dingledork69 3y agoSetting up a Kubernetes service is the way to go, though you could also use NodePort on the pods.
- andrewmackrodt 3y agoWhile this may not solve your problem, I use docker-network-connect which lets me connect directly to containers running in the 172.x.x.x range. By default, macOS does not support routing from host to containers by IP https://github.com/chipmk/docker-mac-net-connect https://github.com/chipmk/docker-mac-net-connect. In the kubernetes case (I am using k3d on my Mac) pods aren't directly routable but with metallb, load balancer IP addresses can be connected to directly and there's no worry about port conflicts as there might be with k3d's default servicelb implementation (this is my bootstrap script https://github.com/andrewmackrodt/k3d-boot https://github.com/andrewmackrodt/k3d-boot). If you need to connect to specific pods directly and it doesn't make sense to change your pod config, kubectl port-forward may suffice?