ai-code-battle/manifests/acb-worker-deployment.yml
jedarden 3938afd058 fix(worker): set ACB_B2_REGION to empty string for ARMOR/B2 S3-compatible API
The AWS SDK rejects 'us-east-1' as a region when using a custom S3-compatible
endpoint (ARMOR proxy wrapping Backblaze B2). The B2 client code already
hardcodes config.WithRegion('auto') which is correct for S3-compatible APIs.

This fixes the 'Invalid region: region was not a valid DNS name' error that
was preventing replay uploads to B2.
2026-04-25 09:56:55 -04:00

102 lines
3.3 KiB
YAML

# acb-worker: Match execution worker for AI Code Battle
# BRPOPs jobs from Valkey, runs matches, uploads replays to B2 (armor),
# writes results and Glicko-2 ratings to PostgreSQL.
#
# Staging file — sync to declarative-config/k8s/iad-acb/ai-code-battle/
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: acb-worker
namespace: ai-code-battle
labels:
app.kubernetes.io/component: worker
app.kubernetes.io/name: acb-worker
app.kubernetes.io/part-of: ai-code-battle
annotations:
argocd-image-updater.argoproj.io/image-list: app=ronaldraygun/acb-worker
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
reloader.stakater.com/auto: "true"
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: acb-worker
template:
metadata:
labels:
app.kubernetes.io/component: worker
app.kubernetes.io/name: acb-worker
app.kubernetes.io/part-of: ai-code-battle
annotations:
reloader.stakater.com/auto: "true"
spec:
restartPolicy: Always
containers:
- name: worker
image: ronaldraygun/acb-worker@sha256:edd9616aaefb684a59779ea4b46b2bfe72679eecf6867e1be658273648e86bbe
imagePullPolicy: Always
args:
- "-poll=5s"
- "-heartbeat=30s"
- "-timeout=3s"
ports:
- containerPort: 9090
name: metrics
protocol: TCP
env:
- name: ACB_POSTGRES_USER
valueFrom:
secretKeyRef:
name: acb-postgres-credentials
key: username
- name: ACB_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: acb-postgres-credentials
key: password
- name: ACB_DATABASE_URL
value: "postgresql://$(ACB_POSTGRES_USER):$(ACB_POSTGRES_PASSWORD)@acb-postgres:5432/ai_code_battle?sslmode=disable"
- name: ACB_B2_ENDPOINT
value: "http://armor:9000"
- name: ACB_B2_BUCKET
valueFrom:
secretKeyRef:
name: acb-armor-credentials
key: bucket
- name: ACB_B2_ACCESS_KEY
valueFrom:
secretKeyRef:
name: acb-armor-credentials
key: auth-access-key
- name: ACB_B2_SECRET_KEY
valueFrom:
secretKeyRef:
name: acb-armor-credentials
key: auth-secret-key
- name: ACB_B2_REGION
value: ""
- name: ACB_METRICS_ADDR
value: ":9090"
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
memory: "512Mi"
livenessProbe:
httpGet:
path: /health
port: metrics
initialDelaySeconds: 5
periodSeconds: 30
readinessProbe:
httpGet:
path: /ready
port: metrics
initialDelaySeconds: 5
periodSeconds: 10
imagePullSecrets:
- name: docker-hub-registry