docs/gitops.md
- Source: docs/gitops.md
Imported Content
GitOps and Promotion
Repo split
- App repo (
anchor-msp) builds and signs images, then opens a dev bump PR in ops repo. - Ops repo (
anchor-msp-ops) is the GitOps source for Argo CD.
Environment overlays (ops repo)
infra/helm/platform/environments/dev/values.yamlinfra/helm/platform/environments/staging/values.yamlinfra/helm/platform/environments/prod/values.yaml
Notable defaults:
devcan run withAUTH_MODE=disabledfor rapid iteration.staging/prodrequire JWT auth and production signing/encryption secrets.status-mockis disabled for staging/prod overlays.- Worker deployments (
anchor-outbox-worker,anchor-job-worker) run from the gateway image. - Staging/prod Argo applications must run with
automated.prune=trueandautomated.selfHeal=trueto remove stale resources.
Promotion model
- Merge to app repo
mainbuilds and publishes images. - App workflow opens ops PR updating
environments/dev/release.yaml. - Ops sync workflow validates release contract alignment with Helm overlays.
- Argo CD reconciles ops repo manifests and deploys
dev. - Ops promotion workflow creates PRs for
dev -> staging -> prod.
Required GitHub settings
App repo (anchor-msp) variables/secrets:
ENGINE_ID(variable)OPS_REPO(variable,<org>/anchor-msp-ops)STATUS_API_URL(secret)STATUS_API_TOKEN(secret)OPS_REPO_PAT(secret; repo write for ops repo PR creation)
Ops repo (anchor-msp-ops) variables/secrets:
ENGINE_ID(variable)STATUS_API_URL(secret)STATUS_API_TOKEN(secret)
Runtime profile (4GB cost target)
prodalways-on, minimum stateless replicas = 1.devandstagingare on-demand in low-cost environments.- Stateful dependencies should use managed services (PostgreSQL/Redis/NATS-compatible).
- Rollouts use constrained strategy (
maxSurge: 0,maxUnavailable: 1) to protect single-node capacity.
Rollback
- Revert environment values PR to prior image tag.
- Argo CD self-heal enforces previous known-good state.
- Emit
rollback.executedstatus event from promotion pipeline.
Production No-Mock Cutover
- Ensure
statusMock.enabled=falseinenvironments/staging/values.yamlandenvironments/prod/values.yaml. - Ensure staging/prod Argo applications are configured with:
syncPolicy.automated.prune=truesyncPolicy.automated.selfHeal=true
- Set production control-center endpoint in gateway env:
EGI_CONTROL_CENTER_URLmust behttps://...and must not includestatus-mock.
- Set production AgentField endpoint in gateway env:
AGENTFIELD_URLmust behttps://...and must not includeagentfield-mock.
- Run a hard refresh + prune sync on staging and prod Argo applications to remove stale mock resources.
Required secret keys (staging/prod)
DATABASE_URLJWT_SIGNING_SECRET(required whenAUTH_JWKS_URLis not used)AUTH_JWKS_URL(optional, recommended for IdP-managed JWT verification)AUDIT_SIGNING_SECRETAUDIT_SIGNING_KEY_IDRESOURCE_ENCRYPTION_KEY_B64AGENTFIELD_API_KEYAGENTFIELD_WEBHOOK_SECRETANCHOR_OPERATOR_JWT- Optional web guardrail overrides:
ANCHOR_REQUIRE_OPERATOR_JWT(defaults to required in production)ANCHOR_ALLOW_WILDCARD_WORKSPACE_IDS(defaults tofalsein production)
- Optional integration secrets:
GITHUB_WEBHOOK_SECRET,QUICKBOOKS_API_TOKEN,XERO_API_TOKEN