diff --git a/service-royalroad-chapters/service-royalroad-chapters-cron-gitea.yaml b/service-royalroad-chapters/service-royalroad-chapters-cron-gitea.yaml new file mode 100644 index 0000000..b0957c9 --- /dev/null +++ b/service-royalroad-chapters/service-royalroad-chapters-cron-gitea.yaml @@ -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/gitea + echo + echo "{\"timestamp\":\"$(date '+%Y-%m-%dT%H:%M:%S%z')\",\"event\":\"curl end\"}" + sleep 300 + done