infra: add kustomize HA deployment tree #11

Merged
mhahl-a merged 11 commits from kubernetes into main 2026-08-16 05:04:56 +00:00
Owner

Full HA kustomize composition for Kubernetes:

  • base/ — stateless tier (Flask app + PostgREST) with HPA, PDB,
    topology-spread, anti-affinity, hardened securityContext;
    Postgres via CloudNativePG (3 instances, sync-replication quorum,
    fencing, S3 WAL backups); Redis HA via Sentinel (3 redis + 3
    sentinels, AOF everysec) with a kustomize-native failover
    controller; External Secrets Operator wiring for MASTER_KEY /
    JWT_SECRET / SECRET_KEY / DB / Redis / backup credentials;
    cert-manager Ingress + ClusterIssuer; default-deny NetworkPolicy
    with per-component allow-lists; Pod Security Standards
    'restricted' namespace label.
  • overlays/prod — production sizing (5 app / 3 pg / 3 redis,
    SSD storage, ResourceQuota + LimitRange, Let's Encrypt,
    pinned image tags).
  • overlays/staging — single-replica cost-tuned variant, self-signed
    TLS, dev-mode Vault.

README documents operator prerequisites, Vault policy/KV layout,
build/apply/dry-run commands, admin promotion, MASTER_KEY rotation,
pg failover + PITR, redis failover verification, upgrade procedure,
and monitoring alerts.

kustomize build verified clean on base, prod, and staging.

Full HA kustomize composition for Kubernetes: - base/ — stateless tier (Flask app + PostgREST) with HPA, PDB, topology-spread, anti-affinity, hardened securityContext; Postgres via CloudNativePG (3 instances, sync-replication quorum, fencing, S3 WAL backups); Redis HA via Sentinel (3 redis + 3 sentinels, AOF everysec) with a kustomize-native failover controller; External Secrets Operator wiring for MASTER_KEY / JWT_SECRET / SECRET_KEY / DB / Redis / backup credentials; cert-manager Ingress + ClusterIssuer; default-deny NetworkPolicy with per-component allow-lists; Pod Security Standards 'restricted' namespace label. - overlays/prod — production sizing (5 app / 3 pg / 3 redis, SSD storage, ResourceQuota + LimitRange, Let's Encrypt, pinned image tags). - overlays/staging — single-replica cost-tuned variant, self-signed TLS, dev-mode Vault. README documents operator prerequisites, Vault policy/KV layout, build/apply/dry-run commands, admin promotion, MASTER_KEY rotation, pg failover + PITR, redis failover verification, upgrade procedure, and monitoring alerts. kustomize build verified clean on base, prod, and staging.
infra: add kustomize HA deployment tree
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
adf9d3c8b5
Full HA kustomize composition for Kubernetes:

- base/ — stateless tier (Flask app + PostgREST) with HPA, PDB,
  topology-spread, anti-affinity, hardened securityContext;
  Postgres via CloudNativePG (3 instances, sync-replication quorum,
  fencing, S3 WAL backups); Redis HA via Sentinel (3 redis + 3
  sentinels, AOF everysec) with a kustomize-native failover
  controller; External Secrets Operator wiring for MASTER_KEY /
  JWT_SECRET / SECRET_KEY / DB / Redis / backup credentials;
  cert-manager Ingress + ClusterIssuer; default-deny NetworkPolicy
  with per-component allow-lists; Pod Security Standards
  'restricted' namespace label.
- overlays/prod — production sizing (5 app / 3 pg / 3 redis,
  SSD storage, ResourceQuota + LimitRange, Let's Encrypt,
  pinned image tags).
- overlays/staging — single-replica cost-tuned variant, self-signed
  TLS, dev-mode Vault.

README documents operator prerequisites, Vault policy/KV layout,
build/apply/dry-run commands, admin promotion, MASTER_KEY rotation,
pg failover + PITR, redis failover verification, upgrade procedure,
and monitoring alerts.

kustomize build verified clean on base, prod, and staging.
infra: drop Vault/ESO — operator-managed Secrets instead
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
d1b3cb89da
This application IS the external secrets store for other systems, so
its own bootstrap credentials do not need to be fetched from one.
Removed:

- deploy/base/external-secrets/ — ClusterSecretStore + 6 ExternalSecrets
- deploy/base/rbac/{external-secrets-reader SA, Role, RoleBinding}
- overlays/{prod,staging}/vault-server-patch.yaml

Replaced with:

- deploy/base/secrets/ — README + secrets.example.yaml (structural
  templates with empty stringData; commit-safe reference only)
- scripts/bootstrap-secrets.sh — generates random passwords for each
  required Secret and kubectl applies them (chmod 600 env dump with
  60s auto-delete; MASTER_KEY reminder)

Updated:

- base/kustomization.yaml — drop external-secrets, add secrets
- overlays/{prod,staging}/kustomization.yaml — drop vault-server-patch
- deploy/README.md — rewrite: remove Vault prerequisites + KV layout,
  add 'Secrets bootstrap' section, document rotation procedures
  against kubectl patch + kubectl rollout instead of ESO annotations

Required Secret names: secretserver-app-secrets,
secretserver-postgrest-secrets, secretserver-postgres-superuser,
secretserver-postgres-authenticator, secretserver-redis-secrets,
secretserver-postgres-backup (opt). kustomize build verified clean
on base, prod, staging.
fix(deploy): address Kubernetes manifest review findings
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
2c32fcd35d
- Fix sentinel & failover-controller password expansion ($ vs $$)
- Drop unmounted --redis.password-file arg from redis-exporter sidecar
- Add NetworkPolicy allowing failover controller egress (DNS, sentinel, K8s API)
- Point app REDIS_URL to redis-master:6379/0 and document controller patching
- Remove empty storageClassName from base Redis PVC and Postgres cluster
- Remove invalid SET ROLE GUC from Postgres roleSettings
- Align MAX_CONTENT_LENGTH (16MB) in ConfigMap with Ingress proxy-body-size
- Remove arbitrary /29 except from probe CIDRs across all NetworkPolicies
- Restrict Postgres NetworkPolicy cnpg-system ingress with podSelector
- Set Postgres wal_level to replica and turn off connection logging
- Set Postgres podAntiAffinity to required for strict HA
- Add readOnlyRootFilesystem to Redis init container and exporter sidecar
- Remove deprecated kubernetes.io/ingress.class annotation from Ingress
- Drop non-functional PostgREST PodMonitor and app /healthz prometheus annotations
- Add missing optional UI env vars to app ConfigMap
- Add prominent staging-only warning in enable-insecure-defaults.yaml
- Update deploy/README.md layout, monitoring, and runbook
feat: harden secrets UX and token policy
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
bcdefa562e
feat(deploy): add operational cronjobs
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
bc67366310
feat(dev): add database reset script
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
7bd45e6435
fix(ui): remove stale script integrity hashes
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
290bb3dd2a
fix(crypto): ensure HSM KEK before project adoption
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
df3413ca45
fix(ui): preserve HSM slot on re-encryption
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
8d11003c49
fix tests after application restructure
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
15e46b0115
feat: add version to default branding
Some checks failed
CI / tox py + lint (pull_request) Has been cancelled
40e45fafeb
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Sigaint/corvus!11
No description provided.