61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: nve-config
|
|
namespace: cron
|
|
data:
|
|
appsettings.json: |
|
|
{
|
|
"NveUrl": "https://chartserver.nve.no/ShowData.aspx?req=getchart&ver=1.0",
|
|
"DataDir": "/data/hdd/data/river-data"
|
|
}
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: nve
|
|
namespace: cron
|
|
spec:
|
|
schedule: "0 8 * * *" # Everyday at 08:00, use https://crontab.guru
|
|
concurrencyPolicy: "Forbid"
|
|
successfulJobsHistoryLimit: 10
|
|
failedJobsHistoryLimit: 3
|
|
jobTemplate:
|
|
spec:
|
|
backoffLimit: 3
|
|
template:
|
|
spec:
|
|
restartPolicy: "Never"
|
|
containers:
|
|
- name: cronpod
|
|
image: git.oceanbox.io/oceanbox/churn/riverrun:24a8bbbc-debug
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
if riverrun data --download --ndays 5000; then
|
|
chown -R 5000:5000 /data/hdd/data/river-data/Data
|
|
chmod -R g+w /data/hdd/data/river-data/Data
|
|
else
|
|
echo "Job failed, sleeping 30 minutes before retry..."
|
|
sleep 1800
|
|
exit 1
|
|
fi
|
|
resources: {}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
- name: config
|
|
mountPath: /app/appsettings.json
|
|
subPath: appsettings.json
|
|
readOnly: true
|
|
securityContext: {}
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: ekman-data
|
|
- name: config
|
|
configMap:
|
|
name: nve-config
|