Deploy CloudNativePG operator + Cluster to k3s #13
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan
plan-2026-02-26-tf-modularize-postgres-- Phase 2Repo
forgejo_admin/pal-e-platformUser Story
As a platform operator
I want CloudNativePG deployed to k3s with a shared PostgreSQL cluster
So that platform services can use managed Postgres instead of embedded SQLite
Context
Platform services (pal-e-docs, future apps) need a shared PostgreSQL instance. CloudNativePG (CNPG) is a Kubernetes operator that manages PostgreSQL clusters declaratively. This phase deploys the CNPG operator via Helm and creates a single-instance Cluster CRD via
kubernetes_manifest.Key decision: CNPG's admission webhook injects default PostgreSQL parameters (
wal_receiver_timeoutandwal_sender_timeoutboth set to5min) into the Cluster spec. If these are not present in the Terraform manifest, everytofu applyproduces a provider drift error. These must be pinned in the manifest.File Targets
Files the agent should modify or create:
terraform/main.tf-- add CNPG namespace, Helm release, and Cluster kubernetes_manifestterraform/versions.tf-- no changes expected (kubernetes provider already present)terraform/variables.tf-- add CNPG-related variables if neededterraform/outputs.tf-- add CNPG cluster outputsFiles the agent should NOT touch:
salt/-- host-level config, not relevantAcceptance Criteria
helm_releaseClustermanifest created viakubernetes_manifestwith single instancewal_receiver_timeout = "5min"andwal_sender_timeout = "5min"tofu fmtpassestofu validatepassesTest Expectations
tofu fmt -checkexits 0tofu validateexits 0cd terraform && tofu fmt -check && tofu validateConstraints
tofunotterraform)local-pathstorageClass consistent with other resourcesChecklist
tofu fmt,tofu validate)Related
plan-2026-02-26-tf-modularize-postgres-- parent plan