forked from roger/k3s-cluster
CronJobs referenced bare image 'myorg-assistant:latest' which cannot be pulled, causing all scheduled jobs to sit in ImagePullBackOff. Pin to the same image used by the Deployment.
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: myorg-waiting-followup
|
|
namespace: myorg-assistant
|
|
labels:
|
|
app: myorg-assistant
|
|
job: waiting-followup
|
|
spec:
|
|
# Run every Monday at 9:00 AM
|
|
schedule: "0 9 * * 1"
|
|
timeZone: "Europe/Madrid"
|
|
successfulJobsHistoryLimit: 2
|
|
failedJobsHistoryLimit: 2
|
|
concurrencyPolicy: Forbid
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: myorg-assistant
|
|
job: waiting-followup
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: waiting-followup
|
|
image: git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- python
|
|
- run_job.py
|
|
- waiting-followup
|
|
env:
|
|
- name: MYORG_REPO_PATH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: myorg-assistant-config
|
|
key: MYORG_REPO_PATH
|
|
- name: DISCORD_BOT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: DISCORD_BOT_TOKEN
|
|
- name: DISCORD_CHANNEL_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: DISCORD_CHANNEL_ID
|
|
- name: LITELLM_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: LITELLM_API_KEY
|
|
volumeMounts:
|
|
- name: myorg-data
|
|
mountPath: /data/myorg
|
|
volumes:
|
|
- name: myorg-data
|
|
persistentVolumeClaim:
|
|
claimName: myorg-assistant-pvc
|