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.
68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: myorg-morning-briefing
|
|
namespace: myorg-assistant
|
|
labels:
|
|
app: myorg-assistant
|
|
job: morning-briefing
|
|
spec:
|
|
# Run at 8:00 AM every day (adjust for your timezone)
|
|
schedule: "0 8 * * *"
|
|
timeZone: "Europe/Madrid"
|
|
successfulJobsHistoryLimit: 3
|
|
failedJobsHistoryLimit: 3
|
|
concurrencyPolicy: Forbid
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: myorg-assistant
|
|
job: morning-briefing
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: morning-briefing
|
|
image: git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- python
|
|
- run_job.py
|
|
- morning-briefing
|
|
env:
|
|
# From ConfigMap
|
|
- name: MYORG_REPO_PATH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: myorg-assistant-config
|
|
key: MYORG_REPO_PATH
|
|
- name: TIMEZONE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: myorg-assistant-config
|
|
key: TIMEZONE
|
|
# From Secret
|
|
- 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
|