minekube / gate

High-Performance, Low-Memory, Lightweight, Extensible Minecraft Reverse Proxy with Excellent Multi-Protocol Version Support - Velocity/Bungee Replacement - Ready for dev and large deploy!
https://gate.minekube.com
Apache License 2.0
630 stars 54 forks source link

feat: Kubernetes service discovery #187

Open clrxbl opened 1 year ago

clrxbl commented 1 year ago

Surprising to see that this has not been implemented or mentioned anywhere yet (unless I'm blind) considering this project is all about being cloud-native.

https://github.com/itzg/mc-router#kubernetes-usage is a great example for forced hosts, but it'd be nice to expand this to Pod support aswell.

robinbraemer commented 1 year ago

Kubernetes's KRM can be a good configuration source for the Gate Lite mode. Currently, Gate Lite only sources its configuration from the local configuration file.

To add this feature we can make use of the existing live config reload feature and a k8s adapter to update Gate config file to sync with Kubernetes resources.

I'll consider this feature request when I see more demand for it.

Bloeckchengrafik commented 5 months ago

To anyone who wants to implement this: I've just built something similar for one of my projects:

everbuild-org/prismcloud#images/ingress-gate/gate/plugin/service_discovery

robinbraemer commented 5 months ago

@Bloeckchengrafik you should post your tool in https://discord.com/channels/633708750032863232/1042460518595690526 and add it to https://github.com/minekube/awesome

Bloeckchengrafik commented 5 months ago

Thanks a lot for the suggestion! I'll do that when it becomes somewhat production ready!