mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 10:13:58 +00:00
Diagnostics:
diag_gitlab_boot.sh, diag_gitlab_webservice_oom.sh, diag_gke_storage.sh
Utilities:
ensure_default_storage_class.sh — set/verify default StorageClass
preflight_kubecontext.sh — validate kubecontext before ops
onboard_engineer.sh — new engineer onboarding script
gen_oidc_signing_key.sh — generate OIDC signing key
fetch_prole_secrets.sh — pull secrets from vault
set-k3s-token-1password.sh — store k3s token in 1Password
sync_cnpg_grafana_dashboard.py — sync CNPG dashboard to Grafana
Config/certs:
krb5.local.conf, knoe-db-ca.crt
Updated: build-a-bao.sh, hostprobe-*.yaml, hosts.txt, knoe-db-passwwd.sh,
repair_pipeline.sh, status.sh, status_common_services.sh
Co-authored-by: Junie <junie@jetbrains.com>
92 lines
1.9 KiB
Bash
Executable File
92 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# repair_pipeline.sh
|
|
# Purpose:
|
|
# - Thin wrapper around the Python-native cluster repair logic.
|
|
#
|
|
# The real orchestration now lives in `knoe/core/actions.py` and is
|
|
# invoked through `knoe/core/repair_pipeline_cli.py`.
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
ROOT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
|
|
|
SERVICE_NAMESPACE=""
|
|
DB_NAMESPACE=""
|
|
MODE=""
|
|
CFG_PATH=""
|
|
|
|
usage() {
|
|
cat <<'USAGE'
|
|
Usage: repair_pipeline.sh [-n|--namespace NS] [--db-namespace NS] [-m|--mode MODE] [--config PATH] [repair]
|
|
|
|
Runs a best-effort repair pass across common services and cluster add-ons.
|
|
USAGE
|
|
}
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
-m|--mode)
|
|
shift
|
|
MODE="${1:-}"
|
|
;;
|
|
-m=*|--mode=*)
|
|
MODE="${1#*=}"
|
|
;;
|
|
-n|--namespace)
|
|
shift
|
|
SERVICE_NAMESPACE="${1:-}"
|
|
;;
|
|
-n=*|--namespace=*)
|
|
SERVICE_NAMESPACE="${1#*=}"
|
|
;;
|
|
--db-namespace)
|
|
shift
|
|
DB_NAMESPACE="${1:-}"
|
|
;;
|
|
--db-namespace=*)
|
|
DB_NAMESPACE="${1#*=}"
|
|
;;
|
|
--config)
|
|
shift
|
|
CFG_PATH="${1:-}"
|
|
;;
|
|
--config=*)
|
|
CFG_PATH="${1#*=}"
|
|
;;
|
|
repair)
|
|
# Backwards-compatible positional arg; no-op.
|
|
;;
|
|
-h|--help)
|
|
usage
|
|
exit 0
|
|
;;
|
|
*)
|
|
usage
|
|
exit 2
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
export KNOE_HOME="${KNOE_HOME:-$ROOT_DIR}"
|
|
export KNOE_CONF="${KNOE_CONF:-${CFG_PATH:-$KNOE_HOME/conf}}"
|
|
|
|
# Ensure local imports work when invoked from a copied script location.
|
|
export PYTHONPATH="$ROOT_DIR${PYTHONPATH:+:$PYTHONPATH}"
|
|
|
|
args=()
|
|
if [[ -n "$SERVICE_NAMESPACE" ]]; then
|
|
args+=("--namespace" "$SERVICE_NAMESPACE")
|
|
fi
|
|
if [[ -n "$DB_NAMESPACE" ]]; then
|
|
args+=("--db-namespace" "$DB_NAMESPACE")
|
|
fi
|
|
if [[ -n "$MODE" ]]; then
|
|
args+=("--mode" "$MODE")
|
|
fi
|
|
args+=("--config" "$KNOE_CONF")
|
|
|
|
exec python3 -m knoe.core.repair_pipeline_cli "${args[@]}"
|