Skip to content

Commit

Permalink
feat(makefile): automatic port-forwards with dev env deployment (#119)
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Opletal <[email protected]>
  • Loading branch information
fourstepper authored Jun 24, 2024
1 parent 31b96e7 commit ebdaeef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ $(ENVTEST): $(LOCALBIN)

.PHONY: deploydev
deploydev:
$(KUBECTL) apply -R -f devel/
@$(KUBECTL) apply -R -f devel/
@echo "Waiting for services to come online for the port-forwards..."
@sleep 5
@$(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."
@echo "Enjoy!"

.PHONY: undeploydev
undeploydev:
$(KUBECTL) delete -R -f devel/

.PHONY: forwardsvcdev
forwardsvcdev:
$(KUBECTL) port-forward svc/grafana 3000:3000 2>&1 > /dev/null &
$(KUBECTL) port-forward svc/mimir-service 9009:9009 2>&1 >/dev/null &
@$(KUBECTL) delete -R -f devel/ 2>/dev/null || true && echo "All resources are already deleted, skipping..."
@for pf in mimir-service grafana; do (pkill -f "port-forward svc/$$pf" || true && echo "The $$pf port-forward process is now killed..."); done
@echo "All done. Goodbye!"
4 changes: 0 additions & 4 deletions config/crd/bases/osko.dev_alertmanagerconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ spec:
spec:
description: AlertManagerConfigSpec defines the desired state of AlertManagerConfig
properties:
raw:
additionalProperties:
type: string
type: object
secretRef:
description: |-
SecretReference represents a Secret Reference. It has enough information to retrieve secret
Expand Down

0 comments on commit ebdaeef

Please sign in to comment.