Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multinode: watch Kubernetes service resources instead of depending on etcd #56

Open
AkihiroSuda opened this issue Mar 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@AkihiroSuda
Copy link
Member

Deploying etcd is hard, so maybe we should just watch Kubernetes services instead.

cc @naoki9911

@AkihiroSuda AkihiroSuda added the enhancement New feature or request label Mar 4, 2024
@AkihiroSuda
Copy link
Member Author

IIUC, the multi-node bypass will only work for Pod-to-NodePort communications, so probably we will just need to watch .spec.podCIDR and add it to the bypass4netnsd --ignore list?

For Pod-to-Pod communications, we will need a (existing) userspace service mesh that multiplexes pod IPs to a single NodePort as a proxy.
This will cause some overhead, but with bypass4netns it will be still better than slirp4netns+TAP+VXLAN.

@naoki9911 Let me know if I'm missing something.

@naoki9911
Copy link
Collaborator

Theoretically, the multi-node bypass can handle pod-to-pod communications without the proxy.
bypass4netns can expose the pod's ports on the node by bypassing the socket when bind(2) called, and other pods can connect to the exposed ports.
But, I think this approach is not elegant.
We need to handle all connect(2) calls to rewrite their destination address to node's IP and ports.
Also, this approach consumes many ports on the node and other nodes other than pods can connect to the exposed ports.

I think your multiplexing proxy approach is bettter.
The following procedure will enable the approach for SOCK_STREAM.
When the pod's connect(2) is handled, connecting to the proxy and sending destination information in the handler.
Multiplexing proxy reads the destination information and connects to the destination pod.

But, applying the same approach for SOCK_DGRAM will be difficult.
The multiplexer will cause huge performance degradation.

@AkihiroSuda
Copy link
Member Author

bypass4netns can expose the pod's ports on the node by bypassing the socket when bind(2) called, and other pods can connect to the exposed ports.

Yes, but it might be insecure to directly expose bare pod ports to other nodes, and it is hard to handle port number conflicts across pods

@AkihiroSuda AkihiroSuda removed this from the v0.5.0 milestone Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants