homelab/apps/finance/services/api/k8s/deployment.yaml
Gonçalo Rodrigues 3b294e2e82 feat(cicd): add GitHub Actions deploy workflow for finance-api
- deploy.yml: on push to main, builds linux/arm64 image, pushes to
  Gitea registry, deploys via SSH kubectl set image
- ci.yml: gate to PRs targeting main only
- finance-api deployment: imagePullPolicy Always so SHA-tagged images
  are always pulled on rollout

Requires GitHub Actions secrets: GITEA_REGISTRY_PASSWORD, VPS_HOST,
VPS_USER, VPS_SSH_KEY.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 23:05:38 +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: Always
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.gugagr.xyz"
- 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"