Skip to content

Commit f4ea6ca

Browse files
committed
Change the experimental-e2e to use a two-node kind cluster
In order to fully support multiple replicas, we need to be able to run our tests in a multi-node environment, but we don't _always_ want to run in a multi-node test environment. Update the experimental-e2e to run a 2-node kind cluster (both control- plane). Update the `kind-load` recipe to directly load a docker image via `load docker-image`, since `load image-archive` has issues with multi-node clusters. Signed-off-by: Todd Short <tshort@redhat.com>
1 parent 6aa4040 commit f4ea6ca

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ ifeq ($(origin KIND_CLUSTER_NAME), undefined)
6262
KIND_CLUSTER_NAME := operator-controller
6363
endif
6464

65+
ifeq ($(origin KIND_CONFIG), undefined)
66+
KIND_CONFIG := ./kind-config.yaml
67+
endif
68+
6569

6670
ifneq (, $(shell command -v docker 2>/dev/null))
6771
CONTAINER_RUNTIME := docker
@@ -282,6 +286,7 @@ test-e2e: run-internal image-registry prometheus e2e e2e-coverage kind-clean #HE
282286
.PHONY: test-experimental-e2e
283287
test-experimental-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_E2E_MANIFEST)
284288
test-experimental-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
289+
test-experimental-e2e: KIND_CONFIG := ./kind-config-experimental.yaml
285290
test-experimental-e2e: GO_BUILD_EXTRA_FLAGS := -cover
286291
test-experimental-e2e: COVERAGE_NAME := experimental-e2e
287292
test-experimental-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
@@ -382,8 +387,8 @@ stop-profiling: build-test-profiler #EXHELP Stop profiling and generate analysis
382387

383388
.PHONY: kind-load
384389
kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND cluster.
385-
$(CONTAINER_RUNTIME) save $(OPCON_IMG) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
386-
$(CONTAINER_RUNTIME) save $(CATD_IMG) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
390+
$(KIND) load docker-image $(OPCON_IMG) --name $(KIND_CLUSTER_NAME)
391+
$(KIND) load docker-image $(CATD_IMG) --name $(KIND_CLUSTER_NAME)
387392

388393
.PHONY: kind-deploy
389394
kind-deploy: export DEFAULT_CATALOG := $(RELEASE_CATALOGS)
@@ -408,7 +413,7 @@ kind-deploy-experimental: manifests
408413
.PHONY: kind-cluster
409414
kind-cluster: $(KIND) kind-verify-versions #EXHELP Standup a kind cluster.
410415
-$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
411-
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config ./kind-config.yaml
416+
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config $(KIND_CONFIG)
412417
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)
413418

414419
.PHONY: kind-clean

kind-config-experimental.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: kind.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
nodes:
4+
- role: control-plane
5+
extraPortMappings:
6+
# e2e image registry service's NodePort
7+
- containerPort: 30000
8+
hostPort: 30000
9+
listenAddress: "127.0.0.1"
10+
protocol: tcp
11+
# prometheus metrics service's NodePort
12+
- containerPort: 30900
13+
hostPort: 30900
14+
listenAddress: "127.0.0.1"
15+
protocol: tcp
16+
kubeadmConfigPatches:
17+
- |
18+
kind: ClusterConfiguration
19+
apiServer:
20+
extraArgs:
21+
enable-admission-plugins: OwnerReferencesPermissionEnforcement
22+
extraMounts:
23+
- hostPath: ./hack/kind-config/containerd/certs.d
24+
containerPath: /etc/containerd/certs.d
25+
- role: control-plane
26+
extraMounts:
27+
- hostPath: ./hack/kind-config/containerd/certs.d
28+
containerPath: /etc/containerd/certs.d
29+
containerdConfigPatches:
30+
- |-
31+
[plugins."io.containerd.grpc.v1.cri".registry]
32+
config_path = "/etc/containerd/certs.d"

0 commit comments

Comments
 (0)