Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c141898c71 | |||
| 43976cb1a1 | |||
| c6f3eab1d8 |
@@ -0,0 +1,62 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: pelican-pg-backup
|
||||
namespace: backups
|
||||
spec:
|
||||
schedule: "0 2 * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 3
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: pg-dump
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
- name: PGPASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pelican-pg-backup-credentials
|
||||
key: password
|
||||
- name: PGHOST
|
||||
value: postgres.pelican.svc.cluster.local
|
||||
- name: PGUSER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pelican-pg-backup-credentials
|
||||
key: username
|
||||
- name: PGDATABASE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pelican-pg-backup-credentials
|
||||
key: database
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
BACKUP_DIR=/backups/pelican
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
FILENAME="$BACKUP_DIR/pelican-$(date +%Y%m%d-%H%M%S).sql.gz"
|
||||
pg_dump -h "$PGHOST" -U "$PGUSER" -d "$PGDATABASE" | gzip > "$FILENAME"
|
||||
echo "Backup written: $FILENAME"
|
||||
find "$BACKUP_DIR" -name '*.sql.gz' -mtime +7 -delete
|
||||
echo "Retention cleanup done (keeping 7 days)"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- name: backup-storage
|
||||
mountPath: /backups
|
||||
volumes:
|
||||
- name: backup-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: backup-storage
|
||||
@@ -2,7 +2,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: transmission
|
||||
namespace: media
|
||||
namespace: apps
|
||||
labels:
|
||||
app: transmission
|
||||
spec:
|
||||
@@ -10,76 +10,58 @@ spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: transmission
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: transmission
|
||||
spec:
|
||||
containers:
|
||||
- name: gluetun
|
||||
image: ghcr.io/qmcgaw/gluetun:v3.40.0
|
||||
env:
|
||||
- name: OPENVPN_PROVIDER
|
||||
value: "PROTONVPN"
|
||||
- name: OPENVPN_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transmission-vpn-secret
|
||||
key: username
|
||||
- name: OPENVPN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: transmission-vpn-secret
|
||||
key: password
|
||||
- name: SERVER_COUNTRIES
|
||||
value: "US"
|
||||
- name: FIREWALL_ENABLED
|
||||
value: "off"
|
||||
- name: DOT_ENABLED
|
||||
value: "true"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: transmission
|
||||
image: lscr.io/linuxserver/transmission:latest
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 9091
|
||||
protocol: TCP
|
||||
- name: peer
|
||||
containerPort: 51413
|
||||
protocol: TCP
|
||||
- name: peer-udp
|
||||
containerPort: 51413
|
||||
protocol: UDP
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1000"
|
||||
- name: PGID
|
||||
value: "1000"
|
||||
- name: TZ
|
||||
value: "America/New_York"
|
||||
- name: USER
|
||||
value: "admin"
|
||||
- name: PASS
|
||||
value: "admin"
|
||||
value: "Etc/UTC"
|
||||
- name: TRANSMISSION_WEB_HOME
|
||||
value: "/combui"
|
||||
- name: PEER_PORT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: transmission-config
|
||||
key: peer-port
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 9091
|
||||
- name: peer
|
||||
containerPort: 0
|
||||
protocol: TCP
|
||||
- name: peer-udp
|
||||
containerPort: 0
|
||||
protocol: UDP
|
||||
value: "/web/":"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: gluetun
|
||||
image: qmcgaw/gluetun:latest
|
||||
env:
|
||||
- name: VPN_SERVICE_PROVIDER
|
||||
value: "protonvpn"
|
||||
- name: VPN_TYPE
|
||||
value: "wireguard"
|
||||
ports:
|
||||
- name: https
|
||||
containerPort: 443
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
emptyDir: {}
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: media-data
|
||||
claimName: transmission-config-claim
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: transmission-data-claim
|
||||
Reference in New Issue
Block a user