Skip to content

Commit

Permalink
feat(makefile): allow to custom registry port for make kind-up (#1417
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zou8944 authored Nov 16, 2022
1 parent a318f49 commit 6ec804f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ default: help

VERSION ?= 1.5.0
RELEASE_SRC = apache-apisix-ingress-controller-${VERSION}-src
REGISTRY ?="localhost:5000"
REGISTRY_PORT ?= "5000"
REGISTRY ?="localhost:$(REGISTRY_PORT)"
IMAGE_TAG ?= dev
ENABLE_PROXY ?= true

Expand Down Expand Up @@ -154,7 +155,7 @@ uninstall:
### kind-up: Launch a Kubernetes cluster with a image registry by Kind.
.PHONY: kind-up
kind-up:
./utils/kind-with-registry.sh
./utils/kind-with-registry.sh $(REGISTRY_PORT)
### kind-reset: Delete the Kubernetes cluster created by "make kind-up"
.PHONY: kind-reset
kind-reset:
Expand Down
4 changes: 2 additions & 2 deletions utils/kind-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
kind_version=$(kind version)
kind_network='kind'
reg_name='kind-registry'
reg_port='5000'
reg_port="${1:-5000}"
case "${kind_version}" in
"kind v0.7."* | "kind v0.6."* | "kind v0.5."*)
kind_network='bridge'
Expand Down Expand Up @@ -67,7 +67,7 @@ nodes:
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]
endpoint = ["http://${reg_host}:${reg_port}"]
endpoint = ["http://${reg_host}:5000"]
EOF

for node in $(kind get nodes --name "${KIND_CLUSTER_NAME}"); do
Expand Down

0 comments on commit 6ec804f

Please sign in to comment.