Commands
Run server commands over RCON as Kubernetes resources.
A Command runs one command on a server through RCON, Minecraft’s remote console, and keeps the server’s response. Because they are ordinary resources, commands work with everything that can create Kubernetes objects: kubectl, GitOps tools, CI pipelines or your own automation.
apiVersion: kobblestone.io/v1alpha1kind: Commandmetadata: name: announce-restartspec: targetRef: name: survival command: say Restarting in 5 minutesThe operator connects to RCON itself, so a command does not start any pods. The result shows up in the status:
kubectl get command announce-restart -o jsonpath='{.status.phase}: {.status.response}'status.phase moves from Pending to Completed or Failed. On failure, status.failureReason and status.message say what went wrong. A command runs once. To run it again, delete and re-create it, or create a new one.
Command groups
A CommandGroup runs several commands one after another:
apiVersion: kobblestone.io/v1alpha1kind: CommandGroupmetadata: name: event-setupspec: targetRef: name: survival commands: - command: time set day - command: weather clear - command: say Let the games begin! ignoreFailure: trueIf a command fails, the remaining ones are skipped and the group is Failed, unless that command has ignoreFailure: true. status.commands lists every command with its own status (Completed, Failed or Skipped) and response.
Targets and connectivity
targetRef usually names a Server; the RCON password is then taken from the server’s Secret automatically. A command can also target any Service that exposes RCON, with kind: Service, a port and a passwordSecretRef.
By default, RCON traffic stays inside the cluster (trafficPolicy: Cluster). If the operator can’t reach the target directly, trafficPolicy: External also allows external addresses such as a LoadBalancer IP.
Warning: RCON is unencrypted. Only send it over networks you trust.
Set timeoutMilliseconds to give up on servers that don’t answer. The timeout applies to opening the connection and to running the command separately.
Commands on server events
For commands that should run every time something happens on a server, such as on startup or when the last player leaves, use the server’s spec.autoCommands instead. See RCON on the servers page.