homek8s/apps/base/farrisilk/metabase.yaml
Lance Walters 79206e0487 ops(farrisilk): park the client replica stack to cut siriussec draw
siriussec is on a 15 W USB-C adapter and low-battery-shutdown fired 2026-11-22
04:20. The farrisilk replica (Odoo + Metabase JVM + Postgres) is the largest
single stack on that node and is not client production. Scale its three
Deployments to 0 and suspend the nightly pg_dump; PVCs and data stay put.

Restore: set replicas back to 1 in odoo.yaml, metabase.yaml, postgres.yaml and
unsuspend backup.yaml, then let Flux reconcile.
2026-11-22 05:54:53 -05:00

108 lines
3.2 KiB
YAML

# Metabase for the lab replica — its own state in the SAME plain Postgres
# (database `metabase`), one data source: `farrisilk 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
# instance's 1.5 GiB heap: 1 GiB heap, 2 GiB container limit.
#
# 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
# DB — rotating it makes every stored datasource password undecryptable.
apiVersion: apps/v1
kind: Deployment
metadata:
name: metabase
namespace: farrisilk
spec:
# Parked 2026-11-22 (power budget) — see apps/base/farrisilk/odoo.yaml.
replicas: 0
selector:
matchLabels:
app: metabase
template:
metadata:
labels:
app: metabase
app.kubernetes.io/part-of: farrisilk
spec:
nodeSelector:
kubernetes.io/hostname: siriussec
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
containers:
- name: metabase
image: metabase/metabase:v0.65.6.3
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
env:
- name: JAVA_OPTS
value: "-Xmx1024m"
- name: MB_DB_TYPE
value: postgres
- name: MB_DB_HOST
value: pg.farrisilk.svc.cluster.local
- name: MB_DB_PORT
value: "5432"
- name: MB_DB_DBNAME
value: metabase
- name: MB_DB_USER
value: metabase
- name: MB_DB_PASS
valueFrom:
secretKeyRef:
name: pg-users
key: metabase_password
- name: MB_ENCRYPTION_SECRET_KEY
valueFrom:
secretKeyRef:
name: metabase-secret-key
key: MB_ENCRYPTION_SECRET_KEY
- name: MB_JETTY_PORT
value: "3000"
- name: TZ
value: America/Los_Angeles
readinessProbe:
httpGet:
path: /api/health
port: http
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
livenessProbe:
httpGet:
path: /api/health
port: http
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
# Capped with the main Metabase: see apps/base/metabase/deployment.yaml
cpu: "1"
memory: 2Gi
---
apiVersion: v1
kind: Service
metadata:
name: metabase
namespace: farrisilk
spec:
type: ClusterIP
selector:
app: metabase
ports:
- name: http
port: 3000
targetPort: http
protocol: TCP