Skip to main content

Gojira 🦖

An opinionated deploy platform for GKE. It tramples your hand-rolled YAML.

Connect a GitHub repo, pick a cluster and a workload class, and Gojira provisions everything needed to ship: service account, Workload Identity Federation, Artifact Registry access, GitHub Actions workflows, Kustomize manifests, and observability wiring. Merge the setup PR — after that, push-to-deploy just works.

Then Gojira keeps working. It watches your clusters for drift and captures operators' live fixes back into git as PRs. It ingests real usage evidence and opens rightsizing PRs with the measurements in the justification. Merge one, and your pods change shape.

Status: working, and aggressively dogfooded. Gojira deploys itself, caught its own drift, and rightsized its own demo app from 750m/768Mi down to a measured 50m/64Mi — live, on a real GKE Autopilot cluster. Every finding from that dogfooding is fixed in this repo, each documented in the commit that tells its story (git log -i --grep=dogfood --grep=finding).

Why

Every team deploying to Kubernetes hand-rolls the same things: CI workflows, manifests, resource specs, auth plumbing. The results are inconsistent, over-provisioned, and expensive to change org-wide. Gojira makes those decisions for you — visibly, with an escape hatch for justified overrides.

Every opinion is a default with an override: sizing through overrides.requests/limits, scaling bounds and targets through overrides.hpa (min, max, cpu, memory percent), the listener and health path through port: and health:. All justified, all in gojira.yaml.

Three opinions define it:

  1. The platform decides sizing. Workload classes (web, worker, cron, heavy, gpu) map to burstable resource specs — and a feedback loop refines them against measured production behavior, not guesses copied from a blog post.
  2. No ArgoCD. Deploys are git → Actions → kubectl apply. Operational fixes flow the other way: cluster → drift detector → PR. Nothing silently reverts an operator's work.
  3. Observable from the first deploy. Prometheus wiring is generated, not optional.

The three loops

 DEPLOY    repo ──▶ setup PR ──▶ merge ──▶ CI (keyless WIF) ──▶ cluster
 CAPTURE   cluster drift ──▶ semantic diff ──▶ capture PR ──▶ git catches up
 RIGHTSIZE usage evidence ──▶ recommendation ──▶ one reviewed PR ──▶ pods resize

Deploy — the provisioner is an idempotent, resumable step engine: every GCP resource it creates is ledgered, re-runs skip what exists, failures resume exactly where they stopped, and re-onboarding an already-configured repo concludes cleanly instead of churning. CI authenticates via Workload Identity Federation — no long-lived keys anywhere. Promotion: merge → dev, tag → qa, prod behind a manual approval gate.

Capture — a central scanner diffs each app's live cluster state against kustomize build, comparing only the fields Gojira manages (an allowlist projection — API-server defaults, image tags, and HPA-owned replicas can't produce false positives). Real drift becomes a capture PR that writes the live values into the overlay: the cluster is authoritative during operations, and git catches up through review. It caught GKE Autopilot silently rewriting resources on its first real scan.

Rightsize — agents (or anything else) POST distilled usage evidence to /api/v1/usage with a cluster-scoped token. A transparent percentile rule (request ← p95, limit ← max(p99 × 1.5, request)) turns evidence into a recommendation — guarded by a materiality threshold and a hard rule against memory downsizing when the app has OOM kills. One click opens one reviewed PR carrying the contract (gojira.yaml overrides + justification), the manifest, and the retirement of any drift patch it supersedes. Merge it and the next CI run deploys the new size.

The workload classes

Class Requests Limits HPA Probes
web 250m / 256Mi 500m / 512Mi 70% CPU, 2–10 readiness + liveness HTTP /health
worker 500m / 512Mi 1 / 1Gi — liveness TCP
agent 250m / 512Mi 1 / 1Gi — (Recreate, single consumer) liveness TCP
gateway 250m / 256Mi 500m / 512Mi — (Recreate, single replica) readiness + liveness HTTP /healthz
cron 250m / 256Mi 1 / 1Gi — —
heavy 1 / 1Gi 2 / 2Gi 70% CPU, 2–6 readiness + liveness
gpu 1 / 4Gi + 1 GPU 2 / 8Gi + 1 GPU — liveness

Burstable QoS by default (requests < limits): Guaranteed QoS at low utilization wastes nodes. Ephemeral storage always explicit. Overrides live in gojira.yaml and require a justification — and once the rightsizing loop has measured your app, Gojira writes that justification for you. All opinions live in gojira/opinions/ — visible, documented, overridable. That's the point of the tool.

By default an app serves HTTP on 8080 with /health and /metrics, so probes and scrape configs need zero per-app configuration. An app that listens elsewhere or answers /alive says so in gojira.yaml (port:, health:), and adopt mode reads both from the deployment it already runs: nothing about an app's SDK or runtime decides whether Gojira can host it.

Quickstart

Prereqs: a GCP project you can create resources in, a GKE cluster, gcloud (authed, with gke-gcloud-auth-plugin), kubectl, openssl, Python 3.11+, and the gh CLI (authed) for laptop mode. ./scripts/preflight.sh checks all of it, plus the cluster, in seconds.

Laptop mode (~5 minutes)

Runs Gojira locally against your own gh and gcloud sessions — no GitHub App required:

git clone https://github.com/tenishai/gojira && cd gojira
uv sync --locked                        # the pinned dependency set, into .venv
uv run python -m gojira.web            # UI on http://localhost:8080

Then in the UI: Clusters → register your GKE cluster (registration probes connectivity before accepting) → Connect repo → pick a repo with a Dockerfile at its root (or a gojira.yaml whose image: names a published image), choose a class and environments → merge the setup PR it opens → push to main. Your app deploys.

Production-shaped sandbox (~20 minutes)

Runs Gojira in-cluster under Workload Identity with a GitHub App — the way you'd run it for a team. One values file, one command each way:

cp gojira.env.example gojira.env       # project, App id, pem path, GOJIRA_TERRAFORM=1
make install                           # cluster, identity, image, secrets, manifests, rollout
make uninstall                         # all of it gone again, and checked

Every optional knob — front door hostname and IAP members, Gojira's own allowlist, namespace labels, the sizing agent image, the noto observe image and clusters — lives in gojira.env too; nothing under deploy/ is edited by hand, and rerunning make install applies changes.

The full walkthrough — GitHub App setup, connecting a demo app, exercising drift capture — is in docs/install.md. make uninstall removes it again, apps first and cluster last, and fails if anything of Gojira's is still in the project. Rebuilding from nothing is the same command; the platform's state that matters lives in your repos, and survives.

Existing cluster (brownfield)

Already have a cluster? Leave GOJIRA_TERRAFORM empty and let scripts/prepare-project.sh run instead — it grants the same platform identity (APIs, GSA, roles, AR, Workload Identity) into your existing project, then bootstrap.sh proceeds unchanged with CLUSTER pointed at your cluster:

# in gojira.env: CLUSTER=<your-cluster>  GOJIRA_PREPARE_PROJECT=1
make install

make uninstall there removes Gojira and its identity, and leaves your cluster alone.

Feeding the rightsizing loop

Evidence is one JSON document per app/env/window — Kubernetes quantity strings, distilled percentiles, and distress signals:

curl -X POST http://<gojira>/api/v1/usage \
  -H "Authorization: Bearer $CLUSTER_TOKEN" \
  -d @usage_profile.json

See tests/fixtures/usage_profile.json for the exact contract. Anything that can compute a p95 can feed the loop. Our own producer, gojira-sizing-agent, is a separate repo that isn't published yet; Gojira deploys it from the Clusters page ("Deploy agent": mints the cluster token, applies RBAC + CronJob, grants metrics access, runs a first sweep) when sizing.agent_image names a build of it. Without one, that button stays off and everything else works.

The ledger reads back the same way, per environment, with the recommender's live call alongside — so a second evidence producer can diff itself against what the loop saw and what it decided:

curl http://<gojira>/api/v1/apps/<id>/usage?env=dev&since_days=30 \
  -H "Authorization: Bearer $GOJIRA_API_TOKEN"   # the platform token, not a cluster's

What's built, what's next

✅ Connect: provisioner, generator, setup PRs, keyless CI, promotion proven live
✅ Capture: drift detection, capture PRs, central scheduler proven live
✅ Rightsize: evidence API, recommender, one-PR resizing proven live
✅ In-cluster usage agent (GMP/Prometheus → evidence, per cluster) proven live
✅ One-button agent deploy + token rotation (Clusters page) proven live
🔜 Public webhook ingress (auto PR-merge detection, regenerate-on-change) buttons today
✅ Adopt: zero-touch onboarding infers app needs from existing manifests new
🔜 Guard: Kyverno admission policies designed

Stack

Python · FastAPI · SQLAlchemy (SQLite default, Postgres supported) · Jinja2 + htmx · GitHub App · GCP (gcloud/kubectl, Workload Identity in-cluster) · a test suite with golden-file snapshots for everything generated.

Docs

Design · Install walkthrough · GitHub App setup · Environments · Sizing loop design

How this was built

tenishai is a small team of engineers who build with AI coding agents. Most of this code was written in pairing sessions with Claude models in Claude Code: a person set the design, directed the work and reviewed what landed, and the agent wrote much of the code and docs. Many commits name the agent in a Co-Authored-By: trailer, either a Claude model or Poe (earlier Raven), the name of the agent one of us pairs with. A commit without a trailer may still have had AI help.

In this repo, "Ember (SRE AI)" in docs and pull requests is the agent Shaz pairs with. Its commits name the Claude model in the trailer, not Ember.

License

AGPL-3.0-or-later

Copyright (C) 2026 tenish and the gojira contributors

Metadata

Release files for tenish-gojira 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tenish-gojira 1.3.1
File Size Uploaded Provenance Actions
tenish_gojira-1.3.1.tar.gz 249.5 kB Without provenance Details for tenish_gojira-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tenish-gojira 1.3.1
File Interpreter ABI Platform Actions
tenish_gojira-1.3.1-py3-none-any.whl Python 3 none any Details for tenish_gojira-1.3.1-py3-none-any.whl

Total release size: 412.3 kB

Release files / tenish_gojira-1.3.1.tar.gz

Download URL tenish_gojira-1.3.1.tar.gz
Size 249.5 kB
Tags Source
SHA-256 checksum
How to use checksums
48d84de9d214f32d55c51ae58c265e8b7a8e1358f10b49f55835354e0180f361
BLAKE2b-256 checksum
How to use checksums
0f1d14b6b228acdb42250acf1a67b7ace3ea60da2c36a89f556cf02c08fd63ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / tenish_gojira-1.3.1-py3-none-any.whl

Download URL tenish_gojira-1.3.1-py3-none-any.whl
Size 162.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae15b12c0c9d193d6367cc574bc3f88c491ef593b8521d5d73a98d6b54dc495b
BLAKE2b-256 checksum
How to use checksums
51ed0cd5426584b5a3534d5286b99708cbfbdb50d19841680706f7a35aa38f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for tenish-gojira 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page