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
258
apps/base/farrisilk/odoo.yaml
Normal file
258
apps/base/farrisilk/odoo.yaml
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
# Odoo 18 — the application half of the Farrisilk 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
|
||||
# unplanned upgrade of a database you may be auditing.
|
||||
#
|
||||
# This image already ships wkhtmltopdf 0.12.6.1 (patched Qt) at
|
||||
# /usr/local/bin/wkhtmltopdf, so PDF reports/ invoices render without a derived
|
||||
# image. Verified 2026-11-22 — see README.
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: odoo-data
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
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
|
||||
# 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.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: odoo-extra-addons
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: odoo
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: odoo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: odoo
|
||||
app.kubernetes.io/part-of: farrisilk
|
||||
spec:
|
||||
# Envoy has to reach the backend on the same node it serves from, and the
|
||||
# filestore PVC is local-path (siriussec-only anyway).
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: siriussec
|
||||
tolerations:
|
||||
- key: dedicated
|
||||
operator: Exists
|
||||
effect: PreferNoSchedule
|
||||
initContainers:
|
||||
# Odoo has no env-var support for db_password, so the config file is
|
||||
# rendered from the ConfigMap template + the Secret on every pod start
|
||||
# into an emptyDir. Runs as root only to fix PVC ownership (the image
|
||||
# user is uid 100 / gid 101 and local-path hands out root-owned dirs).
|
||||
- name: render-config
|
||||
image: odoo:18.0-20261112
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
command:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
- |
|
||||
mkdir -p /mnt/extra-addons /var/lib/odoo /etc/odoo-runtime
|
||||
chown -R 100:101 /var/lib/odoo /mnt/extra-addons
|
||||
chmod 0755 /mnt/extra-addons
|
||||
umask 077
|
||||
cat > /etc/odoo-runtime/odoo.conf <<EOF
|
||||
[options]
|
||||
admin_passwd = ${ODOO_ADMIN_PASSWD}
|
||||
addons_path = /mnt/extra-addons,/mnt/enterprise-addons,/usr/lib/python3/dist-packages/odoo/addons
|
||||
data_dir = /var/lib/odoo
|
||||
db_host = ${DB_HOST}
|
||||
db_port = ${DB_PORT}
|
||||
db_name = farrisilk
|
||||
db_user = odoo
|
||||
db_password = ${ODOO_DB_PASSWORD}
|
||||
dbfilter = ^farrisilk\$
|
||||
list_db = False
|
||||
proxy_mode = True
|
||||
workers = 0
|
||||
limit_memory_hard = 1610612736
|
||||
limit_memory_soft = 1342177280
|
||||
max_cron_threads = 1
|
||||
log_level = info
|
||||
log_handler = :INFO
|
||||
xmlrpc_port = 8069
|
||||
EOF
|
||||
chown 100:101 /etc/odoo-runtime/odoo.conf
|
||||
env:
|
||||
- name: DB_HOST
|
||||
value: pg
|
||||
- name: DB_PORT
|
||||
value: "5432"
|
||||
- name: ODOO_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-users
|
||||
key: odoo_password
|
||||
- name: ODOO_ADMIN_PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-config
|
||||
key: admin_passwd
|
||||
volumeMounts:
|
||||
- name: runtime-config
|
||||
mountPath: /etc/odoo-runtime
|
||||
- name: data
|
||||
mountPath: /var/lib/odoo
|
||||
- name: extra-addons
|
||||
mountPath: /mnt/extra-addons
|
||||
# "Init once". Idempotent: reinstalls nothing when the database already
|
||||
# has tables, but always re-applies the BI grants/revokes and the admin
|
||||
# credentials. Script lives in ConfigMap odoo-init.
|
||||
- name: init-db
|
||||
image: odoo:18.0-20261112
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["python3", "/opt/init/init_db.py"]
|
||||
env:
|
||||
- name: DB_HOST
|
||||
value: pg
|
||||
- name: DB_PORT
|
||||
value: "5432"
|
||||
- name: ODOO_DB_NAME
|
||||
value: farrisilk
|
||||
- name: PG_SUPERUSER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-app
|
||||
key: username
|
||||
- name: PG_SUPERPASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-app
|
||||
key: password
|
||||
- name: ODOO_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pg-users
|
||||
key: odoo_password
|
||||
- name: ODOO_ADMIN_LOGIN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-admin
|
||||
key: email
|
||||
- name: ODOO_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-admin
|
||||
key: password
|
||||
- name: TZ
|
||||
value: America/Los_Angeles
|
||||
volumeMounts:
|
||||
- name: runtime-config
|
||||
mountPath: /etc/odoo-runtime
|
||||
- name: data
|
||||
mountPath: /var/lib/odoo
|
||||
- name: extra-addons
|
||||
mountPath: /mnt/extra-addons
|
||||
- name: enterprise-addons
|
||||
mountPath: /mnt/enterprise-addons
|
||||
- name: init-script
|
||||
mountPath: /opt/init
|
||||
containers:
|
||||
- name: odoo
|
||||
image: odoo:18.0-20261112
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["odoo"]
|
||||
args: ["-c", "/etc/odoo-runtime/odoo.conf"]
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8069
|
||||
env:
|
||||
- name: TZ
|
||||
value: America/Los_Angeles
|
||||
- name: HOST
|
||||
value: 0.0.0.0
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /web/login
|
||||
port: http
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 4
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
# workers=0 is a single process; the config's limit_memory_hard is
|
||||
# 1.5 GiB, below this container limit, so Odoo throttles itself
|
||||
# before the kernel OOM-kills the pod.
|
||||
limits:
|
||||
memory: 2Gi
|
||||
volumeMounts:
|
||||
- name: runtime-config
|
||||
mountPath: /etc/odoo-runtime
|
||||
- name: data
|
||||
mountPath: /var/lib/odoo
|
||||
- name: extra-addons
|
||||
mountPath: /mnt/extra-addons
|
||||
- name: enterprise-addons
|
||||
mountPath: /mnt/enterprise-addons
|
||||
volumes:
|
||||
- name: runtime-config
|
||||
emptyDir: {}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: odoo-data
|
||||
- name: extra-addons
|
||||
persistentVolumeClaim:
|
||||
claimName: odoo-extra-addons
|
||||
# Empty, unused until the Enterprise licence question is answered. It
|
||||
# exists so /mnt/enterprise-addons is already on addons_path the day an
|
||||
# EE addons tree is dropped in, without a manifest change.
|
||||
- name: enterprise-addons
|
||||
emptyDir: {}
|
||||
- name: init-script
|
||||
configMap:
|
||||
name: odoo-init
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: odoo
|
||||
namespace: farrisilk
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: odoo
|
||||
ports:
|
||||
- name: http
|
||||
port: 8069
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
Loading…
Reference in a new issue