Self-hosted clone of https://github.com/openova-io/openova (post-cutover, standalone)
Go to file
hatiyildiz a37eb22efa feat(controllers): land environment-controller (slice C2, #1095)
Implements slice C2 of EPIC-0 #1095 — the environment-controller Go
binary. Watches Environment.catalyst.openova.io/v1 CRs (cluster-scoped)
and reconciles each Environment to:

1. Verify the per-Org Gitea Org exists (parent Organization gate).
   Missing org surfaces GiteaOrgReady=False + Pending phase, never
   panics or crashloops.

2. Track the canonical branch name for this Environment in
   status.giteaRepoRef.{org,branch} per NAMING-CONVENTION.md §11.2
   item 1 (develop/staging/main ↔ dev/stg/prod; uat/poc map to their
   own branch name).

3. Idempotently write per-vCluster Flux GitRepository manifests into
   the Org's Gitea repo at the canonical path
   `clusters/<host-cluster>/environments/<env-name>/gitrepository.yaml`
   per NAMING §11.2 item 3. Multi-region Environments fan out one
   commit per spec.regions[]. Identical bytes short-circuit (zero
   spurious commits in repo history); drift triggers an overwrite
   with the existing blob SHA.

4. Surface the canonical JetStream subject prefix
   `ws.{organizationRef}-{envType}.>` on
   status.jetstreamSubjectPrefix per NAMING §11.2 item 4 +
   ARCHITECTURE.md §5. Per-Environment NATS Stream CR creation is
   OUT OF SCOPE here — NACK isn't installed yet (future slice).

5. Set status.phase, status.regionCount (printer column),
   status.vclusters[], status.observedGeneration, and the
   Ready/GiteaOrgReady/GitRepositoryWritten conditions.

Architecture rules honored (per docs/INVIOLABLE-PRINCIPLES.md +
docs/adr/0001-catalyst-control-plane-architecture.md):

- Flux is the only reconciler in production. The controller writes
  manifests to Gitea; Flux applies them. NO kubectl apply, NO
  helm install, NO exec.Command in the codebase.
- Crossplane is cloud-only. This controller is K8s-to-K8s native
  via controller-runtime + client-go.
- DR is a Placement, not an Env Type. The controller treats
  spec.envType as the schema-validated enum {prod|stg|uat|dev|poc}
  with no special-case for DR (per NAMING §11.1).
- Sovereign-independent. The Gitea base URL, secret ref, branch
  suffix, commit author, and Flux interval are ALL runtime config
  (per Inviolable Principle #4 — never hardcode).

Files:
- core/controllers/environment/api/v1/types.go — Environment
  Go types matching the CRD; hand-written DeepCopy to avoid
  build-time codegen tool dependency.
- core/controllers/environment/internal/gitea/client.go — minimal
  GitHub-compatible REST client targeting Gitea's /api/v1
  (GET /orgs/{org}, GET/POST/PUT /repos/{org}/{repo}/contents/{path}).
  Idempotent UpsertFile with byte-equality short-circuit + blob-SHA
  conflict refusal.
- core/controllers/environment/internal/gitops/render.go — pure
  template rendering of the Flux GitRepository CR. Deterministic
  field ordering for byte-equality idempotency.
- core/controllers/environment/internal/controller/environment_controller.go
  — reconciler: validate spec, gate on Gitea Org, fan out per-region
  manifest writes, set status + conditions.
- core/controllers/environment/cmd/main.go — controller-runtime
  manager entry point with leader election.
- core/controllers/environment/Containerfile — two-stage build,
  alpine:3.20 runtime, non-root UID 65534, ENTRYPOINT.
- core/controllers/environment/deploy/rbac.yaml — ClusterRole
  watching Environments + status subresource + leader election lease.
- .github/workflows/build-environment-controller.yaml — CI mirrors
  build-cert-manager-dynadot-webhook.yaml: vet + race tests,
  docker buildx + cosign keyless sign + SBOM attest, push to
  ghcr.io/openova-io/openova/environment-controller.

Tests (35 total, all GREEN, race-detector enabled):

- internal/controller (T1–T11):
  T1 happy-path single-region reconcile
  T2 idempotent re-reconcile (zero spurious commits)
  T3 parent Org missing → Pending + GiteaOrgReady=False (no panic)
  T4 multi-region fan-out (3 commits, 3 regions)
  T5 drift detection — operator hand-edit gets overwritten
  T6 placement-vs-regions cardinality violations → Failed
  T7 env_type→branch mapping table
  T8 Gitea repo missing → Pending + GiteaRepoMissing reason
  T9 partial-failure one region → Degraded with that region Failed
  T10 Config.Defaults applies the documented defaults
  T11 NotFound between dequeue and Get is benign

- internal/gitea: GET /orgs OK + 404 + 500; UpsertFile create / idempotent /
  update with SHA / repo-not-found; pathEscape preserves slashes;
  arg-validation.

- internal/gitops: BranchForEnvType / JetStreamSubjectPrefix /
  HostClusterName (with override) / GitRepositoryPath /
  RenderGitRepository (deterministic + complete + anonymous +
  default interval + required-field validation) / EnvironmentName.

go vet ./... clean. go test -count=1 -race ./... GREEN.

Out of scope per slice brief: organization-controller (C1),
blueprint-controller (C3), application-controller (C4),
useraccess-controller (C5), catalyst-api codebase changes, NACK
install, per-Environment NATS Stream CRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 21:59:50 +02:00
.claude docs(iter-1): add IMPLEMENTATION-STATUS, fix wrong-org refs, reconcile monorepo 2026-04-27 20:43:31 +02:00
.github feat(controllers): land environment-controller (slice C2, #1095) 2026-05-08 21:59:50 +02:00
.playwright-mcp feat(wizard): job dependencies SVG DAG + (stretch) timeline view (closes #206) (#212) 2026-04-29 21:40:43 +02:00
clusters fix(provisioner): map wizard's three-mode domain selector to tofu's binary pool/byo enum (#1069) 2026-05-07 11:26:50 +04:00
core feat(controllers): land environment-controller (slice C2, #1095) 2026-05-08 21:59:50 +02:00
docs docs: flip 8 CRDs to 🚧 + amend ProvisioningState decision (slices A2+A3, #1095) (#1113) 2026-05-08 22:27:04 +04:00
infra/hetzner fix(infra/hetzner): strip any-indent comments, gate user_data ≤ 30 KiB at plan-time (#966) (#967) 2026-05-05 17:58:44 +04:00
platform feat(bp-opentelemetry-operator): scaffold operator + default Instrumentation CR (slice H5, #1095) (#1121) 2026-05-08 23:06:29 +04:00
products deploy: update catalyst images to a9bef76 2026-05-08 19:40:48 +00:00
scripts chore(bootstrap-kit): remove slot 95 bp-stalwart-sovereign (Phase-2 deferred) (#958) 2026-05-05 15:55:30 +04:00
tests fix(bp-newapi+services-build): imagePullSecrets on Pod, sed bumps values.yaml smeTag (#955) 2026-05-05 15:47:37 +04:00
.gitignore fix(bp-seaweedfs): vendor upstream chart, drop fromToml-using template (#340) (#504) 2026-05-02 01:20:59 +04:00
CLAUDE.md docs(component-count): update 53 → 56 anchors after Pass 105 (spire + nats-jetstream + sealed-secrets) 2026-04-28 13:48:24 +02:00
README.md docs(reconcile-pass-2): align docs with ground truth at 6afdb303 2026-04-29 11:48:57 +02:00

OpenOva Catalyst

A self-sufficient Kubernetes-native platform. Published as signed OCI Blueprints. Deployable as your own Sovereign.

Catalyst is the open-source platform built by OpenOva. It turns any Kubernetes cluster into a Sovereign: a self-contained control plane that hosts Organizations, Environments, and Applications via GitOps + Crossplane, with a unified UI/Git/API for users.


Documentation

Document What it covers
docs/GLOSSARY.md Canonical terminology — read first
docs/ARCHITECTURE.md Catalyst architecture overview
docs/IMPLEMENTATION-STATUS.md What's built today vs what's design-only — read second
docs/NAMING-CONVENTION.md Naming patterns for every resource type
docs/PERSONAS-AND-JOURNEYS.md Personas × journeys matrix; surfaces
docs/SECURITY.md Identity (SPIFFE + Keycloak), secrets (OpenBao + ESO), rotation, multi-region semantics
docs/SOVEREIGN-PROVISIONING.md How to bring a Sovereign online
docs/BLUEPRINT-AUTHORING.md Writing Blueprints (incl. Crossplane Compositions)
docs/PLATFORM-TECH-STACK.md Every component's role in Catalyst
docs/SRE.md Operating a Sovereign
docs/BUSINESS-STRATEGY.md Product strategy and GTM
docs/TECHNOLOGY-FORECAST-2027-2030.md Component forecast 20272030
docs/VALIDATION-LOG.md Trail of doc-integrity validation passes (audit log)

Heads-up before reading further: the architecture docs in this repo describe Catalyst's target state. Significant portions are not yet implemented — see docs/IMPLEMENTATION-STATUS.md for what exists today vs what is design.


The model in 60 seconds

OpenOva (the company) publishes Catalyst (the platform).
A deployed Catalyst is called a Sovereign.

A Sovereign has:
  - Organizations (multi-tenancy unit)
  - Environments (org-scoped, env-typed: prod/stg/uat/dev/poc)
  - Applications (installed Blueprints)
  - Blueprints (the App Store catalog — public + Org-private)

Users install Applications from Blueprints into Environments.
Blueprints can depend on Blueprints (arbitrary depth).
Each Environment is one Gitea repo + one or more vclusters.
Every state change is a Git commit.
Every UI surface reads from a single CQRS projection.

Same code runs in every Sovereign:
  - openova         (run by us; SaaS Organizations)
  - omantel         (run by Omantel; SME Organizations across Oman)
  - bankdhofar      (run by the bank; internal Organizations)
  - your-company    (run by you, on infrastructure you choose)

See docs/GLOSSARY.md for every term, docs/ARCHITECTURE.md for the full picture.


What's in this repo

openova/
├── core/              # Catalyst control-plane application (Go) — design-stage; mostly placeholders today
├── platform/          # Component Blueprint folders (one folder per upstream OSS project)
├── products/          # Composite Blueprint folders OpenOva publishes
│   ├── catalyst/      # The Catalyst control plane itself, target umbrella Blueprint
│   ├── cortex/        # AI Hub (LLM serving, RAG, AI safety)
│   ├── axon/          # SaaS LLM Gateway (default upstream for Cortex)
│   ├── fingate/       # Open Banking (PSD2/FAPI sandbox)
│   ├── fabric/        # Data & Integration (event-driven + lakehouse)
│   └── relay/         # Communication (email, video, chat, WebRTC)
│                      # (specter and exodus are deliverable services, not Blueprints in this layout)
└── docs/              # Platform documentation

Each folder under platform/ and products/ is the source of one Blueprint, published from CI as a signed OCI artifact at ghcr.io/openova-io/bp-<name>:<semver> (the bp- prefix is added to the OCI artifact name; folder names stay short). Per-folder isolation is provided at the OCI artifact layer, not the Git repo layer — this is a monorepo with per-Blueprint fan-out, not a meta-repo of separate Git repositories. See docs/BLUEPRINT-AUTHORING.md §2 for the folder layout contract.

Today, the 12-component bootstrap kit (cilium, cert-manager, flux, crossplane, sealed-secrets, spire, nats-jetstream, openbao, keycloak, gitea, powerdns + the bp-catalyst-platform umbrella under products/catalyst/) ships with full chart/ + blueprint.yaml per docs/IMPLEMENTATION-STATUS.md §7, plus products/axon/ and the external-dns leaf chart. The remaining 45 platform components and the cortex / fabric / fingate / relay product folders are design-stage — README only — until each lands its Blueprint manifest, chart, Compositions, and CI fan-out.


Stack at a glance

Layer Technology
Container runtime k3s (k8s-conformant), containerd
CNI / Service Mesh Cilium (eBPF mTLS, L7 policies, Gateway API)
GitOps Flux (per-vcluster, lightweight)
Git Gitea (per-Sovereign, hosts Blueprint mirror + per-Environment repos)
IaC for non-K8s Crossplane (the only IaC; not user-facing)
Bootstrap IaC OpenTofu (one-shot, archived after Phase 0)
Multi-tenancy vcluster (one per Organization per host cluster)
Identity (workloads) SPIFFE/SPIRE (5-min rotating SVIDs, mTLS everywhere)
Identity (users) Keycloak (per-Org for SME, per-Sovereign for corporate)
Secrets OpenBao (Apache 2.0; independent Raft per region, no stretched cluster) + External Secrets Operator
Event spine NATS JetStream (Apache 2.0; pub/sub + KV; per-Org accounts)
TLS cert-manager + Let's Encrypt or corporate CA
Policy Kyverno
Supply chain cosign (Sigstore), Syft + Grype SBOM, Trivy scans
Runtime security Falco (eBPF)
Observability OpenTelemetry → Grafana stack (Alloy + Loki + Mimir + Tempo)
WAF Coraza (OWASP CRS)
DNS PowerDNS authoritative per Sovereign zone + DNSSEC + lua-records (ifurlup, pickclosest); pool-domain-manager allocates pool subdomains and flips parent-zone NS via registrar adapters (Cloudflare / Namecheap / GoDaddy / OVH / Dynadot) — see docs/MULTI-REGION-DNS.md, docs/PLATFORM-POWERDNS.md
Backup Velero (to SeaweedFS, which routes the cold tier to cloud archival S3)
Container registry Harbor

For the full component list and trends see docs/PLATFORM-TECH-STACK.md and docs/TECHNOLOGY-FORECAST-2027-2030.md.


Cloud providers

Provider Status
Hetzner Cloud Available (most-tested path)
AWS / GCP / Azure Crossplane providers available; full path coming
Oracle Cloud (OCI) Crossplane provider available; full path coming
Huawei Cloud Crossplane provider available; full path coming

All providers reach Catalyst via the same Crossplane abstraction; Sovereign provisioning details per provider are in docs/SOVEREIGN-PROVISIONING.md.


Getting started

Try it (managed)

Visit marketplace.openova.io to install Applications on the openova Sovereign without any infrastructure setup. SaaS journey for SMEs and evaluations.

Run your own Sovereign

1. Provision via catalyst-provisioner.openova.io (managed bootstrap), OR
2. Self-host bp-catalyst-provisioner in your own infrastructure (air-gap path).

Then follow the procedure in docs/SOVEREIGN-PROVISIONING.md.

Build a Blueprint

See docs/BLUEPRINT-AUTHORING.md. A Blueprint is a folder under platform/<name>/ (or products/<name>/) in this monorepo containing blueprint.yaml + manifests (Helm chart or Kustomize base) + (optional) Crossplane Compositions. CI signs each folder's contents and publishes to OCI as ghcr.io/openova-io/bp-<name>:<semver>. Catalyst's blueprint-controller picks it up automatically. Org-private Blueprints follow the same shape inside per-Sovereign Gitea repos.


License

All Blueprints and the Catalyst control plane are open source. Each component carries its own upstream license (typically Apache 2.0, MPL 2.0, or BSD-3); see each component's LICENSE file.

OpenOva charges for support, managed operations, and expert services — never for access to code. See docs/BUSINESS-STRATEGY.md §10.


Contributing

PRs welcome. The contribution path for Blueprints (including Crossplane Compositions) is documented in docs/BLUEPRINT-AUTHORING.md §13. Issues and discussions on GitHub.


Cloud-native is the foundation. Catalyst is how you operate it.