File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change 13
13
14
14
NAMESPACE=" preview-${VM_NAME} "
15
15
16
- function log {
17
- echo " [$( date) ] $* "
18
- }
16
+ echo "
17
+ Starting port-forwarding:
19
18
20
- pkill -f " kubectl port-forward (.*)3000:3000"
21
- kubectl port-forward --context=harvester -n " ${NAMESPACE} " svc/proxy " 3000:3000" > /dev/null 2>&1 &
19
+ Prometheus:
20
+ $( gp url 9090)
21
+
22
+ Grafana:
23
+ $( gp url 3000)
24
+
25
+ "
22
26
27
+ # This is just a bit of extra safety to ensure that no other port-forwards are running
28
+ # e.g. maybe you forgot you had it running in another terminal etc.
29
+ pkill -f " kubectl port-forward (.*)3000:3000"
23
30
pkill -f " kubectl port-forward (.*)9090:9090"
24
- kubectl port-forward --context=harvester -n " ${NAMESPACE} " svc/proxy " 9090:9090" > /dev/null 2>&1 &
25
31
26
- log " Please follow the link to access Prometheus' UI: $( gp url 9090) "
27
- log " Please follow the link to access Grafanas' UI: $( gp url 3000) "
28
- echo " "
29
- log " If they are not accessible, make sure to re-run the Werft job with the following annotation: 'with-vm=true'"
32
+ # We're using xargs here to run the commands in parallel. This has two benefits as xargs
33
+ #
34
+ # 1. Will show the stdout/stderr of both processes, making it easier to diagnose issues
35
+ # 2. Deals with process termination. If you ^C this script xargs will kill the underlying
36
+ # . processes.
37
+ #
38
+ echo " 3000:3000 9090:9090" | xargs -n 1 -P 2 kubectl port-forward --context=harvester -n " ${NAMESPACE} " svc/proxy
You can’t perform that action at this time.
0 commit comments