Skip to content

Commit

Permalink
expose a nodeport on kind cluster (#1021)
Browse files Browse the repository at this point in the history
Signed-off-by: yashoza19 <yoza@redhat.com>
  • Loading branch information
yashoza19 committed Jul 9, 2024
1 parent 235e3d4 commit 10ebfdc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ E2E_REGISTRY_NAMESPACE := operator-controller-e2e

export REG_PKG_NAME := registry-operator
export REGISTRY_ROOT := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000
export CATALOG_IMG := $(REGISTRY_ROOT)/test-catalog:e2e
export CATALOG_IMG := $(REGISTRY_ROOT)/e2e/test-catalog:e2e
.PHONY: test-ext-dev-e2e
test-ext-dev-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension create, upgrade and delete tests.
test/extension-developer-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) $(KIND) $(KIND_CLUSTER_NAME) $(E2E_REGISTRY_NAMESPACE)
Expand Down Expand Up @@ -181,7 +181,7 @@ kind-redeploy: generate docker-build kind-load kind-deploy #EXHELP Redeploy newl
.PHONY: kind-cluster
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
-$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE)
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE) --config ./kind-config.yaml
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)

.PHONY: kind-clean
Expand Down
10 changes: 10 additions & 0 deletions kind-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
# e2e image registry service's NodePort
- containerPort: 30000
hostPort: 30000
listenAddress: "127.0.0.1"
protocol: tcp
5 changes: 4 additions & 1 deletion test/tools/image-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ spec:
selector:
app: registry
ports:
- port: 5000
- name: http
port: 5000
targetPort: 5000
nodePort: 30000
type: NodePort
EOF

kubectl wait --for=condition=Available -n "${namespace}" "deploy/${name}" --timeout=60s

0 comments on commit 10ebfdc

Please sign in to comment.