#!/usr/bin/env bash # tunnel-grafana.sh [local_port] — SSH tunnel to Grafana (and Prometheus / MinIO console) on the data node. # Grafana is bound to 10.68.0.1:3000 (private link only); nothing is exposed publicly. # http://localhost:3000 Grafana (admin / GRAFANA_ADMIN_PASSWORD from deploy/.env.data) # http://localhost:9090 Prometheus # http://localhost:9001 MinIO console (MINIO_ROOT_USER / MINIO_ROOT_PASSWORD) source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" port="${1:-3000}" log "tunnel: localhost:$port → $DATA_PRIVATE_IP:3000 (grafana), :9090 (prometheus), :9001 (minio console) via $(host_for data) — Ctrl-C to close" ( sleep 1.5; command -v open >/dev/null && open "http://localhost:$port" ) & exec ssh -N "${SSH_OPTS[@]}" \ -L "$port:$DATA_PRIVATE_IP:3000" \ -L "9090:$DATA_PRIVATE_IP:9090" \ -L "9001:$DATA_PRIVATE_IP:9001" \ "$(host_for data)"