Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Add waiting for prom in port-forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
EliiseS committed Mar 15, 2020
1 parent 069cb9e commit 578c19f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hack/portforwards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@
ps aux | grep [k]ubectl | awk '{print $2}' | xargs kill > /dev/null 2>&1

echo "-------> Verify all pods up"
echo "-------> Wait for Operator to be ready"

# Ensure there are no Databricks Operator pods not in the Ready state
echo "-------> Wait for Operator to be ready"
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n azure-databricks-operator-system -lcontrol-plane=controller-manager get pods -o jsonpath="$JSONPATH" 2>&1 | grep -q -v "Ready=False"; do sleep 5;echo "--------> waiting for all operators to be Ready"; kubectl get pods -n azure-databricks-operator-system; done
echo "-------> Wait for MockAPI to be ready"

# Ensure there are no MockAPI pods not in the Ready state
echo "-------> Wait for MockAPI to be ready"
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n databricks-mock-api -lapp=databricks-mock-api get pods -o jsonpath="$JSONPATH" 2>&1 | grep -q -v "Ready=fALSE"; do sleep 5;echo "--------> waiting for all mocks to be Ready"; kubectl get pods -n databricks-mock-api; done

# Ensure there are no locust pods not in the Ready state
echo "-------> Wait for locust to be ready"
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n locust get pods -lapp=locust-loadtest -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 5;echo "--------> waiting for locust to be available"; kubectl get pods -n locust; done

# Ensure there are no prometheus pods not in the Ready state
echo "-------> Wait for prometheus to be ready"
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n default get pods -lapp=prometheus -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 5;echo "--------> waiting for prometheus to be available"; kubectl get pods -n default; done

echo "-------> Open port-forwards"
kubectl port-forward service/prom-azure-databricks-operator-grafana -n default 8080:80 &
kubectl port-forward service/prom-azure-databricks-oper-prometheus -n default 9091:9090 &
Expand Down

0 comments on commit 578c19f

Please sign in to comment.