43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: garmin-sync
|
|
namespace: garmin
|
|
spec:
|
|
schedule: "0 6 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: garmin-sync
|
|
image: python:3.12-slim
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- pip install garminconnect psycopg2-binary -q && python /scripts/sync.py
|
|
env:
|
|
- name: GARMIN_EMAIL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: garmin-credentials
|
|
key: GARMIN_EMAIL
|
|
- name: GARMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: garmin-credentials
|
|
key: GARMIN_PASSWORD
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: garmin-db-app
|
|
key: uri
|
|
volumeMounts:
|
|
- name: script
|
|
mountPath: /scripts
|
|
volumes:
|
|
- name: script
|
|
configMap:
|
|
name: garmin-sync-script
|