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:
# 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