infra/kubernetes/piped/CronJob-piped-refresh.yaml

40 lines
1.2 KiB
YAML
Raw Normal View History

apiVersion: batch/v1
kind: CronJob
metadata:
annotations:
kubenix/k8s-version: "1.30"
kubenix/project-name: kubenix
labels:
kubenix/hash: e672eb08bf0db5ef675b3b6036ca047f43b4614f
name: piped-refresh
namespace: piped
spec:
jobTemplate:
spec:
template:
spec:
containers:
- command:
- /bin/bash
- -c
- >
curl -o /dev/null "https://healthchecks.gmem.ca/ping/$HEALTHCHECKS_UUID/start"
export PGPASSWORD=$password &&
export subs=$(psql -U piped -h 192.168.50.236 -qtAX -c 'select id from public.pubsub;') &&
while IFS= read -r line; do
echo "refreshing $line"
curl -k -o /dev/null "http://piped-backend:8080/channel/$line"
done < <(printf '%s' "$subs")
curl -o /dev/null "https://healthchecks.gmem.ca/ping/$HEALTHCHECKS_UUID"
envFrom:
- secretRef:
name: postgres-piped
2024-07-20 12:48:46 +01:00
image: git.gmem.ca/arch/kutils
name: refresh-subscriptions
restartPolicy: Never
schedule: "*/30 * * * *"