Moved from using Kubernetes' internal Cron scheduler to a pod based one due to unforeseen hangups. Also added a check if the MySQL server is available before continuing

This commit is contained in:
florian committed 2026-09-30 13:20:38 +00:00
1 parent 5f131c3bd9
commit 7674a9c64b
10 files changed
+237

No files matched your search

@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: service-royalroad-chapters-cron
namespace: app-notifications
spec:
serviceName: service-royalroad-chapters-cron
replicas: 1
selector:
matchLabels:
app: service-royalroad-chapters-cron
template:
metadata:
labels:
app: service-royalroad-chapters-cron
spec:
containers:
- name: cron
image: curlimages/curl:latest
command:
- /bin/sh
- -c
- |
echo "{\"timestamp\":\"$(date '+%Y-%m-%dT%H:%M:%S%z')\",\"event\":\"startup\"}"
while true; do
echo "{\"timestamp\":\"$(date '+%Y-%m-%dT%H:%M:%S%z')\",\"event\":\"curl start\"}"
curl -s -X GET --max-time 150 http://service-royalroad-chapters-internal:5000/royalroad
echo
echo "{\"timestamp\":\"$(date '+%Y-%m-%dT%H:%M:%S%z')\",\"event\":\"curl end\"}"
sleep 300
done