ai-code-battle/manifests/acb-api-deployment.yml
jedarden a06129132e feat(k8s): add deployment manifests for acb-evolver and acb-api per §9.2
Staging manifests for sync to declarative-config/k8s/apexalgo-iad/ai-code-battle/:
- acb-evolver: Deployment + ServiceAccount with LLM/PG/R2 secrets
- acb-api: Deployment + Service + IngressRoute for api.ai-code-battle.ardenone.com

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 13:50:20 -04:00

121 lines
3.1 KiB
YAML

# acb-api: HTTP API server for AI Code Battle
# Bot registration, job coordination, replay serving, bot profiles,
# leaderboards, predictions, and community feedback.
# Connects to PostgreSQL (CNPG) and Valkey (Redis-compatible).
#
# Staging file — sync to declarative-config/k8s/apexalgo-iad/ai-code-battle/
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: acb-api
namespace: ai-code-battle
labels:
app.kubernetes.io/name: acb-api
app.kubernetes.io/part-of: ai-code-battle
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: acb-api
template:
metadata:
labels:
app.kubernetes.io/name: acb-api
app.kubernetes.io/part-of: ai-code-battle
spec:
restartPolicy: Always
containers:
- name: api
image: ronaldraygun/acb-api:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
env:
- name: ACB_LISTEN_ADDR
value: ":8080"
- name: ACB_DATABASE_URL
valueFrom:
secretKeyRef:
name: acb-app-credentials-acb-app
key: uri
- name: ACB_VALKEY_ADDR
value: "valkey-master.valkey.svc.cluster.local:6379"
- name: ACB_VALKEY_PASSWORD
valueFrom:
secretKeyRef:
name: keydb-secret
key: password
optional: true
- name: ACB_WORKER_API_KEY
valueFrom:
secretKeyRef:
name: acb-api-secrets
key: worker-api-key
- name: ACB_ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: acb-api-secrets
key: encryption-key
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 15
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3
imagePullSecrets:
- name: docker-hub-registry
---
apiVersion: v1
kind: Service
metadata:
name: acb-api
namespace: ai-code-battle
labels:
app.kubernetes.io/name: acb-api
app.kubernetes.io/part-of: ai-code-battle
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: acb-api
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: acb-api
namespace: ai-code-battle
labels:
app.kubernetes.io/name: acb-api
app.kubernetes.io/part-of: ai-code-battle
spec:
entryPoints:
- websecure
routes:
- match: Host(`api.ai-code-battle.ardenone.com`)
kind: Rule
services:
- name: acb-api
port: 80
tls:
certResolver: letsencrypt