All work

Platform and reliability

Running Kubernetes on OpenShift for CubeCraft

Running the multi-node OpenShift clusters CubeCraft and Rocket run on, from GitOps, storage and secrets to tested paging rules and operator forks in Go.

Ziax · CubeCraft and Rocket · 2022 – present

The problem

A game network has to be up whenever players are online, and with servers in multiple regions that’s nearly always. Rocket’s services, the data pipelines and a lot of the game run on Kubernetes, so the platform underneath just has to work.

What I do

  1. Git commitHelm and Kustomize
  2. Argo CDdiff and sync
  3. OpenShiftworkloads roll out
  4. Prometheusscrape and evaluate
  5. Grafanapage on-call
Every change to the clusters goes through git.

A paging rule that needs two witnesses

External probes page us when a tenant’s endpoint is down from outside. But one cluster’s own network trouble shouldn’t wake anyone, so the rule needs two or more probing clusters to agree.

A sketch of the idea, not the production code.

alert TenantEndpointDown
  if count by (target) (probe_success{source_cluster=~".+"} == 0) >= 2
  for 5m

# and it ships with a rule test
test "one cluster's bad network doesn't page":
  given probe_success{target="a", source_cluster="c1"} = 0
        probe_success{target="a", source_cluster="c2"} = 1
  expect no alerts

A fix in the Spark operator fork

Scheduled Spark jobs were being validated by the wrong webhook handler: the kubebuilder marker for ScheduledSparkApplication pointed at the SparkApplication path. The controller’s RBAC marker was also missing update, patch, list and watch on Services. I pointed the marker at the right path, widened the RBAC, and regenerated the webhook and RBAC manifests from the markers.

Why it matters

Most of the job is making sure game developers can ship and data engineers can schedule jobs without thinking about the clusters at all.

Stack