gitpod/dev/preview/portforward-monitoring-satellite-core-dev.sh
Mads Hartmann afa2bd1cb8 Allow for branch name lengths of 45
This relaxes the branch name restriction from 20 characters to 45. This is achieved by constructing the preview name based on the first 10 characters of the branch name and then the first 10 characters of the hashed value of the branch name.

All places that (to my knowledge) rely on the preview name has been updated.

Fixes https://github.com/gitpod-io/ops/issues/1252
2022-03-11 13:50:18 +05:30

25 lines
805 B
Bash
Executable File

#!/usr/bin/env bash
#
# Exposes Prometheus and Grafana's UI
#
source ./dev/preview/util/preview-name-from-branch.sh
PREVIEW_NAME="$(preview-name-from-branch)"
NAMESPACE="staging-${PREVIEW_NAME}"
function log {
echo "[$(date)] $*"
}
pkill -f "kubectl port-forward (.*)3000:3000"
kubectl port-forward --context=dev -n "${NAMESPACE}" svc/grafana "3000:3000" > /dev/null 2>&1 &
pkill -f "kubectl port-forward (.*)9090:9090"
kubectl port-forward --context=dev -n "${NAMESPACE}" svc/prometheus-k8s "9090:9090" > /dev/null 2>&1 &
log "Please follow the link to access Prometheus' UI: $(gp url 9090)"
log "Please follow the link to access Grafanas' UI: $(gp url 3000)"
echo ""
log "If they are not accessible, make sure to re-run the Werft job with the following annotation: 'with-observability=true'"