Skip to content

Commit

Permalink
test(smoketest): place Grafana dashboard behind oauth proxy (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Jan 10, 2024
1 parent b1f30c3 commit 7ca92cb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
11 changes: 10 additions & 1 deletion smoketest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ OPEN_TABS=${OPEN_TABS:-false}

CRYOSTAT_HTTP_PORT=8080
USE_PROXY=${USE_PROXY:-true}
DEPLOY_GRAFANA=false

display_usage() {
echo "Usage:"
Expand Down Expand Up @@ -50,6 +51,7 @@ while getopts "hs:prgtOVXcb" opt; do
;;
g)
FILES+=("${DIR}/smoketest/compose/cryostat-grafana.yml" "${DIR}/smoketest/compose/jfr-datasource.yml")
DEPLOY_GRAFANA=true
;;
t)
FILES+=("${DIR}/smoketest/compose/sample-apps.yml")
Expand Down Expand Up @@ -78,13 +80,20 @@ while getopts "hs:prgtOVXcb" opt; do
;;
esac
done
export CRYOSTAT_HTTP_PORT

if [ "${USE_PROXY}" = "true" ]; then
FILES+=("${DIR}/smoketest/compose/auth_proxy.yml")
CRYOSTAT_HTTP_PORT=8181
GRAFANA_DASHBOARD_EXT_URL=http://localhost:8080/grafana/
else
FILES+=("${DIR}/smoketest/compose/no_proxy.yml")
if [ "${DEPLOY_GRAFANA}" = "true" ]; then
FILES+=("${DIR}/smoketest/compose/grafana_no_proxy.yml")
fi
GRAFANA_DASHBOARD_EXT_URL=http://grafana:3000/
fi
export CRYOSTAT_HTTP_PORT
export GRAFANA_DASHBOARD_EXT_URL

s3Manifest="${DIR}/smoketest/compose/s3-${s3}.yml"

Expand Down
3 changes: 3 additions & 0 deletions smoketest/compose/auth_proxy_alpha_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ upstreamConfig:
- id: cryostat
path: /
uri: http://cryostat:8181
- id: grafana
path: /grafana/
uri: http://grafana:3000
providers:
- id: dummy
name: Unused - Sign In Below
Expand Down
7 changes: 4 additions & 3 deletions smoketest/compose/cryostat-grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"
services:
cryostat:
environment:
- GRAFANA_DASHBOARD_EXT_URL=http://localhost:3000
- GRAFANA_DASHBOARD_EXT_URL=${GRAFANA_DASHBOARD_EXT_URL:-http://localhost:3000/}
- GRAFANA_DASHBOARD_URL=http://grafana:3000
grafana:
image: ${GRAFANA_DASHBOARD_IMAGE:-quay.io/cryostat/cryostat-grafana-dashboard:latest}
Expand All @@ -16,9 +16,10 @@ services:
environment:
- GF_INSTALL_PLUGINS=grafana-simple-json-datasource
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_SERVER_DOMAIN=localhost
- GF_SERVER_ROOT_URL=http://localhost:8080/grafana/
- GF_SERVER_SERVE_FROM_SUB_PATH=true
- JFR_DATASOURCE_URL=http://jfr-datasource:8080
ports:
- "3000:3000"
expose:
- "3000"
healthcheck:
Expand Down
13 changes: 13 additions & 0 deletions smoketest/compose/grafana_no_proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"
services:
cryostat:
environment:
- GRAFANA_DASHBOARD_EXT_URL=${GRAFANA_DASHBOARD_EXT_URL:-http://localhost:3000/}
- GRAFANA_DASHBOARD_URL=http://grafana:3000
grafana:
ports:
- '3000:3000'
environment:
- GF_SERVER_DOMAIN=
- GF_SERVER_ROOT_URL=
- GF_SERVER_SERVE_FROM_SUB_PATH=false

0 comments on commit 7ca92cb

Please sign in to comment.