Files
homelab/k8s/apps/poimen/frontend-deployment.yaml
T
rock 227839c27a feat(poimen): consolidate into single multi-source ArgoCD app
- Merge poimen-workflows + poimen-memory + db + frontend into one app
- Delete duplicate apps: poimen-workflows, poimen-memory-app (kubectl done)
- Delete poimen-memory ArgoCD app file (replaced by multi-source source 2)
- Delete poimen-memory-database (replaced by source 3 → k8s/infra/poimen/)
- Move memory-db CNPG cluster to k8s/infra/poimen/ (isolated from other tenants)
- Remove memory-db from k8s/infra/databases/kustomization.yaml
- Add frontend manifests (Deployment, Service, Ingress) to k8s/apps/poimen/
- Add frontend NetworkPolicy: egress to api-gw (api:8080), memory (poimen:8080),
  Gotify (notifications:80), Authentik (iam:9000/9443), DNS (kube-system:53)
- Sync-wave -1 on CNPG cluster ensures DB ready before app pods (wave 0)
- Image updater: workflows + memory + frontend tracked in one annotation block
- poimen-toolkit stays separate (CRD management, independent rollback)
2026-09-28 08:51:31 +08:00

115 lines
3.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: poimen-frontend
namespace: poimen
labels:
app: poimen-frontend
app.kubernetes.io/name: poimen-frontend
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: poimen
annotations:
argocd.argoproj.io/sync-wave: "0"
reloader.stakater.com/auto: "true"
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: poimen-frontend
template:
metadata:
labels:
app: poimen-frontend
app.kubernetes.io/name: poimen-frontend
# Admitted by llm-serving-default-deny NetworkPolicy (port 8080).
# Required for server-side LLM calls through api-gw.
llm-client: "true"
spec:
imagePullSecrets:
- name: forgejo-registry
securityContext:
runAsNonRoot: true
runAsUser: 1001
fsGroup: 1001
containers:
- name: frontend
image: forgejo.riotpiao.com/riotpiao-poimen/poimen-frontend:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
protocol: TCP
env:
# In-cluster api-gw (server-side only — never exposed to browser)
- name: LLM_API_URL
value: "http://api-gateway.api.svc.cluster.local:8080"
# Memory service (co-located in poimen namespace)
- name: POIMEN_MEMORY_URL
valueFrom:
configMapKeyRef:
name: poimen-config
key: POIMEN_MEMORY_URL
# OIDC — uses same client as existing poimen services
- name: LLM_OIDC_TOKEN_URL
valueFrom:
secretKeyRef:
name: poimen-secrets
key: OIDC_TOKEN_URL
- name: LLM_OIDC_CLIENT_ID
valueFrom:
secretKeyRef:
name: poimen-oauth2-creds
key: client_id
- name: LLM_OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: poimen-oauth2-creds
key: client_secret
- name: LLM_OIDC_SCOPE
value: "openid llm_inference"
# NextAuth
- name: NEXTAUTH_URL
value: "https://poimen.riotpiao.com"
- name: NEXTAUTH_SECRET
valueFrom:
secretKeyRef:
name: poimen-secrets
key: NEXTAUTH_SECRET
# Gotify (server-side notifications + HITL messages)
- name: GOTIFY_URL
value: "http://gotify.notifications.svc.cluster.local"
- name: GOTIFY_TOKEN
valueFrom:
secretKeyRef:
name: poimen-secrets
key: GOTIFY_TOKEN
# Public env — embedded in browser bundle at build time
- name: NEXT_PUBLIC_API_URL
value: "https://api.riotpiao.com"
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 512Mi
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 3