Files
riotpiao.com/infra/portfolio/base/deployment.yaml
T
Story Crater Bot aa61bbe484 fix: add LLM_API_URL and LLM_MODEL to portfolio deployment
Problem: Portfolio pod had OAuth credentials (AUTHENTIK_CLIENT_ID/SECRET)
but was missing LLM_API_URL and LLM_MODEL environment variables.
Chat API could fetch tokens but had no endpoint to call.

Solution: Inject LLM configuration via k8s deployment env vars:
- LLM_API_URL: https://api.riotpiao.com/v1/chat/completions
- LLM_MODEL: qwen2.5:3b-instruct

Testing:
- Token fetch: ✓ portfolio-agent OAuth works
- DNS: ✓ api.riotpiao.com resolves (CoreDNS rewrite)
- Auth: ⚠️  JWT issuer mismatch (portfolio-agent vs api-gw) — separate issue

Impact: Chat API endpoint can now attempt LLM calls with valid auth
2026-09-06 06:08:40 -07:00

77 lines
2.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: portfolio
namespace: portfolio
labels:
app.kubernetes.io/name: portfolio
app.kubernetes.io/component: web
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: portfolio
template:
metadata:
labels:
app.kubernetes.io/name: portfolio
spec:
containers:
- name: portfolio
image: forgejo.riotpiao.com/rock/portfolio:latest
imagePullPolicy: Always
env:
- name: FORGEJO_TOKEN
valueFrom:
secretKeyRef:
name: portfolio-secrets
key: FORGEJO_TOKEN
# OAuth credentials for LLM API (client_credentials grant)
- name: AUTHENTIK_CLIENT_ID
valueFrom:
secretKeyRef:
name: portfolio-agent-oidc
key: CLIENT_ID
- name: AUTHENTIK_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: portfolio-agent-oidc
key: CLIENT_SECRET
- name: AUTHENTIK_TOKEN_URL
valueFrom:
secretKeyRef:
name: portfolio-agent-oidc
key: TOKEN_URL
# LLM API configuration
- name: LLM_API_URL
value: "https://api.riotpiao.com/v1/chat/completions"
- name: LLM_MODEL
value: "qwen2.5:3b-instruct"
ports:
- name: http
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 2
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi