fix(core): 🐛 remove template vars from secrets-backup — use K8s secrets directly
The deploy workflow does not have BACKUP_ENCRYPTION_KEY/BACKUP_BUCKET/OBS_ENDPOINT env vars. Redesigned to reference existing forgejo-cloud-credentials K8s secret and hardcode OBS endpoint, matching the pattern of forgejo-s3-backup-cronjob. Ref: IPCEICIS-9317
This commit is contained in:
parent
863bcd4883
commit
b087dac0f1
1 changed files with 10 additions and 5 deletions
|
|
@ -36,7 +36,9 @@ metadata:
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
encryption-passphrase: "{{{ .Env.BACKUP_ENCRYPTION_KEY }}}"
|
# IMPORTANT: Replace this placeholder with a strong passphrase per environment.
|
||||||
|
# This secret should be managed via external-secrets or manually set after initial deploy.
|
||||||
|
encryption-passphrase: "CHANGE-ME-SET-PER-ENVIRONMENT"
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
|
|
@ -77,10 +79,13 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: secrets-backup-config
|
name: secrets-backup-config
|
||||||
key: encryption-passphrase
|
key: encryption-passphrase
|
||||||
- name: BACKUP_BUCKET
|
- name: SOURCE_BUCKET
|
||||||
value: "{{{ .Env.BACKUP_BUCKET }}}"
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: forgejo-cloud-credentials
|
||||||
|
key: bucket-name
|
||||||
- name: OBS_ENDPOINT
|
- name: OBS_ENDPOINT
|
||||||
value: "{{{ .Env.OBS_ENDPOINT }}}"
|
value: "obs.eu-de.otc.t-systems.com"
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
|
|
@ -115,7 +120,7 @@ spec:
|
||||||
|
|
||||||
echo "=== Uploading to OBS ==="
|
echo "=== Uploading to OBS ==="
|
||||||
aws s3 cp "${ENCRYPTED}" \
|
aws s3 cp "${ENCRYPTED}" \
|
||||||
"s3://${BACKUP_BUCKET}/secrets-backup/${TIMESTAMP}/secrets-backup.tar.gz.enc" \
|
"s3://${SOURCE_BUCKET}/cluster-secrets-backup/${TIMESTAMP}/secrets-backup.tar.gz.enc" \
|
||||||
--endpoint-url "https://${OBS_ENDPOINT}"
|
--endpoint-url "https://${OBS_ENDPOINT}"
|
||||||
|
|
||||||
echo "=== Cleanup ==="
|
echo "=== Cleanup ==="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue