Skip to content

Commit

Permalink
Merge pull request #128 from oskoperator/feature/make-dev-deploy-better
Browse files Browse the repository at this point in the history
feat(make): make wait for services better
  • Loading branch information
Hy3n4 authored Sep 24, 2024
2 parents 78983ff + e1aadd1 commit cd377d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ $(ENVTEST): $(LOCALBIN)
deploydev:
@$(KUBECTL) apply -R -f devel/
@echo "Waiting for services to come online for the port-forwards..."
@sleep 5
@until [ "$$($(KUBECTL) get pods -l app=grafana -o jsonpath='{.items}')}" != "[]" ] && \
[ "$$($(KUBECTL) get pods -l app=grafana -o jsonpath='{.items[0].status.containerStatuses[0].ready}')" == "true" ]; do \
echo "Waiting for Grafana to be ready..." && sleep 2; \
done
@until [ "$$($(KUBECTL) get pods -l app=mimir -o jsonpath='{.items}')}" != "[]" ] && \
[ "$$($(KUBECTL) get pods -l app=mimir -o jsonpath='{.items[0].status.containerStatuses[0].ready}')" == "true" ]; do \
echo "Waiting for Mimir to be ready..." && sleep 2; \
done
@echo "Services are ready. Setting up port-forwards..."
@$(KUBECTL) port-forward svc/grafana 3000:3000 > /dev/null 2>&1 &
@$(KUBECTL) port-forward svc/mimir-service 9009:9009 >/dev/null 2>&1 &
@echo "Port-forwards activated. Reach Grafana on port 3000 and Mimir on port 9009."
Expand Down

0 comments on commit cd377d4

Please sign in to comment.