apps(farrisilk): lab replica stack (Odoo 18 + plain Postgres + Metabase) on :8086/:8087
Odoo 18 (dated tag 18.0-20261112) on a plain postgres:16 container, not CNPG: the client runs bare Postgres on a Proxmox VM and this namespace mirrors that shape. Odoo's initContainer installs base,web once, applies the read-only BI grants/revokes and sets the admin login from a Secret. Metabase gets its own state in the same Postgres (db metabase) with a 1Gi heap and MB_ENCRYPTION_SECRET_KEY. Two bare-IP Gateways (8086 odoo, 8087 metabase) in ns internal, each with its own RouteConfiguration. Host firewall (nft on siriussec, ufw on rpi) carries 8086/8087 and was installed before the Gateways were pushed.
This commit is contained in:
parent
930752152e
commit
7f7f806616
14 changed files with 874 additions and 6 deletions
140
apps/base/farrisilk/postgres.yaml
Normal file
140
apps/base/farrisilk/postgres.yaml
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
# Plain PostgreSQL 16 — deliberately NOT CloudNativePG.
|
||||
#
|
||||
# The client runs Odoo against a plain Postgres on a Proxmox VM. This namespace
|
||||
# is a *lab replica of that shape*, so the database is a bare container with a
|
||||
# single local-path volume, no operator, no replicas, no WAL archive. Do not
|
||||
# "improve" this into a CNPG Cluster: the point is to develop and audit against
|
||||
# the client's actual architecture, not ours.
|
||||
#
|
||||
# Known gap (stated plainly on purpose): there are NO backups of this database.
|
||||
# The client's practice is a cron-driven `pg_dump` of the DB only; that mirrors
|
||||
# into a separate follow-up card for this namespace, and no PITR/barman story
|
||||
# is being invented here.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pg-data
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pg
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
replicas: 1
|
||||
# RWO volume: two pods must never hold the data directory at once.
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pg
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pg
|
||||
app.kubernetes.io/part-of: farrisilk
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: siriussec
|
||||
tolerations:
|
||||
- key: dedicated
|
||||
operator: Exists
|
||||
effect: PreferNoSchedule
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:16
|
||||
imagePullPolicy: IfNotPresent
|
||||
args: ["-c", "max_connections=60"]
|
||||
ports:
|
||||
- name: postgres
|
||||
containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-app
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-app
|
||||
key: password
|
||||
# The bootstrap superuser's own database. `odoo` and `metabase` are
|
||||
# created by the init script below.
|
||||
- name: POSTGRES_DB
|
||||
value: postgres
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
# Consumed only by 01-init-dbs.sh on first start.
|
||||
- name: ODOO_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-users
|
||||
key: odoo_password
|
||||
- name: METABASE_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-users
|
||||
key: metabase_password
|
||||
- name: METABASE_RO_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-users
|
||||
key: metabase_ro_password
|
||||
- name: TZ
|
||||
value: America/Los_Angeles
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", "postgres", "-d", "postgres"]
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", "postgres", "-d", "postgres"]
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 4
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
memory: 1Gi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: initdb
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: pg-data
|
||||
- name: initdb
|
||||
configMap:
|
||||
name: pg-init
|
||||
defaultMode: 0555
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pg
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: pg
|
||||
ports:
|
||||
- name: postgres
|
||||
port: 5432
|
||||
targetPort: postgres
|
||||
protocol: TCP
|
||||
Loading…
Reference in a new issue