Kubernetes Multi-Replica Production Deployment
Yearning v4 is a completely stateless Go monolith backed by PostgreSQL for shared leases, sessions, scheduled jobs, and SSE fan-out, ready for multi-replica Kubernetes deployments with zero Pod-local state.
Standard manifests live under backend/deploy/k8s/:
backend/deploy/k8s/control-plane.yaml: Stateless multi-replica Deployment, Service, probes, and hardened securityContextbackend/deploy/k8s/migration-workloads.yaml: Isolated schema migration Job and temporary migration review Deploymentbackend/deploy/k8s/network-policy.yaml: Least-privilege NetworkPolicy
Security Hardening & 3-Role PostgreSQL Isolation
- Distroless Non-Root Containers:
linux/amd64andlinux/arm64, UID65532,readOnlyRootFilesystem: true,allowPrivilegeEscalation: false,capabilities.drop: ["ALL"]. - Mandatory 3-Role Isolation (
db/roles/grants.sql):yearning_migrator: Used exclusively byyearning-schema-migrationJob to applydb/migrations/*.sql(no keyring access).yearning_app: Non-superuser runtime role used byyearningDeployment (verified on boot bydatabase_role_self_checkin production mode).yearning_retention: Injected viaYEARNING_RETENTION_DATABASE_DSNfor 90-day audit and 7-day raw payload retention cleanup.
Four Production Readiness Probes
Pods receive traffic only when all four readiness checks succeed:
metadata_postgresql: Live PostgreSQL pool health.key_provider: Valid 6-purpose AEADkeyring.jsonreadable.schema_ledger:schema_migrationsexists with zero failed rows.exact_schema_version+database_role_self_check: Applied schema version exactly matches the image's/usr/share/yearning/db-migrationsand the runtime role satisfies non-superuser least-privilege checks.