Files
poimen-memory/k8s/app/deployment.yaml
rock f452f38546
CI / CI (pull_request) Successful in 11m33s
fix: wire memory-agent-oidc secret + ornith:35b in K8s deployment
- LLM_ENDPOINT points to api.riotpiao.com (not in-cluster reasoning-predictor)
- LLM_MODEL=ornith:35b
- Authentik creds from memory-agent-oidc secret (CLIENT_ID, CLIENT_SECRET, ISSUER, TOKEN_URL)
- Removed stale poimen-memory-auth secretRef
- Removed stale poimen-memory-secrets secretRef (MEM_API_KEY still from it)
- command: ["/app/mem"] present
2026-09-10 09:00:43 +09:00

144 lines
4.3 KiB
YAML

# Poimen Memory API Server
# Serves HTTP endpoints for memory ingest, query, visualization.
# Connects to memory-db (pgvector) + api.riotpiao.com (LLM via Authentik JWT).
apiVersion: apps/v1
kind: Deployment
metadata:
name: poimen-memory
namespace: poimen
labels:
app.kubernetes.io/name: poimen-memory
app.kubernetes.io/component: api-server
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: poimen-memory
template:
metadata:
labels:
app.kubernetes.io/name: poimen-memory
spec:
serviceAccountName: poimen-memory
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 999
fsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: memory
image: forgejo.riotpiao.com/riotpiao-poimen/poimen-memory:latest
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
env:
# Database connection (from CNPG auto-generated secret)
- name: DATABASE_HOST
value: "memory-db-rw.poimen.svc.cluster.local"
- name: DATABASE_PORT
value: "5432"
- name: DATABASE_NAME
value: "memory"
- name: DATABASE_USER
valueFrom:
secretKeyRef:
name: memory-db-app
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: memory-db-app
key: password
- name: DATABASE_URL
value: "postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(DATABASE_NAME)?sslmode=disable"
# LLM via api.riotpiao.com (Authentik JWT auth)
- name: LLM_ENDPOINT
value: "https://api.riotpiao.com/v1/chat/completions"
- name: LLM_API_BASE
value: "https://api.riotpiao.com/v1"
- name: LLM_MODEL
value: "ornith:35b"
# Authentik service account (memory-agent-oidc secret)
- name: AUTHENTIK_ISSUER
valueFrom:
secretKeyRef:
name: memory-agent-oidc
key: ISSUER
- name: AUTHENTIK_CLIENT_ID
valueFrom:
secretKeyRef:
name: memory-agent-oidc
key: CLIENT_ID
- name: AUTHENTIK_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: memory-agent-oidc
key: CLIENT_SECRET
- name: TOKEN_URL
valueFrom:
secretKeyRef:
name: memory-agent-oidc
key: TOKEN_URL
# Server config
- name: MEM_API_KEY
valueFrom:
secretKeyRef:
name: poimen-memory-secrets
key: llm-api-key
- name: MEM_PORT
value: "8080"
- name: MEM_HOME
value: "/tmp"
envFrom:
- configMapRef:
name: poimen-memory-config
command: ["/app/mem"]
args:
- serve
- --port
- "8080"
- --api-key
- "$(MEM_API_KEY)"
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir:
sizeLimit: 64Mi
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule