Skip to content

Commit 3cb8336

Browse files
committed
Updated cluster registry name
1 parent 1a406eb commit 3cb8336

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# These can be overidden with env vars.
2-
REGISTRY ?= rofrano
2+
REGISTRY ?= cluster-registry:32000
33
IMAGE_NAME ?= hitcounter
44
IMAGE_TAG ?= 1.0
55
IMAGE ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
66
PLATFORM ?= "linux/amd64,linux/arm64"
77
CLUSTER ?= nyu-devops
88

9+
.SILENT:
10+
911
.PHONY: help
1012
help: ## 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,25 @@ 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

62+
# k3d registry create registry.local --port 5000
63+
# k3d cluster create devops --agents 1 --registry-use k3d-registry.local:5000 --port '8080:80@loadbalancer'
64+
5565
.PHONY: cluster
5666
cluster: ## Create a K3D Kubernetes cluster with load balancer and registry
5767
$(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'
68+
k3d cluster create nyu-devops --agents 1 --registry-create cluster-registry:0.0.0.0:32000 --port '8080:80@loadbalancer'
6069

6170
.PHONY: cluster-rm
6271
cluster-rm: ## Remove a K3D Kubernetes cluster
6372
$(info Removing Kubernetes cluster...)
64-
k3d cluster delete devops
65-
k3d registry delete registry.local
73+
k3d cluster delete nyu-devops
6674

6775
.PHONY: tekton
6876
tekton: ## Install Tekton
@@ -89,7 +97,7 @@ knative: ## Install Knative
8997
.PHONY: deploy
9098
depoy: ## Deploy the service on local Kubernetes
9199
$(info Deploying service locally...)
92-
kubectl apply -k kustomize/overlay/local
100+
kubectl apply -f k8s/
93101

94102
############################################################
95103
# COMMANDS FOR BUILDING THE IMAGE
@@ -112,7 +120,7 @@ build: ## Build all of the project Docker images
112120
.PHONY: buildx
113121
buildx: ## Build multi-platform image with buildx
114122
$(info Building multi-platform image $(IMAGE) for $(PLATFORM)...)
115-
docker buildx build --file Dockerfile --pull --platform=$(PLATFORM) --tag $(IMAGE) --load .
123+
docker buildx build --file Dockerfile --pull --platform=$(PLATFORM) --tag $(IMAGE) --push .
116124

117125
.PHONY: remove
118126
remove: ## Stop and remove the buildx builder

k8s/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ spec:
2222
restartPolicy: Always
2323
containers:
2424
- name: hitcounter
25-
# image: k3d-registry.local:5000/hitcounter:1.0
26-
image: hitcounter
25+
image: cluster-registry:32000/hitcounter:1.0
26+
# image: hitcounter
2727
imagePullPolicy: IfNotPresent
2828
ports:
2929
- containerPort: 8080

skaffold.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SKAFFOLD_DEFAULT_REPO=k3d-registry.local:5000
1+
SKAFFOLD_DEFAULT_REPO=cluster-registry:32000

skaffold.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test:
1414
- context: .
1515
image: hitcounter
1616
custom:
17-
- command: export DATABASE_URI=redis://localhost:6379/0 green
17+
- command: export RETRY_COUNT=1; DATABASE_URI=redis://localhost:6379/0 green
1818
manifests:
1919
rawYaml:
2020
- k8s/deployment.yaml

0 commit comments

Comments
 (0)