ai-code-battle/manifests/acb-api-deployment.yml
jedarden 978bcffc91 fix(manifests): pin all ronaldraygun images to SHA digests, add image-updater annotations
Replace :latest with @sha256: digest for acb-api, acb-evolver, acb-index-builder,
acb-matchmaker, and acb-worker. Add argocd-image-updater annotations to all five
deployments to auto-track future sha-* tag builds. Add missing deployment manifests
for index-builder, matchmaker, and worker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 23:07:29 -04:00

137 lines
3.8 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
annotations:
argocd-image-updater.argoproj.io/image-list: app=ronaldraygun/acb-api
argocd-image-updater.argoproj.io/app.update-strategy: name
argocd-image-updater.argoproj.io/app.allow-tags: 'regexp:^sha-[0-9a-f]+$'
argocd-image-updater.argoproj.io/write-back-method: argocd
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@sha256:82e20d034f4098442b094bd6590673b09f8bbd78c5c5f5e1f5079c677564dc83
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 9090
protocol: TCP
name: metrics
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
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9090"
prometheus.io/path: "/metrics"
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: acb-api
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
- port: 9090
targetPort: 9090
protocol: TCP
name: metrics
---
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