From b97ed01975bb3e4dc3c747dcba8f974da73983c8 Mon Sep 17 00:00:00 2001 From: Alexander Goussas Date: Tue, 28 Apr 2026 22:01:41 -0500 Subject: [PATCH] add cron container to squad rotation bot deployment --- k8s/squad-rotation-bot.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 2.43.0