2026-08-23 00:01:30 -07:00
|
|
|
# Poimen Memory API Server
|
|
|
|
|
# Serves 7 HTTP endpoints for memory ingest, query, and management.
|
|
|
|
|
# Connects to memory-db (pgvector) for persistent storage.
|
|
|
|
|
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:
|
2026-08-30 07:20:08 -07:00
|
|
|
serviceAccountName: poimen-memory
|
|
|
|
|
securityContext:
|
|
|
|
|
runAsNonRoot: true
|
|
|
|
|
runAsUser: 1000
|
|
|
|
|
runAsGroup: 999
|
|
|
|
|
fsGroup: 999
|
|
|
|
|
seccompProfile:
|
|
|
|
|
type: RuntimeDefault
|
2026-08-23 00:01:30 -07:00
|
|
|
containers:
|
|
|
|
|
- name: memory
|
|
|
|
|
image: forgejo.riotpiao.com/rock/poimen-memory:latest
|
2026-08-30 07:20:08 -07:00
|
|
|
securityContext:
|
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
|
capabilities:
|
|
|
|
|
drop:
|
|
|
|
|
- ALL
|
2026-08-23 00:01:30 -07:00
|
|
|
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 Gateway API key
|
|
|
|
|
- name: MEM_API_KEY
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: poimen-memory-secrets
|
|
|
|
|
key: llm-api-key
|
|
|
|
|
# Server config
|
|
|
|
|
- name: MEM_PORT
|
|
|
|
|
value: "8080"
|
|
|
|
|
- name: MEM_HOME
|
2026-08-30 07:23:18 -07:00
|
|
|
value: "/tmp"
|
2026-08-23 00:01:30 -07:00
|
|
|
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:
|
2026-08-30 07:20:08 -07:00
|
|
|
- name: tmp
|
|
|
|
|
mountPath: /tmp
|
2026-08-23 00:01:30 -07:00
|
|
|
volumes:
|
2026-08-30 07:20:08 -07:00
|
|
|
- name: tmp
|
|
|
|
|
emptyDir:
|
|
|
|
|
sizeLimit: 64Mi
|
2026-08-23 00:01:30 -07:00
|
|
|
# Tolerate control-plane nodes
|
|
|
|
|
tolerations:
|
|
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
|
operator: Exists
|
|
|
|
|
effect: NoSchedule
|