Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,16 @@ install-maestro: check-helm check-kubectl check-maestro-namespace ## Install Mae
.PHONY: create-maestro-consumer
create-maestro-consumer: check-kubectl ## Create a Maestro consumer (requires Maestro server running)
@echo "Creating Maestro consumer '$(MAESTRO_CONSUMER)'..."
@kubectl delete pod maestro-consumer-create --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG) --ignore-not-found >/dev/null 2>&1
@kubectl run maestro-consumer-create --restart=Never \
--namespace $(MAESTRO_NS) \
--kubeconfig $(KUBECONFIG) \
--image=curlimages/curl:latest -- \
curl -sf -X POST \
-H "Content-Type: application/json" \
http://maestro.$(MAESTRO_NS).svc.cluster.local:8000/api/maestro/v1/consumers \
-d '{"name": "$(MAESTRO_CONSUMER)"}'
@kubectl wait --for=condition=Ready pod/maestro-consumer-create --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG) --timeout=60s 2>/dev/null || true
@kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/maestro-consumer-create --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG) --timeout=60s
@kubectl logs maestro-consumer-create --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG)
@kubectl delete pod maestro-consumer-create --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG) --ignore-not-found >/dev/null 2>&1
@for i in 1 2 3 4 5; do \
kubectl exec deploy/maestro --namespace $(MAESTRO_NS) --kubeconfig $(KUBECONFIG) -- \
curl -sSf -X POST \
-H "Content-Type: application/json" \
http://maestro.$(MAESTRO_NS).svc.cluster.local:8000/api/maestro/v1/consumers \
-d '{"name": "$(MAESTRO_CONSUMER)"}' && exit 0; \
echo " Attempt $$i failed, retrying in 5s..."; \
sleep 5; \
done; \
echo "ERROR: failed to create Maestro consumer after 5 attempts"; exit 1
@echo ""
@echo "OK: consumer '$(MAESTRO_CONSUMER)' created"

Expand Down