68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: myorg-morning-briefing
|
|
namespace: default
|
|
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: myorg-assistant:latest
|
|
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
|