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

Support running kg as a peer #16

Open
SerialVelocity opened this issue Aug 27, 2019 · 7 comments
Open

Support running kg as a peer #16

SerialVelocity opened this issue Aug 27, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@SerialVelocity
Copy link
Contributor

Hi Squat!

It would be great if it was possible to run kg as a peer. Basically, I want a process watching kubernetes for updates and auto-updating my wireguard interface with the new routes.

I've hacked it into the codebase here:
master...SerialVelocity:kg-peer
but it isn't complete or very pretty code!

@squat
Copy link
Owner

squat commented Sep 25, 2019

Hm I quite like this idea. This would mean that any time you want a non-k8s-node to join a cluster, the only thing you have to do is run kg, rather than make the interfaces and register routes etc yourself.

I think the one missing piece from your PoC is that the Kubernetes nodes need to be able to discover your local host somehow. To do this, we could have the kg on the host to create a Peer to reflect itself. We’ll also need a way for this peer to reserve an address in the kilo subnet, or otherwise specify its own address in a different subnet. This would need to be an additional flag.

@SerialVelocity
Copy link
Contributor Author

Yes, I added the peer manually for now and just selected the first IP (I didn't even change the /32 subnet!)

@squat
Copy link
Owner

squat commented Sep 27, 2019

Let me know if you’d like to PR it :) I’d be happy to iterate in it afterwards

@SerialVelocity
Copy link
Contributor Author

SerialVelocity commented Sep 27, 2019

Hm I quite like this idea. This would mean that any time you want a non-k8s-node to join a cluster, the only thing you have to do is run kg, rather than make the interfaces and register routes etc yourself.

You do still have to run kube-proxy otherwise you can't resolve service IPs though.

@squat squat added the enhancement New feature or request label Sep 29, 2019
@stv0g
Copy link
Contributor

stv0g commented Jul 15, 2021

You do still have to run kube-proxy otherwise you can't resolve service IPs though.

Maybe just setting a route for the service CIDR towards an in-cluster node/kube-proxy would be sufficient?

@squat
Copy link
Owner

squat commented Jul 15, 2021

Maybe just setting a route for the service CIDR towards an in-cluster node/kube-proxy would be sufficient?

That's very true, this will be sufficient. We can absolutely point the entire service CIDR at a single location leader. In fact, this is the same advice our docs currently give for routing service IPs from VPN peers. It will produce suboptimal routes whenever the pods in a service are scheduled in more than one location, however this might be a reasonable first iteration.

@SerialVelocity
Copy link
Contributor Author

Yeah, that didn't work for me because when that node reboots/crashes/becomes unstable, you lose connectivity. kube-proxy is super easy to run though so it wasn't really an issue.

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

3 participants