mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Revert "Use host IP instead of localhost for control plane component kubeconfig files."
This reverts commit 49afcfa5f2
.
This commit is contained in:
parent
0e2bf1e49f
commit
9581c40887
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 <<EOF >"/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
|
||||
|
Loading…
Reference in New Issue
Block a user