From a0d3d8eb0a1e6454dd9745c26aefe52dffb1f0a9 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Tue, 7 Jun 2022 19:18:57 +0100 Subject: [PATCH 1/6] Predefine what service IP range kind should use Instead of trying to retrieve it after creating the cluster Signed-off-by: irbekrm --- devel/cluster/create-kind.sh | 5 +---- devel/lib/lib.sh | 4 +--- make/cluster.sh | 10 +--------- make/config/kind/config_etcd_no_fsync.yaml | 22 ++++++++++++++-------- make/config/lib.sh | 5 +++++ make/e2e-setup.mk | 11 ++++++----- make/e2e.sh | 8 +++----- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/devel/cluster/create-kind.sh b/devel/cluster/create-kind.sh index 5e3c28729..c942396fa 100755 --- a/devel/cluster/create-kind.sh +++ b/devel/cluster/create-kind.sh @@ -66,13 +66,10 @@ $KIND_BIN create cluster \ --image "${KIND_IMAGE}" \ --name "${KIND_CLUSTER_NAME}" -# kubectl cluster-info dump does not return output in format that could be -# easily parsed with a json or yaml parser. -service_ip_prefix=$(kubectl cluster-info dump | grep ip-range | head -n1 | cut -d= -f2 | cut -d. -f1,2,3) # Get the current config original_coredns_config=$(kubectl get -ogo-template='{{.data.Corefile}}' -n=kube-system configmap/coredns) -additional_coredns_config=$'example.com:53 {\n forward . '$service_ip_prefix$'.16\n}\n' +additional_coredns_config=$'example.com:53 {\n forward . '$SERVICE_IP_PREFIX$'.16\n}\n' echo "Original CoreDNS config:" echo "${original_coredns_config}" # Patch it diff --git a/devel/lib/lib.sh b/devel/lib/lib.sh index ae4f3c1a7..198cf543c 100644 --- a/devel/lib/lib.sh +++ b/devel/lib/lib.sh @@ -29,9 +29,7 @@ export K8S_VERSION=${K8S_VERSION:-1.23} export OPENSHIFT_VERSION=${OPENSHIFT_VERSION:-"3.11"} export IS_OPENSHIFT="${IS_OPENSHIFT:-"false"}" export OPENSHIFT_VERSION="${OPENSHIFT_VERSION:-"3.11"}" -# kubectl cluster-info dump does not return output in format that could be -# easily parsed with a json or yaml parser. -export SERVICE_IP_PREFIX=$(kubectl cluster-info dump | grep ip-range | head -n1 | cut -d= -f2 | cut -d. -f1,2,3) +export SERVICE_IP_PREFIX="10.0.0" export DNS_SERVER="${SERVICE_IP_PREFIX}.16" export INGRESS_IP="${SERVICE_IP_PREFIX}.15" export GATEWAY_IP="${SERVICE_IP_PREFIX}.14" diff --git a/make/cluster.sh b/make/cluster.sh index 8a093ec2d..708db2c02 100755 --- a/make/cluster.sh +++ b/make/cluster.sh @@ -146,14 +146,6 @@ setup_kind() { --name "$kind_cluster_name" fi - # Sleep to wait for cluster-info to be up to date - # TODO (irbekrm): loop and repeatedly check for the info to become available instead of sleeping - echo "Waiting for kubectl cluster-info to be up to date..." - sleep 20 - # kubectl cluster-info dump does not return output in format that could be - # easily parsed with a json or yaml parser. - service_ip_prefix=$(kubectl cluster-info dump | grep ip-range | head -n 1 | cut -d= -f2 | cut -d. -f1,2,3) - # (2) Does the kube config contain the context for this existing kind cluster? if ! kubectl config get-contexts -oname 2>/dev/null | grep -q "^kind-${kind_cluster_name}$"; then printf "${red}${redcross}Error${end}: the kind cluster ${yel}$kind_cluster_name${end} already exists, but your current kube config does not contain the context ${yel}kind-$kind_cluster_name${end}. Run:\n" >&2 @@ -189,7 +181,7 @@ setup_kind() { # (6) Has the Corefile been patched? corefile=$(kubectl get -ogo-template='{{.data.Corefile}}' -n=kube-system configmap/coredns) - to_be_appended=$'example.com:53 {\n forward . '$service_ip_prefix$'.16\n}\n' + to_be_appended=$'example.com:53 {\n forward . '$SERVICE_IP_PREFIX$'.16\n}\n' if ! grep -q --null-data -F "$(tr -d $'\n' <<<"$to_be_appended")" <(tr -d $'\n' <<<"$corefile"); then kubectl create configmap -oyaml coredns --dry-run=client --from-literal=Corefile="$(printf '%s\n%s' "$corefile" "$to_be_appended")" \ | kubectl apply -n kube-system -f - >/dev/null diff --git a/make/config/kind/config_etcd_no_fsync.yaml b/make/config/kind/config_etcd_no_fsync.yaml index 6d0f37d6f..01ea19a0f 100644 --- a/make/config/kind/config_etcd_no_fsync.yaml +++ b/make/config/kind/config_etcd_no_fsync.yaml @@ -1,12 +1,16 @@ -# The --unsafe-no-fsync decreases the load on the pod's filesystem [1], -# which in turn decreases the end-to-end tests duration. It is OK for us to -# use this flag because we are using a one-node etcd cluster. The fsync -# feature is used for the raft consensus protocol and is thus only useful -# when using 3 or more etcd nodes. +# The --unsafe-no-fsync decreases the load on the pod's filesystem [1], which in +# turn decreases the end-to-end tests duration. It is OK for us to use this flag +# because we are using a one-node etcd cluster. The fsync feature is used for +# the raft consensus protocol and is thus only useful when using 3 or more etcd +# nodes. # -# [1]: https://github.com/etcd-io/etcd/pull/11946 -# [2]: https://etcd.io/docs/v3.5/tuning/#disk -# [3]: https://etcd.io/docs/v3.5/faq/ +# [1]: https://github.com/etcd-io/etcd/pull/11946 [2]: +# https://etcd.io/docs/v3.5/tuning/#disk [3]: https://etcd.io/docs/v3.5/faq/ +# +# custom service subnet allows us to have a fixed/predictable clusterIP for +# various addon Services such as ingress-nginx, Gateway etc. +# TODO: parameterize the service subnet range instead of hardcoding it so that it is defined in one place only +# It could be interpolated with ytt like for addons i.e https://github.com/cert-manager/cert-manager/blob/134398e939bb2b1401697eaf589405ad469cd609/make/e2e-setup.mk#L379 apiVersion: kind.x-k8s.io/v1alpha4 kind: Cluster kubeadmConfigPatches: @@ -19,5 +23,7 @@ kubeadmConfigPatches: local: extraArgs: unsafe-no-fsync: "true" + networking: + serviceSubnet: 10.0.0.0/16 nodes: - role: control-plane diff --git a/make/config/lib.sh b/make/config/lib.sh index d7bcdfc82..79b856dde 100644 --- a/make/config/lib.sh +++ b/make/config/lib.sh @@ -20,6 +20,11 @@ set -o nounset set -o errexit set -o pipefail +export SERVICE_IP_PREFIX="10.0.0" +export DNS_SERVER="${SERVICE_IP_PREFIX}.16" +export INGRESS_IP="${SERVICE_IP_PREFIX}.15" +export GATEWAY_IP="${SERVICE_IP_PREFIX}.14" + red= green= yel= diff --git a/make/e2e-setup.mk b/make/e2e-setup.mk index a40367ea9..a25d49c2b 100644 --- a/make/e2e-setup.mk +++ b/make/e2e-setup.mk @@ -36,6 +36,10 @@ IMAGE_kind_arm64 := $(IMAGE_kind_amd64) PEBBLE_COMMIT = ba5f81dd80fa870cbc19326f2d5a46f45f0b5ee3 GATEWAY_API_VERSION = 0.4.1 +# TODO: move the installation commands in this file to separate scripts like those in https://github.com/cert-manager/cert-manager/tree/master/devel/addon for readability +# Once that is done, we can consume this variable from ./make/config/lib.sh +SERVICE_IP_PREFIX = 10.0.0 + .PHONY: e2e-setup-kind ## Create a Kubernetes cluster using Kind, which is required for `make e2e`. ## The Kind image is pre-pulled to avoid 'kind create' from blocking other make @@ -167,9 +171,9 @@ feature_gates_controller := $(subst $(space),\$(comma),$(filter AllAlpha=% AllBe feature_gates_webhook := $(subst $(space),\$(comma),$(filter AllAlpha=% AllBeta=% AdditionalCertificateOutputFormats=% , $(subst $(comma),$(space),$(FEATURE_GATES)))) feature_gates_cainjector := $(subst $(space),\$(comma),$(filter AllAlpha=% AllBeta=%, $(subst $(comma),$(space),$(FEATURE_GATES)))) +# TODO: move these commands to separate scripts for readability .PHONY: e2e-setup-certmanager e2e-setup-certmanager: bin/cert-manager.tgz $(foreach bin,controller acmesolver cainjector webhook ctl,bin/containers/cert-manager-$(bin)-linux-$(CRI_ARCH).tar) $(foreach bin,controller acmesolver cainjector webhook ctl,load-bin/containers/cert-manager-$(bin)-linux-$(CRI_ARCH).tar) e2e-setup-gatewayapi bin/scratch/kind-exists bin/tools/kubectl bin/tools/kind - @$(eval SERVICE_IP_PREFIX = $(shell bin/tools/kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3)) @$(eval TAG = $(shell tar xfO bin/containers/cert-manager-controller-linux-$(CRI_ARCH).tar manifest.json | jq '.[0].RepoTags[0]' -r | cut -d: -f2)) bin/tools/helm upgrade \ --install \ @@ -188,12 +192,11 @@ e2e-setup-certmanager: bin/cert-manager.tgz $(foreach bin,controller acmesolver --set featureGates="$(feature_gates_controller)" \ --set "webhook.extraArgs={--feature-gates=$(feature_gates_webhook)}" \ --set "cainjector.extraArgs={--feature-gates=$(feature_gates_cainjector)}" \ - --set "extraArgs={--dns01-recursive-nameservers=$(SERVICE_IP_PREFIX).16:53,--dns01-recursive-nameservers-only=true,--acme-http01-solver-image=cert-manager-acmesolver-$(CRI_ARCH):$(TAG)}" \ + --set "extraArgs={--dns01-recursive-nameservers=10.0.0.16:53,--dns01-recursive-nameservers-only=true,--acme-http01-solver-image=cert-manager-acmesolver-$(CRI_ARCH):$(TAG)}" \ cert-manager $< >/dev/null .PHONY: e2e-setup-bind e2e-setup-bind: $(call image-tar,bind) load-$(call image-tar,bind) $(wildcard make/config/bind/*.yaml) bin/scratch/kind-exists bin/tools/kubectl - @$(eval SERVICE_IP_PREFIX = $(shell bin/tools/kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3)) @$(eval IMAGE = $(shell tar xfO $< manifest.json | jq '.[0].RepoTags[0]' -r)) bin/tools/kubectl get ns bind 2>/dev/null >&2 || bin/tools/kubectl create ns bind sed -e "s|{SERVICE_IP_PREFIX}|$(SERVICE_IP_PREFIX)|g" -e "s|{IMAGE}|$(IMAGE)|g" make/config/bind/*.yaml | bin/tools/kubectl apply -n bind -f - >/dev/null @@ -212,7 +215,6 @@ e2e-setup-gatewayapi: bin/downloaded/gatewayapi-v$(GATEWAY_API_VERSION) bin/scra # https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml#L64-L67 .PHONY: e2e-setup-ingressnginx e2e-setup-ingressnginx: $(call image-tar,ingressnginx) load-$(call image-tar,ingressnginx) bin/tools/helm - @$(eval SERVICE_IP_PREFIX = $(shell bin/tools/kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3)) @$(eval TAG=$(shell tar xfO $< manifest.json | jq '.[0].RepoTags[0]' -r | cut -d: -f2)) bin/tools/helm repo add ingress-nginx --force-update https://kubernetes.github.io/ingress-nginx >/dev/null bin/tools/helm upgrade \ @@ -303,7 +305,6 @@ e2e-setup-samplewebhook: load-bin/downloaded/containers/$(CRI_ARCH)/samplewebhoo .PHONY: e2e-setup-projectcontour e2e-setup-projectcontour: load-$(call image-tar,projectcontour) make/config/projectcontour/contour-gateway.yaml make/config/projectcontour/gateway.yaml bin/scratch/kind-exists bin/tools/kubectl bin/tools/ytt - @$(eval SERVICE_IP_PREFIX = $(shell bin/tools/kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3)) bin/tools/ytt --data-value service_ip_prefix="${SERVICE_IP_PREFIX}" \ --file make/config/projectcontour/contour-gateway.yaml \ --file make/config/projectcontour/gateway.yaml | bin/tools/kubectl apply -f- diff --git a/make/e2e.sh b/make/e2e.sh index 92df18143..309d9c8f2 100755 --- a/make/e2e.sh +++ b/make/e2e.sh @@ -184,8 +184,6 @@ fi mkdir -p "${ARTIFACTS}" -service_ip_prefix=$(kubectl cluster-info dump | grep ip-range | head -n1 | cut -d= -f2 | cut -d. -f1,2,3) - export CGO_ENABLED=0 trace ginkgo \ @@ -196,9 +194,9 @@ trace ginkgo \ -- \ --repo-root="$PWD" \ --report-dir="${ARTIFACTS}" \ - --acme-dns-server="${service_ip_prefix}.16" \ - --acme-ingress-ip="${service_ip_prefix}.15" \ - --acme-gateway-ip="${service_ip_prefix}.14" \ + --acme-dns-server="${SERVICE_IP_PREFIX}.16" \ + --acme-ingress-ip="${SERVICE_IP_PREFIX}.15" \ + --acme-gateway-ip="${SERVICE_IP_PREFIX}.14" \ --ingress-controller-domain=ingress-nginx.http01.example.com \ --gateway-domain=gateway.http01.example.com \ --feature-gates="$feature_gates" \ From bd842caabeb09f65fb9ab1b7658551c878372064 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Tue, 7 Jun 2022 19:19:36 +0100 Subject: [PATCH 2/6] Removes unused kind config Signed-off-by: irbekrm --- test/fixtures/kind/config-v1alpha2.yaml | 22 ---------------------- test/fixtures/kind/config-v1alpha3.yaml | 18 ------------------ test/fixtures/kind/config-v1beta1.yaml | 18 ------------------ test/fixtures/kind/config-v1beta2.yaml | 18 ------------------ 4 files changed, 76 deletions(-) delete mode 100644 test/fixtures/kind/config-v1alpha2.yaml delete mode 100644 test/fixtures/kind/config-v1alpha3.yaml delete mode 100644 test/fixtures/kind/config-v1beta1.yaml delete mode 100644 test/fixtures/kind/config-v1beta2.yaml diff --git a/test/fixtures/kind/config-v1alpha2.yaml b/test/fixtures/kind/config-v1alpha2.yaml deleted file mode 100644 index 96756794c..000000000 --- a/test/fixtures/kind/config-v1alpha2.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# this config file is similar to the default, except we set the cluster's -# service cidr range to be 10.0.0.0/16. -# we do this because we need a fixed/predictable clusterIP of 10.0.0.15 for the -# nginx-ingress service, in order to perform HTTP01 validations during tests. - -apiVersion: kind.sigs.k8s.io/v1alpha3 -kind: Cluster -kubeadmConfigPatches: - - | - # config generated by kind - apiVersion: kubeadm.k8s.io/v1alpha2 - kind: MasterConfiguration - metadata: - name: config - networking: - serviceSubnet: 10.0.0.0/16 - kubeletConfiguration: - baseConfig: - clusterDNS: - - 10.0.0.10 -nodes: -- role: control-plane diff --git a/test/fixtures/kind/config-v1alpha3.yaml b/test/fixtures/kind/config-v1alpha3.yaml deleted file mode 100644 index 79c1ac3e6..000000000 --- a/test/fixtures/kind/config-v1alpha3.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# this config file is similar to the default, except we set the cluster's -# service cidr range to be 10.0.0.0/16. -# we do this because we need a fixed/predictable clusterIP of 10.0.0.15 for the -# nginx-ingress service, in order to perform HTTP01 validations during tests. - -apiVersion: kind.sigs.k8s.io/v1alpha3 -kind: Cluster -kubeadmConfigPatches: - - | - # config generated by kind - apiVersion: kubeadm.k8s.io/v1alpha3 - kind: ClusterConfiguration - metadata: - name: config - networking: - serviceSubnet: 10.0.0.0/16 -nodes: -- role: control-plane diff --git a/test/fixtures/kind/config-v1beta1.yaml b/test/fixtures/kind/config-v1beta1.yaml deleted file mode 100644 index 1126c8b7c..000000000 --- a/test/fixtures/kind/config-v1beta1.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# this config file is similar to the default, except we set the cluster's -# service cidr range to be 10.0.0.0/16. -# we do this because we need a fixed/predictable clusterIP of 10.0.0.15 for the -# nginx-ingress service, in order to perform HTTP01 validations during tests. - -apiVersion: kind.sigs.k8s.io/v1alpha3 -kind: Cluster -kubeadmConfigPatches: - - | - # config generated by kind - apiVersion: kubeadm.k8s.io/v1beta1 - kind: ClusterConfiguration - metadata: - name: config - networking: - serviceSubnet: 10.0.0.0/16 -nodes: -- role: control-plane diff --git a/test/fixtures/kind/config-v1beta2.yaml b/test/fixtures/kind/config-v1beta2.yaml deleted file mode 100644 index e5db5747f..000000000 --- a/test/fixtures/kind/config-v1beta2.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# this config file is similar to the default, except we set the cluster's -# service cidr range to be 10.0.0.0/16. -# we do this because we need a fixed/predictable clusterIP of 10.0.0.15 for the -# nginx-ingress service, in order to perform HTTP01 validations during tests. - -apiVersion: kind.sigs.k8s.io/v1alpha3 -kind: Cluster -kubeadmConfigPatches: - - | - # config generated by kind - apiVersion: kubeadm.k8s.io/v1beta2 - kind: ClusterConfiguration - metadata: - name: config - networking: - serviceSubnet: 10.0.0.0/16 -nodes: - - role: control-plane From 37209509758278a58937414b95f49478b433b5a1 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Wed, 8 Jun 2022 18:02:31 +0100 Subject: [PATCH 3/6] Remove kind config for kube 1.18 and 1.19 As we no longer need to create 1.18 and 1.19 clusters Signed-off-by: irbekrm --- make/config/kind/config.yaml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 make/config/kind/config.yaml diff --git a/make/config/kind/config.yaml b/make/config/kind/config.yaml deleted file mode 100644 index c59fa0856..000000000 --- a/make/config/kind/config.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Kind config for kind 1.18 and 1.19 node images. Use -# make/config/kind/config_etcd_no_fsync.yaml for newer versions of kind as they -# support --unsafe-no-fsync etcd flag, which improves test speed. -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: - - | - apiVersion: kubeadm.k8s.io/v1beta2 - kind: ClusterConfiguration - metadata: - name: config -nodes: - - role: control-plane From a76d85eab388d736b90ea1e6d4920891afee4514 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Wed, 8 Jun 2022 18:04:41 +0100 Subject: [PATCH 4/6] Allows kind to choose API version for kubeadm Cluster config To be able to use single kind config for different Kubernetes versions Signed-off-by: irbekrm --- devel/cluster/config/{v1beta2.yaml => kind.yaml} | 6 ++++-- devel/cluster/create-kind.sh | 2 +- .../kind/{config_etcd_no_fsync.yaml => cluster.yaml} | 10 +++++++--- make/e2e-setup.mk | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) rename devel/cluster/config/{v1beta2.yaml => kind.yaml} (86%) rename make/config/kind/{config_etcd_no_fsync.yaml => cluster.yaml} (64%) diff --git a/devel/cluster/config/v1beta2.yaml b/devel/cluster/config/kind.yaml similarity index 86% rename from devel/cluster/config/v1beta2.yaml rename to devel/cluster/config/kind.yaml index bfc5d61e1..e5282fd94 100644 --- a/devel/cluster/config/v1beta2.yaml +++ b/devel/cluster/config/kind.yaml @@ -7,11 +7,13 @@ apiVersion: kind.x-k8s.io/v1alpha4 kind: Cluster kubeadmConfigPatches: - | - # config generated by kind - apiVersion: kubeadm.k8s.io/v1beta2 kind: ClusterConfiguration metadata: name: config + etcd: + local: + extraArgs: + unsafe-no-fsync: "true" networking: serviceSubnet: 10.0.0.0/16 nodes: diff --git a/devel/cluster/create-kind.sh b/devel/cluster/create-kind.sh index c942396fa..88d1e0952 100755 --- a/devel/cluster/create-kind.sh +++ b/devel/cluster/create-kind.sh @@ -62,7 +62,7 @@ fi # Create the kind cluster $KIND_BIN create cluster \ - --config "${SCRIPT_ROOT}/config/v1beta2.yaml" \ + --config "${SCRIPT_ROOT}/config/kind.yaml" \ --image "${KIND_IMAGE}" \ --name "${KIND_CLUSTER_NAME}" diff --git a/make/config/kind/config_etcd_no_fsync.yaml b/make/config/kind/cluster.yaml similarity index 64% rename from make/config/kind/config_etcd_no_fsync.yaml rename to make/config/kind/cluster.yaml index 01ea19a0f..992b7c8de 100644 --- a/make/config/kind/config_etcd_no_fsync.yaml +++ b/make/config/kind/cluster.yaml @@ -1,3 +1,7 @@ +# This kind config is unversioned as we are using it to create kind clusters with a range of different versions of Kubernetes. Having the config unversioned allows kind to choose a suitable API version, see https://github.com/kubernetes-sigs/kind/issues/1839#issuecomment-1148968204 +# When making changes to this file ensure that the change works with all currently supported versions of Kubernetes. +# +# When making any changes to this file, make sure it works with all supported versions of Kubernetes. # The --unsafe-no-fsync decreases the load on the pod's filesystem [1], which in # turn decreases the end-to-end tests duration. It is OK for us to use this flag # because we are using a one-node etcd cluster. The fsync feature is used for @@ -7,15 +11,15 @@ # [1]: https://github.com/etcd-io/etcd/pull/11946 [2]: # https://etcd.io/docs/v3.5/tuning/#disk [3]: https://etcd.io/docs/v3.5/faq/ # -# custom service subnet allows us to have a fixed/predictable clusterIP for +# Custom service subnet allows us to have a fixed/predictable clusterIP for # various addon Services such as ingress-nginx, Gateway etc. # TODO: parameterize the service subnet range instead of hardcoding it so that it is defined in one place only # It could be interpolated with ytt like for addons i.e https://github.com/cert-manager/cert-manager/blob/134398e939bb2b1401697eaf589405ad469cd609/make/e2e-setup.mk#L379 + apiVersion: kind.x-k8s.io/v1alpha4 kind: Cluster kubeadmConfigPatches: - | - apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration metadata: name: config @@ -26,4 +30,4 @@ kubeadmConfigPatches: networking: serviceSubnet: 10.0.0.0/16 nodes: - - role: control-plane + - role: control-plane \ No newline at end of file diff --git a/make/e2e-setup.mk b/make/e2e-setup.mk index a25d49c2b..494146ede 100644 --- a/make/e2e-setup.mk +++ b/make/e2e-setup.mk @@ -62,7 +62,7 @@ e2e-setup-kind: kind-exists # used as a prerequisite. If we were to use .PHONY, then the file's # timestamp would not be used to check whether targets should be rebuilt, # and they would get constantly rebuilt. -bin/scratch/kind-exists: make/config/kind/config.yaml make/config/kind/config_etcd_no_fsync.yaml preload-kind-image make/cluster.sh FORCE bin/tools/kind bin/tools/kubectl bin/tools/yq | bin/scratch +bin/scratch/kind-exists: make/config/kind/cluster.yaml preload-kind-image make/cluster.sh FORCE bin/tools/kind bin/tools/kubectl bin/tools/yq | bin/scratch @$(eval KIND_CLUSTER_NAME ?= kind) @make/cluster.sh --name $(KIND_CLUSTER_NAME) @if [ "$(shell cat $@ 2>/dev/null)" != kind ]; then echo kind > $@; else touch $@; fi From e2036193341febdb77cf9f5c34f877970018bbb0 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Wed, 8 Jun 2022 18:30:26 +0100 Subject: [PATCH 5/6] Removes check for Kubernetes 1.18 and 1.19 As we are no longer creating 1.18 and 1.19 kind clusters Signed-off-by: irbekrm --- make/cluster.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/make/cluster.sh b/make/cluster.sh index 708db2c02..86d6c0d12 100755 --- a/make/cluster.sh +++ b/make/cluster.sh @@ -136,12 +136,7 @@ setup_kind() { # (1) Does the kind cluster already exist? if ! kind get clusters -q | grep -q "^$kind_cluster_name\$"; then - # Kind with Kubernetes v1.18 and v1.19 need different config files - config="config_etcd_no_fsync" - if [[ "$k8s_version" == 1.18 || "$k8s_version" == 1.19 ]]; then - config="config" - fi - trace kind create cluster --config "make/config/kind/${config}.yaml" \ + trace kind create cluster --config "make/config/kind/cluster.yaml" \ --image "$image" \ --name "$kind_cluster_name" fi From ce55ddde2a72e43d7ba307958f9dac53d08678b1 Mon Sep 17 00:00:00 2001 From: irbekrm Date: Tue, 21 Jun 2022 11:19:21 +0100 Subject: [PATCH 6/6] Code review feedback Signed-off-by: irbekrm --- make/e2e-setup.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/e2e-setup.mk b/make/e2e-setup.mk index 494146ede..169e64576 100644 --- a/make/e2e-setup.mk +++ b/make/e2e-setup.mk @@ -192,7 +192,7 @@ e2e-setup-certmanager: bin/cert-manager.tgz $(foreach bin,controller acmesolver --set featureGates="$(feature_gates_controller)" \ --set "webhook.extraArgs={--feature-gates=$(feature_gates_webhook)}" \ --set "cainjector.extraArgs={--feature-gates=$(feature_gates_cainjector)}" \ - --set "extraArgs={--dns01-recursive-nameservers=10.0.0.16:53,--dns01-recursive-nameservers-only=true,--acme-http01-solver-image=cert-manager-acmesolver-$(CRI_ARCH):$(TAG)}" \ + --set "extraArgs={--dns01-recursive-nameservers=$(SERVICE_IP_PREFIX).16:53,--dns01-recursive-nameservers-only=true,--acme-http01-solver-image=cert-manager-acmesolver-$(CRI_ARCH):$(TAG)}" \ cert-manager $< >/dev/null .PHONY: e2e-setup-bind