43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: &app cloudflare-ddns
|
|
namespace: default
|
|
spec:
|
|
schedule: "@hourly"
|
|
concurrencyPolicy: Forbid
|
|
successfulJobsHistoryLimit: 1
|
|
failedJobsHistoryLimit: 2
|
|
jobTemplate:
|
|
spec:
|
|
ttlSecondsAfterFinished: 3600
|
|
template:
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: *app
|
|
image: ghcr.io/onedr0p/kubernetes-kubectl:1.25.3@sha256:e1f54416c4f8779f748ba4a8d7d48d489b584e8963ee8b84310e19d6e2f0430e
|
|
envFrom:
|
|
- secretRef:
|
|
name: *app
|
|
command:
|
|
- "/bin/bash"
|
|
- &scriptPath "/app/cloudflare-ddns.sh"
|
|
volumeMounts:
|
|
- name: *app
|
|
mountPath: *scriptPath
|
|
subPath: &scriptName cloudflare-ddns.sh
|
|
readOnly: true
|
|
volumes:
|
|
- name: *app
|
|
projected:
|
|
defaultMode: 0775
|
|
sources:
|
|
- configMap:
|
|
name: *app
|
|
items:
|
|
- key: *scriptName
|
|
path: *scriptName
|