Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelog/unreleased/999-hostname-endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Breaking: LoadBalancer servers show their hostname as their address

After upgrading, every LoadBalancer server that already has
`spec.networking.hostname` set reports that hostname as its address in
`status.endpoints` and the dashboard, in place of the load balancer's IP, once
the load balancer has published one. Check that each such hostname resolves to
its server before upgrading, or clear it on servers where it doesn't; players
would otherwise be shown a name that doesn't reach the server. The assigned
address stays in the new `status.endpoints[].serviceAddress`. Servers without a
hostname, and ClusterIP or NodePort servers, are unchanged. See
[A hostname as the server's address](../../docs/networking.md#a-hostname-as-the-servers-address).
[PR #999](https://github.com/GameplanePanel/Gameplane/pull/999)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: backups.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: backupschedules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: clusters.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: gameservers.gameplane.local
spec:
Expand Down Expand Up @@ -1398,7 +1398,10 @@ spec:
ingress / external-dns annotations on the Service. Must be an
RFC 1123 hostname: dotted labels of 1-63 alphanumeric characters
or hyphens, no leading/trailing hyphen, at most 253 characters
total. The operator does not create the DNS record itself.
total. The operator does not create the DNS record itself. On a
LoadBalancer server, once the load balancer has an address, the
hostname is also the address status.endpoints and the dashboard
report, since it is the name players use.
maxLength: 253
pattern: ^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)(\.[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)*$
type: string
Expand Down Expand Up @@ -2601,6 +2604,9 @@ spec:
associated with a named template port.
properties:
host:
description: |-
Host is the address players connect to: the Service's address, or on
a LoadBalancer server with spec.networking.hostname, that hostname.
type: string
name:
type: string
Expand All @@ -2624,6 +2630,14 @@ spec:
description: Protocol defines network protocols supported for
things like container ports.
type: string
serviceAddress:
description: |-
ServiceAddress is the address the backing Service was assigned (its
load-balancer IP or hostname, or its cluster IP while none is
published), kept apart from Host so an advertised hostname doesn't
hide which address a server holds. Reconciler-owned; empty on tunnel
endpoints and on status written by an operator that predates it.
type: string
tunnelProvider:
description: |-
TunnelProvider is set when this endpoint is served by a tunnel
Expand Down Expand Up @@ -2729,6 +2743,9 @@ spec:
associated with a named template port.
properties:
host:
description: |-
Host is the address players connect to: the Service's address, or on
a LoadBalancer server with spec.networking.hostname, that hostname.
type: string
name:
type: string
Expand All @@ -2752,6 +2769,14 @@ spec:
description: Protocol defines network protocols supported for
things like container ports.
type: string
serviceAddress:
description: |-
ServiceAddress is the address the backing Service was assigned (its
load-balancer IP or hostname, or its cluster IP while none is
published), kept apart from Host so an advertised hostname doesn't
hide which address a server holds. Reconciler-owned; empty on tunnel
endpoints and on status written by an operator that predates it.
type: string
tunnelProvider:
description: |-
TunnelProvider is set when this endpoint is served by a tunnel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: gametemplates.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: modules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: modulesources.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: networkcaptures.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: restores.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: backups.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: backupschedules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: clusters.gameplane.local
spec:
Expand Down
29 changes: 27 additions & 2 deletions charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: gameservers.gameplane.local
spec:
Expand Down Expand Up @@ -1398,7 +1398,10 @@ spec:
ingress / external-dns annotations on the Service. Must be an
RFC 1123 hostname: dotted labels of 1-63 alphanumeric characters
or hyphens, no leading/trailing hyphen, at most 253 characters
total. The operator does not create the DNS record itself.
total. The operator does not create the DNS record itself. On a
LoadBalancer server, once the load balancer has an address, the
hostname is also the address status.endpoints and the dashboard
report, since it is the name players use.
maxLength: 253
pattern: ^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)(\.[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)*$
type: string
Expand Down Expand Up @@ -2601,6 +2604,9 @@ spec:
associated with a named template port.
properties:
host:
description: |-
Host is the address players connect to: the Service's address, or on
a LoadBalancer server with spec.networking.hostname, that hostname.
type: string
name:
type: string
Expand All @@ -2624,6 +2630,14 @@ spec:
description: Protocol defines network protocols supported for
things like container ports.
type: string
serviceAddress:
description: |-
ServiceAddress is the address the backing Service was assigned (its
load-balancer IP or hostname, or its cluster IP while none is
published), kept apart from Host so an advertised hostname doesn't
hide which address a server holds. Reconciler-owned; empty on tunnel
endpoints and on status written by an operator that predates it.
type: string
tunnelProvider:
description: |-
TunnelProvider is set when this endpoint is served by a tunnel
Expand Down Expand Up @@ -2729,6 +2743,9 @@ spec:
associated with a named template port.
properties:
host:
description: |-
Host is the address players connect to: the Service's address, or on
a LoadBalancer server with spec.networking.hostname, that hostname.
type: string
name:
type: string
Expand All @@ -2752,6 +2769,14 @@ spec:
description: Protocol defines network protocols supported for
things like container ports.
type: string
serviceAddress:
description: |-
ServiceAddress is the address the backing Service was assigned (its
load-balancer IP or hostname, or its cluster IP while none is
published), kept apart from Host so an advertised hostname doesn't
hide which address a server holds. Reconciler-owned; empty on tunnel
endpoints and on status written by an operator that predates it.
type: string
tunnelProvider:
description: |-
TunnelProvider is set when this endpoint is served by a tunnel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: gametemplates.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: modules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: modulesources.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: networkcaptures.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: f6d823caf1184485fc5a5cec8ff73668bbf02fbd250b06f24c9139766558b017
gameplane.local/crd-bundle-sha256: b409bc125837ec9256cb4968d3f98a162c9a145dee35b16c22f39498a9892e64
controller-gen.kubebuilder.io/version: v0.22.0
name: restores.gameplane.local
spec:
Expand Down
24 changes: 24 additions & 0 deletions docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,30 @@ For this reason, **changing the pool on a live server should be avoided when pos

The project's e2e test `TestAddressPool_ChangePoolOnRunningServer` verifies that the pool assignment metadata is updated on the GameServer's status; it does not verify whether the actual IP address remains stable or changes, as this is load-balancer dependent. To determine the exact behavior in your deployment, test the address-change scenario against your specific load-balancer version and pool configuration before relying on it in production.

## A Hostname as the Server's Address

Set `spec.networking.hostname` to the DNS name players use. The operator
adds it to the Service as an external-dns hint
(`external-dns.alpha.kubernetes.io/hostname`), and 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, with the Service's
ports. Players then see the name instead of an IP.

The operator doesn't create the DNS record. With external-dns watching
Services, the record is created from the hint and follows the load balancer
if it hands out a new IP. A record you keep yourself must be updated by hand
when that happens, or players reach the old address. A ClusterIP or NodePort
server keeps reporting its own address.

The load balancer's address stays in `status.endpoints[].serviceAddress`, and
address-conflict checks for `spec.networking.address` compare against it, so
a server advertising a hostname still holds its IP.

This applies to every LoadBalancer server with a hostname, including ones
created before the upgrade that introduced it. A hostname that doesn't
resolve to its server would now be shown to players, so before upgrading,
check each such hostname, or clear it where it isn't the name players use.

## Related

- [`install.md`](install.md) — Helm chart values for `operator.addressManager` and cluster prerequisites.
Expand Down
15 changes: 14 additions & 1 deletion operator/api/v1alpha1/gameserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ type GameServerNetworking struct {
// ingress / external-dns annotations on the Service. Must be an
// RFC 1123 hostname: dotted labels of 1-63 alphanumeric characters
// or hyphens, no leading/trailing hyphen, at most 253 characters
// total. The operator does not create the DNS record itself.
// total. The operator does not create the DNS record itself. On a
// LoadBalancer server, once the load balancer has an address, the
// hostname is also the address status.endpoints and the dashboard
// report, since it is the name players use.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)(\.[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?)*$`
// +optional
Expand Down Expand Up @@ -689,8 +692,18 @@ type CaptureStatus struct {
// associated with a named template port.
type GameServerEndpoint struct {
Name string `json:"name"`
// Host is the address players connect to: the Service's address, or on
// a LoadBalancer server with spec.networking.hostname, that hostname.
Host string `json:"host"`
Port int32 `json:"port"`

// ServiceAddress is the address the backing Service was assigned (its
// load-balancer IP or hostname, or its cluster IP while none is
// published), kept apart from Host so an advertised hostname doesn't
// hide which address a server holds. Reconciler-owned; empty on tunnel
// endpoints and on status written by an operator that predates it.
// +optional
ServiceAddress string `json:"serviceAddress,omitempty"`
// +optional
Protocol corev1.Protocol `json:"protocol,omitempty"`

Expand Down
Loading
Loading