apps(customer1): anonymize client name — farrisilk → customer1 (#38)

This commit is contained in:
sirius 2026-11-24 06:46:52 +00:00
commit 696edddcaf
16 changed files with 80 additions and 80 deletions

View file

@ -1,14 +1,14 @@
# farrisilk — lab replica of the Farrisilk client stack
# customer1 — lab replica of the Customer 1 client stack
A **development/audit sandbox** shaped like Farrisilk Inc.'s production stack —
A **development/audit sandbox** shaped like Customer 1 Inc.'s production stack —
not a copy of their traffic, and not their architecture. Odoo 18 + a plain
PostgreSQL + Metabase, WireGuard-only, in namespace `farrisilk`.
PostgreSQL + Metabase, WireGuard-only, in namespace `customer1`.
| Service | URL over WireGuard | Bare IP? | Notes |
|---|---|---|---|
| Odoo 18 | `http://10.10.0.2:8086/` | yes, any `Host` | `http://10.10.0.2:8086/web/login` |
| Metabase | `http://10.10.0.2:8087/` | yes, any `Host` | secondary instance, 1 GiB heap |
| PostgreSQL | `pg.farrisilk.svc.cluster.local:5432` | in-cluster only | no NodePort, no gateway |
| PostgreSQL | `pg.customer1.svc.cluster.local:5432` | in-cluster only | no NodePort, no gateway |
`10.10.0.2` is siriussec, the only node labelled `gateway=true` (the only node
running `cilium-envoy`). Nothing here has a public hostname, a tunnel entry or a
@ -41,8 +41,8 @@ This namespace is our sandbox for developing and auditing against *their* shape:
| Two hostname-less HTTPRoutes | `httproute.yaml` |
Gateways live with the other internal listeners:
`infrastructure/networking/internal/gateway-farrisilk-odoo.yaml` (8086) and
`gateway-farrisilk-metabase.yaml` (8087). **Each bare-IP service gets its own
`infrastructure/networking/internal/gateway-customer1-odoo.yaml` (8086) and
`gateway-customer1-metabase.yaml` (8087). **Each bare-IP service gets its own
Gateway**: Cilium renders one RouteConfiguration per Gateway and merges every
hostname-less route inside it into a weighted route, so two services sharing a
Gateway answer for each other at random. The host firewall
@ -65,7 +65,7 @@ separate Job to race against:
- `CREATE EXTENSION IF NOT EXISTS unaccent` as the database owner;
- (re)applies the read-only BI grants and credential-table revokes, every
start, so tables added by a later module install are covered too;
- sets the admin login/password from Secret `farrisilk/odoo-admin` via
- sets the admin login/password from Secret `customer1/odoo-admin` via
`odoo shell`.
Restarting the pod is safe and visibly idempotent:
@ -80,9 +80,9 @@ Copy the module directory into the `odoo-extra-addons` PVC, then install it
through the ORM:
```bash
POD=$(kubectl -n farrisilk get pod -l app=odoo -o name | head -1)
kubectl -n farrisilk cp ./client_module "${POD#pod/}:/mnt/extra-addons/client_module" -c odoo
kubectl -n farrisilk exec -i deploy/odoo -c odoo -- \
POD=$(kubectl -n customer1 get pod -l app=odoo -o name | head -1)
kubectl -n customer1 cp ./client_module "${POD#pod/}:/mnt/extra-addons/client_module" -c odoo
kubectl -n customer1 exec -i deploy/odoo -c odoo -- \
odoo shell -c /etc/odoo-runtime/odoo.conf -d odoo --no-http --shell-interface=python <<'EOF'
m = env['ir.module.module'].search([('name', '=', 'client_module')])
m.button_immediate_install()
@ -91,7 +91,7 @@ print(m.state)
EOF
```
Then `kubectl -n farrisilk delete pod -l app=odoo` once, so `init-db` re-applies
Then `kubectl -n customer1 delete pod -l app=odoo` once, so `init-db` re-applies
the `metabase_ro` SELECT grants to the tables the module just created (grants
are re-applied on every pod start; `ALTER DEFAULT PRIVILEGES` covers tables
created after the grant but not before it).
@ -154,7 +154,7 @@ does not give you.
| Item | Value |
|---|---|
| CronJob | `farrisilk/pg-backup` |
| CronJob | `customer1/pg-backup` |
| Schedule | `17 3 * * *`, `timeZone: America/Los_Angeles` (nightly) |
| Guard rails | `concurrencyPolicy: Forbid`, `startingDeadlineSeconds: 600`, `backoffLimit: 1`, `activeDeadlineSeconds: 1800`, history 3 ok / 3 failed |
| Databases | `odoo` **and** `metabase`, one `pg_dump -Fc` each |
@ -177,7 +177,7 @@ The script fails the Job (`rc=1`) if any `pg_dump` fails **or** if the archive
comes back with an empty TOC — a broken backup turns red instead of silently
succeeding, which a bare `pg_dump >> log 2>&1` cron does not do.
**Where the dumps actually are:** `/opt/local-path-provisioner/pvc-8f164f6c-…_farrisilk_backup-data`
**Where the dumps actually are:** `/opt/local-path-provisioner/pvc-8f164f6c-…_customer1_backup-data`
on **siriussec only**. `local-path` is node-local, so the backup dies with the
node. No off-box copy is implemented: the Garage S3 API at
`http://10.10.0.1:3900` is reachable from a pod, but it needs a bucket plus
@ -188,8 +188,8 @@ described setup.
Trigger a run on demand (what the manual proof below did):
```bash
kubectl -n farrisilk create job --from=cronjob/pg-backup pg-backup-manual-1
kubectl -n farrisilk logs job/pg-backup-manual-1
kubectl -n customer1 create job --from=cronjob/pg-backup pg-backup-manual-1
kubectl -n customer1 logs job/pg-backup-manual-1
```
### Restore — it is TWO steps, and the second one is the one people forget
@ -214,7 +214,7 @@ bytes from the Odoo PVC by hand:
```bash
# from the Odoo pod (uid 100): tar the filestore directory, not the DB
kubectl -n farrisilk exec deploy/odoo -- \
kubectl -n customer1 exec deploy/odoo -- \
tar czf - -C /var/lib/odoo filestore | gzip -d | tar xzf - -C <restore-data-dir>
```
@ -322,13 +322,13 @@ If a future image drops wkhtmltopdf, the fix is a derived image
2 GiB — this is a *second* Metabase next to the `metabase` namespace
evaluation instance and does not repeat its 1.5 GiB heap on this laptop.
- State lives in the same Postgres, database `metabase`, user `metabase`.
- **`MB_ENCRYPTION_SECRET_KEY` is set** (Secret `farrisilk/metabase-secret-key`)
- **`MB_ENCRYPTION_SECRET_KEY` is set** (Secret `customer1/metabase-secret-key`)
so stored data-source passwords are not encrypted with Metabase's default key.
Keep it stable: rotating it makes every stored datasource password
undecryptable.
- Set up entirely through the API (`/api/session/properties` → `POST /api/setup`
→ `POST /api/session` → `POST /api/database` → `sync_schema`), one data source:
**`farrisilk odoo`** → `pg.farrisilk.svc.cluster.local:5432/odoo` as
**`customer1 odoo`** → `pg.customer1.svc.cluster.local:5432/odoo` as
`metabase_ro`.
- Metabase has no per-database "read-only" switch for PostgreSQL sources; the
read-only guarantee here is the **role**, which is stronger (see below).
@ -386,7 +386,7 @@ Created before the Kustomization applies; never in git, never printed:
| `odoo-config` | `admin_passwd` | Odoo database master password |
| `odoo-admin` | `email`, `password` | Odoo web admin login (uid 2) |
| `metabase-admin` | `email`, `password` | Metabase's own login (**email**, no username) |
| `metabase-data-source-creds` | `username`=metabase_ro, `password` | the `farrisilk odoo` data source |
| `metabase-data-source-creds` | `username`=metabase_ro, `password` | the `customer1 odoo` data source |
| `metabase-secret-key` | `MB_ENCRYPTION_SECRET_KEY` | Metabase at-rest encryption |
## Shopify — integration surface only, blocked on client credentials
@ -415,7 +415,7 @@ the connector module). Until then the Odoo side stays unconfigured on purpose.
- The card's build section names db `odoo` (owner `odoo`), §4 grants on
database `odoo`, and Metabase's data source is `…:5432/odoo`, while the Odoo
config bullet said `db_name=farrisilk`. Those cannot both hold; the stack is
config bullet said `db_name=customer1`. Those cannot both hold; the stack is
aligned on **`odoo`** (`db_name`, `dbfilter=^odoo$`, `ODOO_DB_NAME`, the BI
grants and the Metabase source all say `odoo`).
- `base,web` are installed (not `base` alone) so `/web/login` serves a real web

View file

@ -22,9 +22,9 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: backup-data
namespace: farrisilk
namespace: customer1
labels:
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path
@ -36,9 +36,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: pg-backup-script
namespace: farrisilk
namespace: customer1
labels:
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
data:
backup.sh: |
#!/bin/sh
@ -88,9 +88,9 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: pg-backup
namespace: farrisilk
namespace: customer1
labels:
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
# Parked with the stack (see odoo.yaml): no dumps while Postgres is at 0.
suspend: true
@ -110,7 +110,7 @@ spec:
metadata:
labels:
app: pg-backup
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
restartPolicy: Never
automountServiceAccountToken: false
@ -132,7 +132,7 @@ spec:
command: ["/bin/sh", "/opt/backup/backup.sh"]
env:
- name: PGHOST
value: pg.farrisilk.svc.cluster.local
value: pg.customer1.svc.cluster.local
- name: PGPORT
value: "5432"
- name: PGUSER

View file

@ -5,16 +5,16 @@
# cannot edit /etc/hosts. Cilium renders ONE RouteConfiguration per Gateway and
# merges every hostname-less route in it into a single weighted route, so two
# services sharing one Gateway serve each other's traffic at random regardless
# of listener port. Hence gateway-farrisilk-odoo.yaml (8086) and
# gateway-farrisilk-metabase.yaml (8087) in infrastructure/networking/internal/.
# of listener port. Hence gateway-customer1-odoo.yaml (8086) and
# gateway-customer1-metabase.yaml (8087) in infrastructure/networking/internal/.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: odoo
namespace: farrisilk
namespace: customer1
spec:
parentRefs:
- name: farrisilk-odoo
- name: customer1-odoo
namespace: internal
rules:
- matches:
@ -29,10 +29,10 @@ apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: metabase
namespace: farrisilk
namespace: customer1
spec:
parentRefs:
- name: farrisilk-metabase
- name: customer1-metabase
namespace: internal
rules:
- matches:

View file

@ -3,13 +3,13 @@ kind: Kustomization
resources:
- namespace.yaml
# Secrets are created out of band, before this Kustomization applies:
# farrisilk/pg-app basic-auth, postgres superuser
# farrisilk/pg-users odoo/metabase/metabase_ro role passwords
# farrisilk/odoo-config admin_passwd (database master password)
# farrisilk/odoo-admin email, password (web admin login)
# farrisilk/metabase-admin email, password (Metabase's own login)
# farrisilk/metabase-data-source-creds username=metabase_ro + password
# farrisilk/metabase-secret-key MB_ENCRYPTION_SECRET_KEY
# customer1/pg-app basic-auth, postgres superuser
# customer1/pg-users odoo/metabase/metabase_ro role passwords
# customer1/odoo-config admin_passwd (database master password)
# customer1/odoo-admin email, password (web admin login)
# customer1/metabase-admin email, password (Metabase's own login)
# customer1/metabase-data-source-creds username=metabase_ro + password
# customer1/metabase-secret-key MB_ENCRYPTION_SECRET_KEY
# None of them appear in git; they are not managed (or pruned) by Flux.
- postgres-init.yaml
- postgres.yaml

View file

@ -1,5 +1,5 @@
# Metabase for the lab replica — its own state in the SAME plain Postgres
# (database `metabase`), one data source: `farrisilk odoo` as `metabase_ro`.
# (database `metabase`), one data source: `customer1 odoo` as `metabase_ro`.
#
# This is a SECOND instance next to the evaluation one in namespace `metabase`.
# The laptop is on a marginal USB-C supply, so it does not repeat that
@ -8,15 +8,15 @@
# MB_ENCRYPTION_SECRET_KEY is set here on purpose. Without it Metabase encrypts
# stored data-source passwords with a key derived from its own default, so a
# copy of the app DB is enough to read them. The key lives in Secret
# `farrisilk/metabase-secret-key` and must stay stable for the life of the app
# `customer1/metabase-secret-key` and must stay stable for the life of the app
# DB — rotating it makes every stored datasource password undecryptable.
apiVersion: apps/v1
kind: Deployment
metadata:
name: metabase
namespace: farrisilk
namespace: customer1
spec:
# Parked 2026-11-22 (power budget) — see apps/base/farrisilk/odoo.yaml.
# Parked 2026-11-22 (power budget) — see apps/base/customer1/odoo.yaml.
replicas: 0
selector:
matchLabels:
@ -25,7 +25,7 @@ spec:
metadata:
labels:
app: metabase
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
nodeSelector:
kubernetes.io/hostname: siriussec
@ -46,7 +46,7 @@ spec:
- name: MB_DB_TYPE
value: postgres
- name: MB_DB_HOST
value: pg.farrisilk.svc.cluster.local
value: pg.customer1.svc.cluster.local
- name: MB_DB_PORT
value: "5432"
- name: MB_DB_DBNAME
@ -96,7 +96,7 @@ apiVersion: v1
kind: Service
metadata:
name: metabase
namespace: farrisilk
namespace: customer1
spec:
type: ClusterIP
selector:

View file

@ -1,7 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: farrisilk
name: customer1
labels:
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
sirius.dev/purpose: lab-replica-of-client-stack

View file

@ -9,7 +9,7 @@
# 3. CREATE EXTENSION unaccent, as the database owner
# 4. (re)apply the read-only BI grants over every table Odoo just created,
# including revoking the tables that carry credentials
# 5. set the admin login/password from Secret `farrisilk/odoo-admin`
# 5. set the admin login/password from Secret `customer1/odoo-admin`
#
# Step 4 runs unconditionally, not only on first install: it is what picks up
# tables added by a later module install (`-i`/`-u` from /mnt/extra-addons), and
@ -19,11 +19,11 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: odoo-init
namespace: farrisilk
namespace: customer1
data:
init_db.py: |
#!/usr/bin/env python3
"""Idempotent first-run provisioning of the Farrisilk lab Odoo database."""
"""Idempotent first-run provisioning of the Customer 1 lab Odoo database."""
import os
import subprocess
import sys
@ -157,7 +157,7 @@ data:
print(f"metabase_ro: SELECT granted on {readable} tables; "
f"revoked on {revoked}", flush=True)
# Admin login/password from Secret farrisilk/odoo-admin. `odoo shell` is
# Admin login/password from Secret customer1/odoo-admin. `odoo shell` is
# the supported way to set a res.users password without hand-rolling a
# pbkdf2 hash. Re-writing the same value on every start is harmless.
payload = (

View file

@ -1,4 +1,4 @@
# Odoo 18 — the application half of the Farrisilk lab replica.
# Odoo 18 — the application half of the Customer 1 lab replica.
#
# Image is pinned to the DATED build, never `18.0`/`latest`: Odoo auto-migrates
# its database schema on start, so a floating tag turns a pod restart into an
@ -12,7 +12,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: odoo-data
namespace: farrisilk
namespace: customer1
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path
@ -21,7 +21,7 @@ spec:
storage: 10Gi
---
# Empty by default. This is where the client's custom modules are copied in
# (`kubectl cp ./module farrisilk/<odoo-pod>:/mnt/extra-addons/...`), which is
# (`kubectl cp ./module customer1/<odoo-pod>:/mnt/extra-addons/...`), which is
# why it is a PVC and not an emptyDir: a module installed from here must survive
# a pod restart, or the modules table and the addons path disagree and Odoo
# refuses to start the affected modules.
@ -29,7 +29,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: odoo-extra-addons
namespace: farrisilk
namespace: customer1
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path
@ -41,7 +41,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: odoo
namespace: farrisilk
namespace: customer1
spec:
# Parked 2026-11-22: siriussec's 15 W adapter cannot carry this replica
# stack (Odoo + two JVM/Postgres processes) alongside the public gateway
@ -56,7 +56,7 @@ spec:
metadata:
labels:
app: odoo
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
# Envoy has to reach the backend on the same node it serves from, and the
# filestore PVC is local-path (siriussec-only anyway).
@ -249,7 +249,7 @@ apiVersion: v1
kind: Service
metadata:
name: odoo
namespace: farrisilk
namespace: customer1
spec:
type: ClusterIP
selector:

View file

@ -13,13 +13,13 @@
# installed them (the odoo Deployment's initContainer), because
# at this point the `odoo` database has no tables at all.
#
# Passwords arrive as env vars from Secret `farrisilk/pg-users` (out of band);
# Passwords arrive as env vars from Secret `customer1/pg-users` (out of band);
# nothing here is a credential literal.
apiVersion: v1
kind: ConfigMap
metadata:
name: pg-init
namespace: farrisilk
namespace: customer1
data:
01-init-dbs.sh: |
#!/bin/bash

View file

@ -16,7 +16,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pg-data
namespace: farrisilk
namespace: customer1
spec:
accessModes: [ReadWriteOnce]
storageClassName: local-path
@ -28,9 +28,9 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: pg
namespace: farrisilk
namespace: customer1
spec:
# Parked 2026-11-22 (power budget) — see apps/base/farrisilk/odoo.yaml.
# Parked 2026-11-22 (power budget) — see apps/base/customer1/odoo.yaml.
# Recreate: the data directory must be released before anything restarts.
replicas: 0
strategy:
@ -42,7 +42,7 @@ spec:
metadata:
labels:
app: pg
app.kubernetes.io/part-of: farrisilk
app.kubernetes.io/part-of: customer1
spec:
nodeSelector:
kubernetes.io/hostname: siriussec
@ -131,7 +131,7 @@ apiVersion: v1
kind: Service
metadata:
name: pg
namespace: farrisilk
namespace: customer1
spec:
type: ClusterIP
selector:

View file

@ -7,4 +7,4 @@ resources:
- ../base/sirius-growth
- ../base/osint
- ../base/metabase
- ../base/farrisilk
- ../base/customer1

View file

@ -1,5 +1,5 @@
# Own Gateway for the Farrisilk lab Metabase (:8087) — see
# gateway-farrisilk-odoo.yaml for why one bare-IP service per Gateway.
# Own Gateway for the Customer 1 lab Metabase (:8087) — see
# gateway-customer1-odoo.yaml for why one bare-IP service per Gateway.
#
# This is NOT the evaluation instance in namespace `metabase` (:8085). Same
# reasoning applies to the port choice: one listener port carries exactly one
@ -7,12 +7,12 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: farrisilk-metabase
name: customer1-metabase
namespace: internal
labels:
dedicated: network
annotations:
sirius.dev/purpose: bare-IP listener for the Farrisilk lab Metabase (WireGuard only)
sirius.dev/purpose: bare-IP listener for the Customer 1 lab Metabase (WireGuard only)
spec:
gatewayClassName: cilium
listeners:

View file

@ -12,12 +12,12 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: farrisilk-odoo
name: customer1-odoo
namespace: internal
labels:
dedicated: network
annotations:
sirius.dev/purpose: bare-IP listener for the Farrisilk lab Odoo (WireGuard only)
sirius.dev/purpose: bare-IP listener for the Customer 1 lab Odoo (WireGuard only)
spec:
gatewayClassName: cilium
listeners:

View file

@ -8,8 +8,8 @@
# Ports: 8081 = Grafana (`internal` Gateway listener http-internal),
# 8084 = Hubble UI (`internal` Gateway listener hubble-ui),
# 8085 = Metabase (`metabase` Gateway listener http-internal),
# 8086 = Farrisilk lab Odoo (`farrisilk-odoo` Gateway),
# 8087 = Farrisilk lab Metabase (`farrisilk-metabase` Gateway).
# 8086 = Customer 1 lab Odoo (`customer1-odoo` Gateway),
# 8087 = Customer 1 lab Metabase (`customer1-metabase` Gateway).
# Add a new internal listener port to PORTS; the loop is idempotent, so
# re-running after a port is already firewalled only adds what is missing.
#

View file

@ -1,6 +1,6 @@
#!/usr/sbin/nft -f
# Internal (WireGuard-only) gateway listeners: TCP 8081 (Grafana), 8084
# (Hubble UI), 8085 (Metabase) and 8086/8087 (Farrisilk lab replica: Odoo,
# (Hubble UI), 8085 (Metabase) and 8086/8087 (Customer 1 lab replica: Odoo,
# Metabase).
#
# Cilium's hostNetwork Envoy binds every Gateway listener on 0.0.0.0, so the

View file

@ -5,5 +5,5 @@ resources:
- gateway.yaml
- gateway-hubble-ui.yaml
- gateway-metabase.yaml
- gateway-farrisilk-odoo.yaml
- gateway-farrisilk-metabase.yaml
- gateway-customer1-odoo.yaml
- gateway-customer1-metabase.yaml