Kubectl & GitOps Recipes
Repeatable commands and declarative patterns for inspecting, applying, reconciling, and rolling back Gameplane resources.
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.
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.
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:
- Preview the diff: Run
kubectl diff --server-sideto compare your manifests against the cluster. - Reconcile one scope at a time: Apply to one namespace or region before the full cluster.
- Verify conditions: Use
kubectl getwith custom columns to check readiness before considering the rollout done. - 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
See also
- CRD Catalog — full field descriptions and examples for every core CRD.
- Status, Phases & Conditions — reconciliation state tracking and observedGeneration semantics.
- REST API Reference — HTTP endpoints for automation outside kubectl.
- Helm Values Reference — operator and API configuration for GitOps workflows.