From aefe930562bec413bc9e77be57c8604d7fdee629 Mon Sep 17 00:00:00 2001 From: jayunit100 Date: Wed, 14 Oct 2020 22:07:19 -0400 Subject: [PATCH] support multiple bind records (fie nodelocaldns test regression), by first replacing PILLAR_ and then replacing other vars. --- cluster/gce/gci/configure-helper.sh | 8 ++++---- hack/local-up-cluster.sh | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index fc9f270fd5c1a..a18ed745a7ecd 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -2463,10 +2463,10 @@ function setup-nodelocaldns-manifest { setup-addon-manifests "addons" "0-dns/nodelocaldns" local -r localdns_file="${dst_dir}/0-dns/nodelocaldns/nodelocaldns.yaml" setup-addon-custom-yaml "addons" "0-dns/nodelocaldns" "nodelocaldns.yaml" "${CUSTOM_NODELOCAL_DNS_YAML:-}" - # Replace the sed configurations with variable values. - sed -i -e "s/_.*_DNS__DOMAIN__/${DNS_DOMAIN}/g" "${localdns_file}" - sed -i -e "s/_.*_DNS__SERVER__/${DNS_SERVER_IP}/g" "${localdns_file}" - sed -i -e "s/_.*_LOCAL__DNS__/${LOCAL_DNS_IP}/g" "${localdns_file}" + # eventually all the __PILLAR__ stuff will be gone, but theyre still in nodelocaldns for backward compat. + sed -i -e "s/__PILLAR__DNS__DOMAIN__/${DNS_DOMAIN}/g" "${localdns_file}" + sed -i -e "s/__PILLAR__DNS__SERVER__/${DNS_SERVER_IP}/g" "${localdns_file}" + sed -i -e "s/__PILLAR__LOCAL__DNS__/${LOCAL_DNS_IP}/g" "${localdns_file}" } # Sets up the manifests of netd for k8s addons. diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 8ebd8d7b942b4..bb370c96c203f 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -904,10 +904,11 @@ function start_kubedns { function start_nodelocaldns { cp "${KUBE_ROOT}/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml" nodelocaldns.yaml - # .* because of the __PILLLAR__ references that eventually will be removed - ${SED} -i -e "s/_.*_DNS__DOMAIN__/${DNS_DOMAIN}/g" nodelocaldns.yaml - ${SED} -i -e "s/_.*_DNS__SERVER__/${DNS_SERVER_IP}/g" nodelocaldns.yaml - ${SED} -i -e "s/_.*_LOCAL__DNS__/${LOCAL_DNS_IP}/g" nodelocaldns.yaml + # eventually all the __PILLAR__ stuff will be gone, but theyre still in nodelocaldns for backward compat. + ${SED} -i -e "s/__PILLAR__DNS__DOMAIN__/${DNS_DOMAIN}/g" nodelocaldns.yaml + ${SED} -i -e "s/__PILLAR__DNS__SERVER__/${DNS_SERVER_IP}/g" nodelocaldns.yaml + ${SED} -i -e "s/__PILLAR__LOCAL__DNS__/${LOCAL_DNS_IP}/g" nodelocaldns.yaml + # use kubectl to create nodelocaldns addon ${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" --namespace=kube-system create -f nodelocaldns.yaml echo "NodeLocalDNS addon successfully deployed."