minecraft-gateway discovers game server Services automatically using the discovery section of a NetworkInfrastructure. Discovered services are written into status.backendRefs and become available as backends in your routes.
How discovery works
The NetworkInfrastructureReconciler watches Services, Gateways, and EndpointSlices. When it reconciles, it:
- Determines which namespaces to search based on
discovery.namespaceSelector.
- Lists all Services in those namespaces that match
discovery.labelSelector.
- For each matching Service, selects a port using the priority rules below.
- Writes the result into
status.backendRefs.
Configuring discovery
Namespace scope
Label selector
Any standard Kubernetes label selector. Services must have all required labels to be included.
Port selection
For each discovered Service, the controller selects a port in this priority order:
- A TCP port named
minecraft
- TCP port number
25565
- The first TCP port found on the Service
Services with no TCP ports are excluded.
Labelling your Services
Add the label that matches your discovery.labelSelector to any Service you want the gateway to discover:
Or set it in your Service manifest:
Checking discovered backends
After the controller reconciles, check the NetworkInfrastructure status to see what was discovered:
Using discovered services in routes
Discovered services can be referenced by name in backendRefs:
The controller validates that the referenced service exists in the gateway’s namespace (or the route’s namespace if no namespace is specified).
Dynamic updates
The controller re-reconciles automatically when Services gain or lose the discovery label, when EndpointSlices change (for fallback route fallbackFor resolution), or when a NetworkInfrastructure is updated. There is no need to restart anything after adding a new game server. Last modified on April 19, 2026