From c4e6ebd1a8ac43c06bc50b30a98ced45b9919a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Valais?= Date: Mon, 28 Mar 2022 14:30:38 +0200 Subject: [PATCH] make/cluster.sh: remove the fixed clusterIP CIDR 10.0.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fixed CIDR isn't necessary anymore since the makefile figures the ClusterIP dynamically. This change also enables you to run make/cluster.sh with an existing kind cluster. Signed-off-by: Maƫl Valais --- make/cluster.sh | 4 +++- make/config/kind/v1beta2.yaml | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/make/cluster.sh b/make/cluster.sh index 834d0e22b..d705b2d06 100755 --- a/make/cluster.sh +++ b/make/cluster.sh @@ -176,9 +176,11 @@ setup_kind() { printf "and then retry.\n" >&2 fi + service_ip_prefix=$(set +o pipefail && kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3) + # (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 . 10.0.0.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/v1beta2.yaml b/make/config/kind/v1beta2.yaml index bff6c66ba..c3aca0ead 100644 --- a/make/config/kind/v1beta2.yaml +++ b/make/config/kind/v1beta2.yaml @@ -1,8 +1,3 @@ -# 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. -# # 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 @@ -20,8 +15,6 @@ kubeadmConfigPatches: kind: ClusterConfiguration metadata: name: config - networking: - serviceSubnet: 10.0.0.0/16 etcd: local: extraArgs: