forked from roger/k3s-cluster
All 5 CronJob manifests (deadline-checker, evening-summary, git-sync, morning-briefing, waiting-followup) referenced 'myorg-assistant:latest' —a bare local image name that doesn't exist on any node. The main Deployment already uses git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf. Changes per cronjob: - image: myorg-assistant:latest → git.rogi.casa/.../myorg-assistant:fcf79bf - imagePullPolicy: IfNotPresent → Always (match Deployment) - Add imagePullSecrets: gitea-registry (required for private registry) This fixes 4 pods stuck in ImagePullBackOff for ~6+ hours.
78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: myorg-git-sync
|
|
namespace: myorg-assistant
|
|
labels:
|
|
app: myorg-assistant
|
|
job: git-sync
|
|
spec:
|
|
# Run every 15 minutes
|
|
schedule: "*/15 * * * *"
|
|
timeZone: "Europe/Madrid"
|
|
successfulJobsHistoryLimit: 1
|
|
failedJobsHistoryLimit: 2
|
|
concurrencyPolicy: Forbid
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: myorg-assistant
|
|
job: git-sync
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
imagePullSecrets:
|
|
- name: gitea-registry
|
|
containers:
|
|
- name: git-sync
|
|
image: git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf
|
|
imagePullPolicy: Always
|
|
command:
|
|
- python
|
|
- run_job.py
|
|
- git-sync
|
|
env:
|
|
- name: MYORG_REPO_PATH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: myorg-assistant-config
|
|
key: MYORG_REPO_PATH
|
|
- name: GIT_BRANCH
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: myorg-assistant-config
|
|
key: GIT_BRANCH
|
|
- name: GIT_REPO_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: GIT_REPO_URL
|
|
- name: GIT_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: GIT_USERNAME
|
|
- name: GIT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: GIT_TOKEN
|
|
- name: DISCORD_BOT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: myorg-assistant-secret
|
|
key: DISCORD_BOT_TOKEN
|
|
- 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
|