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: