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
6 changes: 3 additions & 3 deletions charts/grounds-geyser/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ metadata:
data:
config.yml: |
bedrock:
# 0.0.0.0, not the pod IP: with a hostPort the kubelet forwards from the
# node's address into the pod, so binding anything narrower means the
# forwarded packets arrive at a socket nothing is listening on.
# 0.0.0.0, not the pod IP: packets arrive translated by the Service that
# fronts this port, so binding anything narrower means they land on a
# socket nothing is listening on.
address: 0.0.0.0
port: {{ .Values.bedrock.port }}
# The port advertised to the client in the pong is this one, not the
Expand Down
21 changes: 14 additions & 7 deletions charts/grounds-geyser/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{/* The hostPort is exclusive, so the old pod on a node has to be gone before
its replacement can bind. RollingUpdate on a DaemonSet already deletes
before it creates, one node at a time — a Bedrock player on that node
reconnects, players on the others never notice. */}}
{{/* One node at a time: a Bedrock player on that node reconnects, players on
the others never notice. RakNet sessions are per-process, so a pod
replacement always drops the sessions it was holding. */}}
updateStrategy:
type: RollingUpdate
rollingUpdate:
Expand Down Expand Up @@ -73,12 +72,20 @@ spec:
- name: geyser
image: "{{ $imageRepo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{/* No hostPort. It is what a Bedrock client needs — 19132 is outside
the NodePort range, so a Service cannot serve it the ordinary way
— but binding it here costs the whole namespace its PodSecurity
level: baseline forbids hostPort, so allowing one means enforcing
`privileged` for everything alongside.

The region's Pulumi stack owns a Service with `externalIPs` set to
the node addresses instead. Cilium runs with kube-proxy
replacement and programs those, so UDP 19132 on any node address
reaches these pods without the pod claiming a port on the host —
and the namespace stays at baseline. */}}
ports:
- name: bedrock
containerPort: {{ .Values.bedrock.port }}
{{- if .Values.bedrock.hostPort }}
hostPort: {{ .Values.bedrock.port }}
{{- end }}
protocol: UDP
{{- with .Values.resources }}
resources:
Expand Down
23 changes: 13 additions & 10 deletions charts/grounds-geyser/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,20 @@ image:
# belongs on the environment whose users are the team, not the one whose users
# are players.
bedrock:
port: 19132
# Bound on the node, not behind a Service: a Bedrock client speaks RakNet
# over UDP and the address it dials is the only routing key that exists
# before the session is up — there is no handshake hostname for anything to
# route on, the way mc-router does for Java. So the player has to reach the
# node directly.
# A Bedrock client speaks RakNet over UDP, and the address it dials is the
# only routing key that exists before the session is up — there is no
# handshake hostname for anything to route on, the way mc-router does for
# Java. So the player has to reach a node address directly, on this port.
#
# Reaching it is NOT this chart's job. 19132 sits outside the NodePort range,
# so an ordinary Service cannot serve it, and a hostPort would cost the whole
# namespace its PodSecurity level — baseline forbids hostPort, so one pod
# binding it means enforcing `privileged` for everything alongside.
#
# `hostPort` and not `hostNetwork`: the pod keeps its own network namespace,
# so nothing else on the node is exposed, and the remote address below can
# still be a cluster DNS name.
hostPort: true
# The region's Pulumi stack owns a Service with `externalIPs` set to the node
# addresses. Cilium programs those, so this port reaches the pods without any
# of them claiming a port on the host.
port: 19132
# What the Bedrock server list shows before the player connects. Geyser
# answers these locally — the ping never reaches Velocity.
motd1: "Grounds"
Expand Down