activity-core/k8s/railiance/bootstrap-secrets.sh
tegwick 6ce77a72bb
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Document ACTIVITY-WP-0026-T07 railiance deploy checklist.
Add deploy-ops-run-queue-railiance.md (image, migrate 0007, smoke, dual-path
residual), wire OPS_RUN_* into runtime ConfigMap, and cross-link runbook/README.
T07 stays open until prod smoke is executed.
2026-08-03 19:30:00 +02:00

48 lines
1.7 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
NS="${NS:-activity-core}"
kubectl apply -f k8s/railiance/00-namespace.yaml
secret_exists() {
kubectl -n "$NS" get secret "$1" >/dev/null 2>&1
}
random_password() {
openssl rand -base64 32 | tr -d '\n'
}
if ! secret_exists actcore-app-db-secret; then
APP_DB_PASSWORD="$(random_password)"
kubectl -n "$NS" create secret generic actcore-app-db-secret \
--from-literal=username=actcore \
--from-literal=database=actcore \
--from-literal=password="$APP_DB_PASSWORD"
else
APP_DB_PASSWORD="$(kubectl -n "$NS" get secret actcore-app-db-secret -o jsonpath='{.data.password}' | base64 -d)"
fi
if ! secret_exists actcore-temporal-db-secret; then
kubectl -n "$NS" create secret generic actcore-temporal-db-secret \
--from-literal=username=temporal \
--from-literal=database=temporal \
--from-literal=password="$(random_password)"
fi
ACTCORE_DB_URL="postgresql+asyncpg://actcore:${APP_DB_PASSWORD}@actcore-app-db:5432/actcore"
if ! secret_exists actcore-runtime-secret; then
kubectl -n "$NS" create secret generic actcore-runtime-secret \
--from-literal=ACTCORE_DB_URL="$ACTCORE_DB_URL" \
--from-literal=WEBHOOK_SECRET_GITEA="" \
--from-literal=WEBHOOK_SECRET_GITHUB="" \
--from-literal=OPS_HUB_KEY=""
fi
# ISSUE_CORE_API_KEY is merged into actcore-runtime-secret by ExternalSecret
# actcore-issue-core-runtime (k8s/railiance/15-externalsecret-issue-core.yaml).
# Apply that manifest after ClusterSecretStore openbao-activity-core is Ready.
#
# Optional (ACTIVITY-WP-0026 / REIN-A-0002): patch ACTIVITY_CORE_WORKER_TOKEN and
# ACTIVITY_CORE_OPERATOR_TOKEN into actcore-runtime-secret — see
# docs/deploy-ops-run-queue-railiance.md. Not auto-generated here.