mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 01:40:13 +00:00
Currently hollow nodes communicate with kubemark master using public master IP, which results in each call going through cloud NAT. Cloud NAT limitations become performance bottleneck (see kubernetes/perf-tests/issues/874). To mitigate this, in this change, a second kubeconfig called "internal" is created. It uses private master IP and is used to set up hollow nodes. Note that we still need the original kubemark kubeconfig (using public master IP) to be able to communicate with the master from outside the cluster (when setting it up or running tests). Testing: - set up kubemark cluster, verified apiserver logs to confirm that the call from hollow nodes did not go through NAT
63 lines
2.2 KiB
Bash
63 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright 2017 The Kubernetes Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# This script contains the helper functions that each provider hosting
|
|
# Kubermark must implement to use test/kubemark/start-kubemark.sh and
|
|
# test/kubemark/stop-kubemark.sh scripts.
|
|
|
|
# This function should authenticate docker to be able to read/write to
|
|
# the right container registry (needed for pushing kubemark image).
|
|
function authenticate-docker {
|
|
echo "Configuring registry authentication" 1>&2
|
|
}
|
|
|
|
# This function should create kubemark master and write kubeconfig to
|
|
# "${RESOURCE_DIRECTORY}/kubeconfig.kubemark".
|
|
# If a cluster uses private master IP, create-kubemark-master might also write
|
|
# a second kubeconfig to "${RESOURCE_DIRECTORY}/kubeconfig-internal.kubemark".
|
|
# The difference between these two kubeconfigs is that the internal one uses
|
|
# private master IP, which might be better suited for setting up hollow nodes.
|
|
function create-kubemark-master {
|
|
echo "Creating cluster..."
|
|
}
|
|
|
|
# This function should delete kubemark master.
|
|
function delete-kubemark-master {
|
|
echo "Deleting cluster..."
|
|
}
|
|
|
|
# This function should return node labels.
|
|
function calculate-node-labels {
|
|
echo ""
|
|
}
|
|
|
|
# Common colors used throughout the kubemark scripts
|
|
if [[ -z "${color_start-}" ]]; then
|
|
declare -r color_start="\033["
|
|
# shellcheck disable=SC2034
|
|
declare -r color_red="${color_start}0;31m"
|
|
# shellcheck disable=SC2034
|
|
declare -r color_yellow="${color_start}0;33m"
|
|
# shellcheck disable=SC2034
|
|
declare -r color_green="${color_start}0;32m"
|
|
# shellcheck disable=SC2034
|
|
declare -r color_blue="${color_start}1;34m"
|
|
# shellcheck disable=SC2034
|
|
declare -r color_cyan="${color_start}1;36m"
|
|
# shellcheck disable=SC2034
|
|
declare -r color_norm="${color_start}0m"
|
|
fi
|