- Create infrastructure for PostgreSQL StatefulSet in Kubernetes - Implement environment-specific configurations (staging/production) - Add Kustomize overlays for deterministic deployments - Document deployment process in AGENTS.md and infra/k8s/README.md - Include Makefile and helper scripts for easy management New directories: - infra/k8s/base/ - Shared resources (StatefulSet, Service, PVC, Namespace) - infra/k8s/staging/ - Staging environment overlay - infra/k8s/production/ - Production environment overlay Key files: - infra/k8s/base/kustomization.yaml - infra/k8s/staging/kustomization.yaml - infra/k8s/production/kustomization.yaml - infra/k8s/README.md Resources are prefixed by environment (staging-, production-) and deployed to the postgres namespace.
2.4 KiB
AGENTS.md
This file documents the architecture and domain model of this repository, intended for both human readers and AI agents.
Agent skills
Issue tracker
Issues are tracked in the Gitea instance at https://git.bobbypalko.com/bobby/hapi. Uses the gt CLI (Gitea's official CLI). Run gt auth login -h https://git.bobbypalko.com to authenticate. See docs/agents/issue-tracker.md.
Triage labels
Five canonical triage roles mapped to labels: needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix. See docs/agents/triage-labels.md.
Domain docs
Single-context layout: GLOSSARY.md at repo root and docs/adr/ for architecture decisions. See docs/agents/domain.md.
Infrastructure modules
The infra/ directory contains Terraform configurations with these modules:
backend/- Terraform state backend (Object Storage S3-compatible)k8s/- PostgreSQL StatefulSet with persistent storage and Kubernetes manifestsnetwork/- Firewall rules for API (8000), PostgreSQL (5432), Adminer (8080)postgres/- LKE clusters for staging/productionstorage/- Object Storage buckets for uploads and state
See infra/README.md and docs/adr/0002-linode-provider-v2-migration.md for details.
Kubernetes Deployments
PostgreSQL is deployed using Kustomize with environment-specific configurations:
- Base (
infra/k8s/base/) - Shared resources (StatefulSet, Service, PVC, Namespace) - Staging (
infra/k8s/staging/) - Staging environment overlay withstaging-prefix - Production (
infra/k8s/production/) - Production environment overlay withproduction-prefix
Deployment commands:
# Staging
kubectl apply -k infra/k8s/staging
# Production
kubectl apply -k infra/k8s/production
# Dry run
kubectl apply -k infra/k8s/staging --dry-run=client
Resource naming:
- Staging resources are prefixed with
staging- - Production resources are prefixed with
production- - All resources go to the
postgresnamespace
Secrets required:
postgres-secretswithusernameandpasswordkeys
See infra/k8s/README.md for more details.
Provider Versions
Linode Terraform Provider
v2.0+ (current branch) - Migrated from v1 with breaking changes documented in ADR-0002. Key differences:
- Object Storage:
cluster→region - Firewall: Updated format with
action,ipv4,ipv6 - LKE:
pools→pool - Tags: Set format (
key=value)