From: Alexander Goussas Date: Wed, 29 Apr 2026 03:01:41 +0000 (-0500) Subject: add cron container to squad rotation bot deployment X-Git-Url: http://git.frustrated-labs.net/?a=commitdiff_plain;h=b97ed01975bb3e4dc3c747dcba8f974da73983c8;p=dotfiles.git add cron container to squad rotation bot deployment --- diff --git a/k8s/squad-rotation-bot.yaml b/k8s/squad-rotation-bot.yaml index 6d19bb3..07ecf4a 100644 --- a/k8s/squad-rotation-bot.yaml +++ b/k8s/squad-rotation-bot.yaml @@ -12,7 +12,21 @@ spec: labels: app: squad-rotation-bot spec: + volumes: + - name: squad-rotation-crontab-vol + configMap: + name: squad-rotation-crontab-config + items: + - key: crontab + path: crontab containers: + - name: squad-rotation-job + image: ubuntu:22.04 + command: ["/bin/bash"] + args: ["-c", "apt-get update && apt-get install -y cron curl; crontab /apps/crontab; crontab -l; touch /var/log/cron.log; cron; tail /var/log/cron.log -f"] + volumeMounts: + - name: squad-rotation-crontab-vol + mountPath: /apps - name: squad-rotation-bot image: aloussase69/squad-rotation-bot:latest ports: @@ -32,6 +46,14 @@ data: # You can replace this with envsubst # ex: envsubst < squal-rotation-bot.yaml | kubectl apply -f - web-hook-url: ${WEB_HOOK_URL} +-- +apiVersion: v1 +kind: ConfigMap +metadata: + name: squad-rotation-crontab-config +data: + crontab: | + 0 12 * * 1-5 curl "http://squad-rotation-bot:8080/api/v1/rotation/trigger" >> /var/log/cron.log 2>&1 --- apiVersion: v1 kind: Service