homek8s/apps/base/farrisilk/metabase.yaml

106 lines
3.1 KiB
YAML
Raw Normal View History

# 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:
replicas: 1
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:
cpu: "2"
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