From 9581c4088779fa764ca4d3b59a8548094bea512e Mon Sep 17 00:00:00 2001 From: Ben Hu Date: Fri, 11 Dec 2020 22:36:39 +0000 Subject: [PATCH] Revert "Use host IP instead of localhost for control plane component kubeconfig files." This reverts commit 49afcfa5f2062ebc8cb03c5f57df751a6b8468e2. --- cluster/gce/config-default.sh | 3 --- cluster/gce/config-test.sh | 3 --- cluster/gce/gci/configure-helper.sh | 9 +-------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 0c84b099340..308d5ab83eb 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -554,9 +554,6 @@ export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP="${KUBE_APISERVER_HEALTHCHECK_ON_HO # ETCD_PROGRESS_NOTIFY_INTERVAL defines the interval for etcd watch progress notify events. export ETCD_PROGRESS_NOTIFY_INTERVAL="${ETCD_PROGRESS_NOTIFY_INTERVAL:-10m}" -# Use host IP instead of localhost in control plane kubeconfig files. -export KUBECONFIG_USE_HOST_IP="${KUBECONFIG_USE_HOST_IP:-false}" - # Optional: Install Pigz on Windows. # Pigz is a multi-core optimized version of unzip.exe. # It improves container image pull performance since most time is spent diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index 89f3d187a5d..7a7b28a7d66 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -590,9 +590,6 @@ export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP="${KUBE_APISERVER_HEALTHCHECK_ON_HO # ETCD_PROGRESS_NOTIFY_INTERVAL defines the interval for etcd watch progress notify events. export ETCD_PROGRESS_NOTIFY_INTERVAL="${ETCD_PROGRESS_NOTIFY_INTERVAL:-10m}" -# Use host IP instead of localhost in control plane kubeconfig files. -export KUBECONFIG_USE_HOST_IP="${KUBECONFIG_USE_HOST_IP:-false}" - # Optional: Install Pigz on Windows. # Pigz is a multi-core optimized version of unzip.exe. # It improves container image pull performance since most time is spent diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 8b74a4a7e8a..2bea41e28a6 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -1266,18 +1266,11 @@ EOF fi } -# Create kubeconfig files for control plane components. function create-kubeconfig { local component=$1 local token=$2 echo "Creating kubeconfig file for component ${component}" mkdir -p "/etc/srv/kubernetes/${component}" - - local kube_apiserver="localhost" - if [[ ${KUBECONFIG_USE_HOST_IP:-} == "true" ]] ; then - kube_apiserver=$(hostname -i) - fi - cat <"/etc/srv/kubernetes/${component}/kubeconfig" apiVersion: v1 kind: Config @@ -1289,7 +1282,7 @@ clusters: - name: local cluster: insecure-skip-tls-verify: true - server: https://${kube_apiserver}:443 + server: https://localhost:443 contexts: - context: cluster: local