]> git.frustrated-labs.net Git - dotfiles.git/commitdiff
add cron container to squad rotation bot deployment
authorAlexander Goussas <[email protected]>
Wed, 29 Apr 2026 03:01:41 +0000 (22:01 -0500)
committerAlexander Goussas <[email protected]>
Wed, 29 Apr 2026 03:01:41 +0000 (22:01 -0500)
k8s/squad-rotation-bot.yaml

index 6d19bb3178de79bdd873b04c7e7c14d1f45eaee0..07ecf4abe86624b4112d8dcf61510d392012c127 100644 (file)
@@ -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