gameplane / docs
OPERATIONS RECIPES

Kubectl & GitOps Recipes

Repeatable commands and declarative patterns for inspecting, applying, reconciling, and rolling back Gameplane resources.

API & Referencev0.210 MIN
Treat status as controller output

Commit desired state, then wait for observedGeneration before declaring a rollout complete.

Apply and inspect with kubectl

Use server-side apply for CRDs, query conditions directly, and keep credentials in referenced Secrets rather than manifests.

Applykubectl apply --server-side -f gameserver.yaml
Watchkubectl get gameservers -w
Inspectkubectl describe gameserver <name>

Server-side apply automatically resolves field ownership when multiple actors (Helm, Kustomize, controllers) modify the same resource, eliminating apply conflicts. Always use --server-side for Gameplane CRDs to avoid edge cases with operator-managed fields.

GitOps reconciliation patterns

Separate platform resources from tenant workloads, pin modules by digest, and order Secrets before resources that reference them.

Sync wavesUse sync waves for CRDs, controllers, Secrets, then custom resources
Drift detectionIgnore controller-owned status fields in drift detection
Module digestsPromote the same immutable module digest between environments

Apply infrastructure and CRDs first (wave: 0), then platform Secrets (wave: 1), then GameServers and Modules (wave: 2). This ordering prevents GameServers from blocking on missing ConfigMaps or credential Secrets. Status fields like .status.phase and .status.conditions are never desired state — configure your GitOps tool to exclude them from drift detection.

Safe rollout and rollback

Preview diffs, reconcile one scope at a time, verify conditions, and revert the Git commit or chart version when health gates fail.

Before applying a change to production:

  1. Preview the diff: Run kubectl diff --server-side to compare your manifests against the cluster.
  2. Reconcile one scope at a time: Apply to one namespace or region before the full cluster.
  3. Verify conditions: Use kubectl get with custom columns to check readiness before considering the rollout done.
  4. Revert on health failures: If conditions indicate failure, revert the Git commit (or Helm chart version) immediately; the controller will reconcile to the previous desired state.

QUICK REFERENCE

01   kubectl wait --for=condition=Ready gameserver/<name> --timeout=5m
02   kubectl get backups -o custom-columns=NAME:.metadata.name,PHASE:.status.phase
03   kubectl diff --server-side -f ./environments/production

See also