- b2-crown-jewels.sh: sync diario 04:00 de las 2 copias mas recientes de cada servicio irremplazable (todo menos uptime-kuma) a b2:chemavx-k3s-backups/crown-jewels/ (~2GB, tier gratuito). - reddit-intel.sh sube tambien a B2 (retencion 3d). - verify.sh comprueba Mega (completo) + B2 (crown jewels). - Config via Secret out-of-band rclone-conf-b2 (mega+b2, kubectl, NO git); consolidar en Infisical RCLONE_CONF cuando se anada [b2] por UI (la identity del operator es read-only por API). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: reddit-intel-backup
|
|
namespace: backup-system
|
|
spec:
|
|
# Único CronJob de backup que corre en n97: /opt/reddit-intel vive fuera de k3s
|
|
# (Docker en el host) y su cron local escribe en el mismo disco.
|
|
schedule: "15 3 * * *"
|
|
concurrencyPolicy: Forbid
|
|
failedJobsHistoryLimit: 2
|
|
successfulJobsHistoryLimit: 3
|
|
jobTemplate:
|
|
spec:
|
|
backoffLimit: 1
|
|
activeDeadlineSeconds: 1800
|
|
template:
|
|
spec:
|
|
nodeSelector:
|
|
kubernetes.io/hostname: chemavx-n97
|
|
restartPolicy: Never
|
|
securityContext:
|
|
runAsUser: 0
|
|
containers:
|
|
- name: rclone
|
|
# OJO: imagen BusyBox — el script debe evitar GNU-ismos
|
|
image: docker.io/rclone/rclone:1.74.3
|
|
command: ["/bin/sh", "/scripts/reddit-intel.sh"]
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
volumeMounts:
|
|
- mountPath: /opt/reddit-intel
|
|
name: reddit-intel
|
|
readOnly: true
|
|
- mountPath: /rclone
|
|
name: rclone-conf
|
|
- mountPath: /scripts
|
|
name: scripts
|
|
volumes:
|
|
- name: reddit-intel
|
|
hostPath:
|
|
path: /opt/reddit-intel
|
|
type: Directory
|
|
# rclone-conf-b2: secret out-of-band con mega+b2 (sube a los dos)
|
|
- name: rclone-conf
|
|
secret:
|
|
secretName: rclone-conf-b2
|
|
items:
|
|
- key: RCLONE_CONF
|
|
path: rclone.conf
|
|
- name: scripts
|
|
configMap:
|
|
name: backup-scripts
|
|
defaultMode: 0755
|