gameplane / docs
CONFIGURE

Network & Automation

Expose game ports intentionally, restrict source networks, and automate recurring maintenance with schedules and health-aware recovery.

Network & Automationv0.412 MIN
Public exposure is a security boundary

Review service type, ports, annotations, DNS, and CIDRs together.

Choose an exposure model

Select ClusterIP, NodePort, or LoadBalancer based on where players connect and who controls the network edge. When you have no public IP or no control over the network edge, layer a relay tunnel over the Service.

ClusterIPUse ClusterIP for internal-only servers and proxies.
NodePortUse stable named ports and reserve NodePorts to avoid collisions.
LoadBalancerAttach provider annotations and DNS only when the controller supports them.

Service Types Overview

  • ClusterIP: Internal-only access within the cluster. Ideal for internal game servers, proxies, or testing.
  • NodePort: Exposes the service on a static port on every node. Suitable for on-premises clusters or when you manage your own load balancing.
  • LoadBalancer: Integrates with your cloud provider’s load balancer (or on-premises equivalent like MetalLB/Cilium). Requests a public or routable address, optionally from a named address pool.
  • Relay tunnels (frp, Tailscale, playit): Not an exposure mode but a layer over the Service that routes player connections through an external relay when you lack a public IP, port-forwarding, or a LoadBalancer. See Server Networking & Tunnels for setup and provider comparison.

Restrict and verify connectivity

Treat every port override and CIDR allow-list as part of the server’s documented interface.

PortsExpose only required TCP or UDP ports from the selected module.
ValidateValidate hostname, external address, and firewall path end to end.
ManagementKeep management interfaces private even when game ports are public.

Port and CIDR Configuration

Game servers expose ports via the Kubernetes Service created for each GameServer. You control which ports to expose (and their protocols) through the GameTemplate:

  • Port overrides: specify TCP and UDP ports that should be publicly accessible.
  • Source ranges (CIDRs): restrict access by IP allow-lists. When using LoadBalancer, set spec.networking.sourceRanges to CIDR blocks (e.g., ["203.0.113.0/24"]). This maps to Kubernetes service.spec.loadBalancerSourceRanges.

Important: sourceRanges only take effect when expose mode is LoadBalancer. ClusterIP and NodePort servers do not filter by source CIDR at the Kubernetes level (use firewall rules instead for those modes).

Kubelet probes (v0.4.0): each GameServer gets a <server>-probes NetworkPolicy that admits the kubelet CIDRs only to the ports its own liveness, readiness and startup probes use. This is on by default (networkPolicies.probeIngress.enabled: true). Ports you list in networkPolicies.probePorts are added to that allowance. Setting networkPolicies.probeIngress.enabled: false restores the older rule, which admits the kubelet to every game port, RCON included. Upgrading from an earlier release therefore changes what the kubelet can reach; check your module’s probe ports before upgrading.

Address Pools (LoadBalancer Only)

When expose mode is LoadBalancer, optionally request a specific address pool or IP address:

  • spec.networking.addressPool: name of a load-balancer address pool (e.g., "public-servers" for MetalLB or Cilium).
  • spec.networking.address: specific IP address (e.g., "203.0.113.50").

The operator translates these to your load-balancer flavor’s annotations or labels. See the Ingress, TLS & External Access guide for full details.

A hostname as the server’s address (v0.4.2)

Set spec.networking.hostname to the DNS name players use. The operator adds it to the Service as an external-dns hint. On a LoadBalancer server, once the load balancer has published an address, status.endpoints and the dashboard report the hostname in place of that address. A ClusterIP server keeps reporting its cluster address.

The operator does not create the DNS record. With external-dns watching Services, the record is created from the hint and follows the load balancer if it gets a new IP. A record you manage yourself must be updated by hand when that happens, or players reach the old address. The load balancer’s address stays in status.endpoints[].serviceAddress, and address-conflict checks for spec.networking.address still compare against it.

This applies to every LoadBalancer server with a hostname, including servers created before the upgrade that introduced it. Before upgrading, check that each such hostname resolves to its server, or clear it where it is not the name players use.

Choosing a load-balancer implementation (v0.4.2)

A cluster can run more than one load-balancer implementation, each handling Services of its own class. Set spec.networking.loadBalancerClass on a LoadBalancer server to pick one; it becomes the Service’s spec.loadBalancerClass. When the field is unset, the operator does not manage the class. A new Service has none, so the cluster’s default implementation handles it, and an existing Service keeps any class something else gave it.

Kubernetes does not allow changing a Service’s class, or adding one to a LoadBalancer Service that has none. So when the field is set or changes, the operator deletes the Service and creates it again with the new class. The server keeps running, but its Service gets a new cluster IP and usually a new external address, so players reconnect. Removing the field leaves the class as it is until the Service is next replaced.

The class is a Kubernetes qualified name, such as example.com/games, and the part after the slash is at most 63 characters. The dashboard does not edit the class, and keeps it when you save other networking settings, so set it through the API or kubectl. Leave addressPool and address unset when the class belongs to another implementation, because the address manager does not control that Service.

Port pools (v0.4.2)

Some installs reach every game server through one public address, such as a relay or edge that forwards a range of ports to the cluster’s load balancer. Most games send no hostname, so behind one address each server needs ports of its own. A port pool hands them out. Name the pool for its endpoint, and list the templates whose servers draw from it with the Helm value operator.portPools:

operator:
  portPools:
    - name: edge
      ports: "2456-2499"
      templates: [valheim, factorio]

Each server of those templates gets a contiguous block of the pool, one port per advertised port, in template order. A port goes to one server whatever its template, and ports are reserved per protocol, so TCP 2456 and UDP 2456 are two ports. A template draws from at most one pool. The operator records each server’s ports in the gameplane.local/pool-ports annotation and keeps them for the server’s life, so saved addresses keep working. The PortAllocation condition lists them, and relays (frp, Tailscale, Playit) forward to those ports too.

When no block is free, a new server reports PoolExhausted and gets no Service or address until a block frees up. A server that already has ports keeps them. When you shrink a pool, existing servers keep their ports, even ones outside the new range, and report AllocatedOutsideRange. Keep forwarding those ports until you move those servers, and forward the whole range at the relay or edge to the cluster’s load balancer.

Connecting to a NodePort server (v0.4.2)

The dashboard’s External Address shows and copies the game host and the NodePort Kubernetes assigned, for example play.example.net:31042. Set Settings → Networking → Hostname (spec.networking.hostname) to a name that players can resolve and reach on that port. With no hostname, Gameplane uses a Kubernetes ExternalIP on the node serving the game or its wake proxy. IPv6 addresses appear in brackets, as in [2001:db8::42]:31042.

If no external IP is available, set the game hostname to publish an address. On a cluster behind a router, point that name at the router and forward the advertised NodePort. If the router exposes a different public port, players need that port from the router configuration.

Automate routine operations

Schedules can run backups and maintenance while probes and restart policy handle unexpected failures.

A BackupSchedule CRD runs backups on a recurring cron schedule. Each scheduled backup job:

  1. Saves the server state (config, world data, player data).
  2. Stores it at the destination (S3, NAS, local cluster storage).
  3. Applies retention policy (delete old backups).
  4. Records the operation in the audit log.

Liveness probes and restart policy: GameServers also support Kubernetes-native readiness and liveness probes defined in the template. If a server fails its liveness probe, the kubelet restarts the failing container in place (the pod itself is not recreated). Combined with scheduled backups, this provides automatic recovery from transient failures.

AUTOMATION CHECK
01   Validate cron timezone, target server, destination, and retention
02   Announce maintenance and save before a planned restart
03   Confirm the job, resulting backup, and audit entry completed

Next guide: Backups and recovery