Initial commit: k8s cluster manifests and scripts

This commit is contained in:
2026-04-01 15:34:02 +08:00
commit 2f04fa4473
49 changed files with 4109 additions and 0 deletions

23
apps/opengist/backup.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
BACKUP_DIR="./backup"
TIMESTAMP=$(date +"%Y%m%d-%H%M")
BACKUP_FILE="${BACKUP_DIR}/opengist-${TIMESTAMP}.tar.gz"
mkdir -p "${BACKUP_DIR}"
echo "📦 Creating backup: ${BACKUP_FILE}"
POD=$(kubectl get pod -l app=opengist -o jsonpath='{.items[0].metadata.name}')
if [ -z "${POD}" ]; then
echo "❌ OpenGist pod not found"
exit 1
fi
kubectl exec "${POD}" -- \
tar czf - /opengist > "${BACKUP_FILE}"
echo "✅ Backup completed: ${BACKUP_FILE}"