homelab/apps/finance/services/api/k8s/deployment.yaml
Gonçalo Rodrigues 292b2f46f0 fix(finance): seed admin account in finance_users on startup (#37)
SeedAdmin now creates the finance_users account from ADMIN_EMAIL /
ADMIN_PASSWORD env vars if it doesn't exist, so a fresh cluster
bootstraps a working login without manual registration.

Wires ADMIN_EMAIL and ADMIN_PASSWORD into the deployment from the
finance-api-secrets k8s secret (optional — pod still starts without it).

Also gitignores /main build artifact and *.test binaries.

Co-authored-by: Gonçalo Rodrigues <guga@Goncalos-MacBook-Pro.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:43:59 +01:00

69 lines
1.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: finance
labels:
app: api
spec:
replicas: 1
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
imagePullSecrets:
- name: gitea-registry
containers:
- name: api
image: homelab/finance-api
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
env:
- name: PORT
value: "8080"
- name: LOG_LEVEL
value: "info"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "jaeger.monitoring.svc:4317"
- name: BASE_URL
value: "https://finance.homelab.local"
- name: ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: finance-api-secrets
key: ADMIN_EMAIL
optional: true
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: finance-api-secrets
key: ADMIN_PASSWORD
optional: true
envFrom:
- secretRef:
name: mongodb-shared-config
- secretRef:
name: finance-api-secrets
optional: true
livenessProbe:
httpGet:
path: /healthz
port: http
readinessProbe:
httpGet:
path: /readyz
port: http
resources:
requests:
cpu: "50m"
memory: "32Mi"
limits:
cpu: "200m"
memory: "128Mi"