Files
cannaiq/k8s/registry-sync-cronjob.yaml
Kelly de239df314 fix(k8s): update registry-sync to use registry.spdy.io
Use registry.spdy.io instead of internal IP for base image syncing.
Add library/busybox:latest to the sync list.
2025-12-16 22:17:44 -07:00

56 lines
1.8 KiB
YAML

# Daily job to sync base images from Docker Hub to local registry
# Runs at 3 AM daily to refresh the cache before rate limits reset
apiVersion: batch/v1
kind: CronJob
metadata:
name: registry-sync
namespace: woodpecker
spec:
schedule: "0 3 * * *" # 3 AM daily
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: sync
image: gcr.io/go-containerregistry/crane:latest
command:
- /bin/sh
- -c
- |
set -e
echo "=== Registry Sync: $(date) ==="
REGISTRY="registry.spdy.io"
# Base images to cache (source of truth for all K8s deployments)
# Add new images here - all deployments should use registry.spdy.io/library/*
IMAGES="
library/busybox:latest
library/node:20-slim
library/node:22-slim
library/node:22
library/node:22-alpine
library/node:20-alpine
library/alpine:latest
library/nginx:alpine
bitnami/kubectl:latest
"
for img in $IMAGES; do
echo "Syncing docker.io/$img -> $REGISTRY/$img"
crane copy "docker.io/$img" "$REGISTRY/$img" || echo "WARN: Failed $img"
done
echo "=== Sync complete ==="
resources:
limits:
memory: "256Mi"
cpu: "200m"
requests:
memory: "128Mi"
cpu: "100m"