From 4770a3491f9a7848c3c3bf608f98f0dd1bda13c0 Mon Sep 17 00:00:00 2001 From: Eric Pickard Date: Fri, 20 Mar 2026 16:01:46 -0400 Subject: [PATCH 1/3] update Makefile to allow for easy local development with echo server Signed-off-by: Eric Pickard --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Makefile b/Makefile index c520f37..20d49c9 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ TAG ?= latest IMG := $(REPOSITORY):$(TAG) CLUSTER = kind +.PHONY: run-local +run-local: cluster-delete cluster build docker kind-load-image echo deploy + .PHONY: build build: go build -o deployment-tracker cmd/deployment-tracker/main.go @@ -15,6 +18,13 @@ docker: kind-load-image: kind load docker-image ${IMG} --name ${CLUSTER} +.PHONY: deploy +deploy: + @echo "Deploying deployment-tracker to cluster..." + kubectl apply -f deploy/manifest.yaml + @echo "Deployment complete. Waiting for deployment to be ready..." + kubectl rollout status deployment/deployment-tracker -n deployment-tracker --timeout=60s + fmt: go fmt ./... @@ -26,3 +36,35 @@ integration-test: test-short: go test -short ./... + +.PHONY: cluster +cluster: + @echo "Creating kind cluster: ${CLUSTER}" + kind create cluster --name ${CLUSTER} + @echo "Creating namespaces..." + kubectl create namespace test1 + kubectl create namespace test2 + kubectl create namespace test3 + @echo "Kind cluster '${CLUSTER}' created with namespaces: dev, staging, prod" + +.PHONY: cluster-delete +cluster-delete: + @echo "Deleting kind cluster: ${CLUSTER}" + kind delete cluster --name ${CLUSTER} + +# adds an echo server to the cluster that deployment tracker can point to to simulate 200 response +.PHONY: echo +echo: + @echo "Deploying echo server to artifact-registry namespace..." + kubectl create namespace artifact-registry --dry-run=client -o yaml | kubectl apply -f - + kubectl run artifact-registry --image=ealen/echo-server:latest --port=80 -n artifact-registry --restart=Always --labels="app=artifact-registry" || true + kubectl expose pod artifact-registry --port=9090 --target-port=80 --name=artifact-registry -n artifact-registry --type=ClusterIP || true + @echo "Echo server deployed and reachable at http://artifact-registry.artifact-registry.svc.cluster.local:9090" + +.PHONY: echo-delete +echo-delete: + @echo "Deleting echo server from artifact-registry namespace..." + kubectl delete service artifact-registry -n artifact-registry --ignore-not-found=true + kubectl delete pod artifact-registry -n artifact-registry --ignore-not-found=true + kubectl delete namespace artifact-registry --ignore-not-found=true + @echo "Echo server deleted" \ No newline at end of file From 0d5e129c1cadebd93822b3a260b17718c7e229a0 Mon Sep 17 00:00:00 2001 From: Eric Pickard Date: Fri, 20 Mar 2026 16:06:46 -0400 Subject: [PATCH 2/3] fix typo Signed-off-by: Eric Pickard --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 20d49c9..1afa5c8 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ cluster: kubectl create namespace test1 kubectl create namespace test2 kubectl create namespace test3 - @echo "Kind cluster '${CLUSTER}' created with namespaces: dev, staging, prod" + @echo "Kind cluster '${CLUSTER}' created with namespaces: test1, test2, test3" .PHONY: cluster-delete cluster-delete: From 0214ded50074b3f76d094a6dc8aa45086b4a8e4c Mon Sep 17 00:00:00 2001 From: Eric Pickard Date: Fri, 20 Mar 2026 16:15:15 -0400 Subject: [PATCH 3/3] fix typos, cleanup Signed-off-by: Eric Pickard --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1afa5c8..3faaf94 100644 --- a/Makefile +++ b/Makefile @@ -42,9 +42,9 @@ cluster: @echo "Creating kind cluster: ${CLUSTER}" kind create cluster --name ${CLUSTER} @echo "Creating namespaces..." - kubectl create namespace test1 - kubectl create namespace test2 - kubectl create namespace test3 + kubectl create namespace test1 --dry-run=client -o yaml | kubectl apply -f - + kubectl create namespace test2 --dry-run=client -o yaml | kubectl apply -f - + kubectl create namespace test3 --dry-run=client -o yaml | kubectl apply -f - @echo "Kind cluster '${CLUSTER}' created with namespaces: test1, test2, test3" .PHONY: cluster-delete @@ -57,8 +57,8 @@ cluster-delete: echo: @echo "Deploying echo server to artifact-registry namespace..." kubectl create namespace artifact-registry --dry-run=client -o yaml | kubectl apply -f - - kubectl run artifact-registry --image=ealen/echo-server:latest --port=80 -n artifact-registry --restart=Always --labels="app=artifact-registry" || true - kubectl expose pod artifact-registry --port=9090 --target-port=80 --name=artifact-registry -n artifact-registry --type=ClusterIP || true + kubectl run artifact-registry --image=ealen/echo-server:latest --port=80 -n artifact-registry --restart=Always --labels="app=artifact-registry" + kubectl expose pod artifact-registry --port=9090 --target-port=80 --name=artifact-registry -n artifact-registry --type=ClusterIP @echo "Echo server deployed and reachable at http://artifact-registry.artifact-registry.svc.cluster.local:9090" .PHONY: echo-delete @@ -67,4 +67,4 @@ echo-delete: kubectl delete service artifact-registry -n artifact-registry --ignore-not-found=true kubectl delete pod artifact-registry -n artifact-registry --ignore-not-found=true kubectl delete namespace artifact-registry --ignore-not-found=true - @echo "Echo server deleted" \ No newline at end of file + @echo "Echo server deleted"