The bot-seeder Deployment runs a shell script at startup that: - Checks GET /api/bots and skips any bot already registered (idempotent) - Waits for each bot's /health endpoint before registering - POSTs to /api/register with name, owner=system, and cluster-internal endpoint_url - Captures the returned shared_secret and upserts acb-bot-<name>-secret via the K8s REST API - Sleeps forever after all 6 bots are registered Also adds reloader.stakater.com/auto: "true" to all 6 bot Deployments so Reloader triggers a rolling restart when the seeder writes/updates their secrets, ensuring pods pick up the correct BOT_SECRET for HMAC validation. RBAC: bot-seeder ServiceAccount + Role (get/create/patch secrets) + RoleBinding. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
# bot-random: RandomBot — Python strategy bot
|
|
# Makes uniformly random valid moves each turn. Rating floor / easiest opponent.
|
|
# HTTP server on port 8080, POST /turn, GET /health.
|
|
#
|
|
# Staging file — sync to declarative-config/k8s/iad-acb/acb-bots/
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: bot-random
|
|
namespace: acb-bots
|
|
labels:
|
|
app.kubernetes.io/name: bot-random
|
|
app.kubernetes.io/part-of: ai-code-battle
|
|
app.kubernetes.io/component: strategy-bot
|
|
annotations:
|
|
argocd-image-updater.argoproj.io/image-list: app=ronaldraygun/acb-bot-random
|
|
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: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: bot-random
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: bot-random
|
|
app.kubernetes.io/part-of: ai-code-battle
|
|
app.kubernetes.io/component: strategy-bot
|
|
spec:
|
|
restartPolicy: Always
|
|
imagePullSecrets:
|
|
- name: docker-hub-registry
|
|
containers:
|
|
- name: bot
|
|
image: ronaldraygun/acb-bot-random:sha-placeholder
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: BOT_PORT
|
|
value: "8080"
|
|
- name: BOT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-bot-random-secret
|
|
key: shared-secret
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 30
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 3
|
|
periodSeconds: 10
|
|
failureThreshold: 3
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
limits:
|
|
memory: 64Mi
|