# 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_R2_ENDPOINT valueFrom: secretKeyRef: name: acb-r2-credentials key: endpoint - name: ACB_R2_BUCKET valueFrom: secretKeyRef: name: acb-r2-credentials key: bucket - name: ACB_R2_ACCESS_KEY valueFrom: secretKeyRef: name: acb-r2-credentials key: access-key - name: ACB_R2_SECRET_KEY valueFrom: secretKeyRef: name: acb-r2-credentials key: secret-key - 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