File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,10 @@ test-unit: defaults manifests generate fmt vet envtest ## Run unit tests.
448448test-e2e : defaults manifests generate fmt vet # # Run e2e tests.
449449 go test -timeout 30m -v ./test/e2e
450450
451+ .PHONY : kind-e2e
452+ setup-e2e : # # Set up e2e KinD cluster.
453+ test/e2e/kind.sh
454+
451455.PHONY : setup-e2e
452456setup-e2e : # # Set up e2e tests.
453457 KUBERAY_VERSION=$(KUBERAY_VERSION ) test/e2e/setup.sh
Original file line number Diff line number Diff line change @@ -25,11 +25,15 @@ The e2e tests can be executed locally by running the following commands:
2525
2626 ``` bash
2727 # Create a KinD cluster
28- $ kind create cluster --image kindest/node:v1.25.8
28+ $ make kind-e2e
2929 # Install the CRDs
3030 $ make install
3131 ```
3232
33+ [! NOTE]
34+ Some e2e tests cover the access to services via Ingresses, as end-users would do, which requires access to the Ingress controller load balancer by its IP.
35+ For it to work on macOS, this requires installing [docker-mac-net-connect](https://github.com/chipmk/docker-mac-net-connect).
36+
33372. Start the operator locally:
3438
3539 ` ` ` bash
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Copyright 2022 IBM, Red Hat
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+
17+ set -euo pipefail
18+ : " ${INGRESS_NGINX_VERSION:= controller-v1.6.4} "
19+
20+ echo " Creating KinD cluster"
21+ cat << EOF | kind create cluster --config=-
22+ kind: Cluster
23+ apiVersion: kind.x-k8s.io/v1alpha4
24+ nodes:
25+ - role: control-plane
26+ image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
27+ kubeadmConfigPatches:
28+ - |
29+ kind: InitConfiguration
30+ nodeRegistration:
31+ kubeletExtraArgs:
32+ node-labels: "ingress-ready=true"
33+ EOF
34+
35+ echo " Deploying Ingress controller into KinD cluster"
36+ curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/" ${INGRESS_NGINX_VERSION} " /deploy/static/provider/kind/deploy.yaml | sed " s/--publish-status-address=localhost/--report-node-internal-ip-address\\ n - --status-update-interval=10/g" | kubectl apply -f -
37+ kubectl annotate ingressclass nginx " ingressclass.kubernetes.io/is-default-class=true"
38+ kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
You can’t perform that action at this time.
0 commit comments