Changed from pod based Cron job back to Kubernetes CronJob because it now needs an API key
This commit is contained in:
1 parent
df24ecc08e
commit
1fb4a2f7d5
4 files changed
+70
-62
No files matched your search
@@ -0,0 +1,35 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: royalroad-chapters-update-rr
|
||||
spec:
|
||||
schedule: "5-59/10 * * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 1
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: curl
|
||||
image: curlimages/curl
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- >
|
||||
curl -fsS --max-time 120 -X POST
|
||||
-H "Authorization: Bearer $(cat /etc/secrets/scheduler_key)"
|
||||
http://service-royalroad-chapters-internal:5000/royalroad
|
||||
volumeMounts:
|
||||
- name: key
|
||||
mountPath: /etc/secrets
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: key
|
||||
secret:
|
||||
secretName: service-royalroad-chapters
|
||||
items:
|
||||
- key: scheduler_key
|
||||
path: scheduler_key
|
||||
Reference in new issue
Block a user