Skip to content

Local dev with echo server#64

Open
piceri wants to merge 3 commits intomainfrom
local-dev-with-echo-server
Open

Local dev with echo server#64
piceri wants to merge 3 commits intomainfrom
local-dev-with-echo-server

Conversation

@piceri
Copy link
Contributor

@piceri piceri commented Mar 20, 2026

Added to Makefile to make local development easier. Runs a local kind cluster with a echo server to mimic artifact metadata response

piceri added 3 commits March 20, 2026 16:01
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
@piceri piceri marked this pull request as ready for review March 20, 2026 20:19
@piceri piceri requested a review from a team as a code owner March 20, 2026 20:19
Copilot AI review requested due to automatic review settings March 20, 2026 20:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Makefile targets to streamline local development by spinning up a kind cluster, deploying a local echo server to mimic artifact metadata responses, and deploying deployment-tracker into the cluster.

Changes:

  • Introduces run-local to orchestrate cluster creation, image build/load, echo server setup, and deployment.
  • Adds cluster / cluster-delete targets for kind lifecycle and namespace setup.
  • Adds deploy, echo, and echo-delete targets for deploying the app and echo server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +7
.PHONY: run-local
run-local: cluster-delete cluster build docker kind-load-image echo deploy
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run-local invokes the docker target, which currently builds a linux/arm64 image. This will fail to run on the common amd64 kind node images (and on most non-ARM developer machines). Consider making the build platform configurable (e.g., PLATFORM ?=) or building for the kind node architecture so run-local works across environments.

Copilot uses AI. Check for mistakes.
.PHONY: deploy
deploy:
@echo "Deploying deployment-tracker to cluster..."
kubectl apply -f deploy/manifest.yaml
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new deploy target applies deploy/manifest.yaml, but that manifest hard-codes image: deployment-tracker:latest rather than using $(IMG). As a result, overriding TAG/REPOSITORY (or using a non-latest tag) will load one image into kind but deploy a different one. Consider templating/patching the manifest during make deploy (e.g., kustomize image override or kubectl set image) so it deploys the built $(IMG).

Suggested change
kubectl apply -f deploy/manifest.yaml
kubectl apply -f deploy/manifest.yaml
@echo "Updating deployment image to ${IMG}..."
kubectl set image deployment/deployment-tracker deployment-tracker=${IMG} -n deployment-tracker

Copilot uses AI. Check for mistakes.
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"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The echo target uses kubectl run ... --restart=Always and then kubectl expose pod artifact-registry .... With --restart=Always, kubectl run creates a Deployment (not a Pod), so kubectl expose pod artifact-registry is likely to fail, and echo-delete (which deletes a Pod) won’t clean up the created Deployment. Consider creating/exposing a Deployment explicitly (and deleting the Deployment), or use a Pod (--restart=Never) and keep the expose/delete commands consistent with the created resource type.

Suggested change
kubectl run artifact-registry --image=ealen/echo-server:latest --port=80 -n artifact-registry --restart=Always --labels="app=artifact-registry"
kubectl run artifact-registry --image=ealen/echo-server:latest --port=80 -n artifact-registry --restart=Never --labels="app=artifact-registry"

Copilot uses AI. Check for mistakes.
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"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The echo server image is referenced as ealen/echo-server:latest. Using latest makes local dev behavior non-reproducible and increases supply-chain risk because the content can change over time. Consider pinning to a specific version and (ideally) a digest, similar to how base images are pinned elsewhere in the repo.

Copilot uses AI. Check for mistakes.
Copy link

@bdehamer bdehamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants