Skip to content

ADR-0007: Deploying the hosted control plane

  • Status: Accepted
  • Date: 2026-11-27
  • Phase: K6

Context

K5 built Keelgate Cloud but gave no way to run it outside a developer's machine. ADR-0006 left security gaps open, kept several limits in process memory, and accepts only Stripe test keys. A deployment must not quietly remove any of those constraints.

Decision

Scope: a private deployment

K6 packages the control plane and dashboard (two images, one Helm chart, AWS Terraform). It does not close the ADR-0006 gaps, so everything defaults to private: no ingress, cluster-only services, a private Kubernetes API, and a refusal of internet-facing ingress annotations unless ingress.allowPublic is set. That check reads annotations and cannot detect every public ingress controller.

Safety properties are structural where possible

  • The chart has no replica setting for the control plane and uses Recreate, because a second process would multiply the in-memory rate limits and per-org evaluation cap. The cost is an outage during upgrades, during which gated actions are refused.
  • The chart offers no free-form environment variables, so neither live Stripe nor plain-HTTP OIDC can be switched on through values.
  • The schema-owning database credential is mounted only by the migration job.
  • Secrets are never chart values or Terraform values. The chart references existing Kubernetes secrets; Terraform creates empty Secrets Manager entries and lets RDS manage its own administrator password, so no secret value enters Terraform state.
  • Pods run as non-root with a read-only root filesystem, no capabilities and no Kubernetes API token. Network policies deny by default. Outbound HTTPS excludes private, link-local and carrier-grade NAT ranges, which is the egress backstop ADR-0006 asked for against DNS rebinding. Nodes require IMDSv2 with a hop limit of 1.

Verification without a cloud account

Nothing automated plans or applies against AWS. Terraform is checked with fmt, validate and terraform test against a mocked provider. The chart is linted, checked against Kubernetes schemas, and covered by tests of its refusals. CI builds both images and signs up through them under Compose and again in a kind cluster.

Placement and dependencies

The files live in deploy/, following the repository layout, and are Apache-2.0 like everything outside ee/. The images they build contain proprietary code and belong in private registries; no workflow publishes them. Terraform uses only the hashicorp/aws provider, with no third-party modules. Base images are pinned by digest and the new workflow's actions by commit.

Consequences

  • The Terraform is untested against AWS. Quotas, service-linked roles, version availability and IAM details can only be found by a real plan and apply, which the owner must run.
  • Digest pins do not update themselves. Someone must bump them for base-image fixes.
  • A load balancer controller, DNS, certificates, a VPN or bastion, a secrets operator, alarms and a tested restore procedure are not provided.
  • The open-source harness has no image or chart: it is a library that runs in the customer's process.
  • Temporal and Redis are not provisioned: the control plane uses neither.

Rejected

  • ECS instead of EKS. Less to operate, but the approved stack names Helm.
  • Community Terraform modules. Faster to write, but each is another supply-chain dependency with broad IAM reach.
  • Secrets generated by Terraform. Simpler to install, but they would sit in state.
  • Two control-plane replicas with divided limits. The limits would still be wrong whenever load was uneven.