11# These can be overidden with env vars.
2- REGISTRY ?= rofrano
2+ REGISTRY ?= cluster-registry:32000
33IMAGE_NAME ?= hitcounter
44IMAGE_TAG ?= 1.0
55IMAGE ?= $(REGISTRY ) /$(IMAGE_NAME ) :$(IMAGE_TAG )
66PLATFORM ?= "linux/amd64,linux/arm64"
77CLUSTER ?= nyu-devops
88
9+ .SILENT :
10+
911.PHONY : help
1012help : # # Display this help.
1113 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
@@ -50,19 +52,22 @@ run: ## Run the service
5052 $(info Starting service...)
5153 honcho start
5254
55+ .PHONY : secret
56+ secret : # # Generate a secret hex key
57+ $(info Generating a new secret key...)
58+ python3 -c ' import secrets; print(secrets.token_hex())'
59+
5360# #@ Kubernetes
5461
5562.PHONY : cluster
5663cluster : # # Create a K3D Kubernetes cluster with load balancer and registry
5764 $(info Creating Kubernetes cluster with a registry and 1 worker node...)
58- k3d registry create registry.local --port 5000
59- k3d cluster create devops --agents 1 --registry-use k3d-registry.local:5000 --port ' 8080:80@loadbalancer'
65+ k3d cluster create nyu-devops --agents 1 --registry-create cluster-registry:0.0.0.0:32000 --port ' 8080:80@loadbalancer'
6066
6167.PHONY : cluster-rm
6268cluster-rm : # # Remove a K3D Kubernetes cluster
6369 $(info Removing Kubernetes cluster...)
64- k3d cluster delete devops
65- k3d registry delete registry.local
70+ k3d cluster delete nyu-devops
6671
6772.PHONY : tekton
6873tekton : # # Install Tekton
@@ -89,7 +94,7 @@ knative: ## Install Knative
8994.PHONY : deploy
9095depoy : # # Deploy the service on local Kubernetes
9196 $(info Deploying service locally...)
92- kubectl apply -k kustomize/overlay/local
97+ kubectl apply -f k8s/
9398
9499# ###########################################################
95100# COMMANDS FOR BUILDING THE IMAGE
@@ -112,7 +117,7 @@ build: ## Build all of the project Docker images
112117.PHONY : buildx
113118buildx : # # Build multi-platform image with buildx
114119 $(info Building multi-platform image $(IMAGE ) for $(PLATFORM ) ...)
115- docker buildx build --file Dockerfile --pull --platform=$(PLATFORM ) --tag $(IMAGE ) --load .
120+ docker buildx build --file Dockerfile --pull --platform=$(PLATFORM ) --tag $(IMAGE ) --push .
116121
117122.PHONY : remove
118123remove : # # Stop and remove the buildx builder
0 commit comments