From b3956a689eaa7730e3fe3c1ca253a4027f9a1b9f Mon Sep 17 00:00:00 2001 From: Koonwah Chen Date: Wed, 28 Jun 2017 16:03:18 -0700 Subject: [PATCH] Add KUBE_GCE_API_ENDPOINT for GCE API endpoint config. --- cluster/common.sh | 1 + cluster/gce/config-default.sh | 3 ++- cluster/gce/gci/configure-helper.sh | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 502abfbb81..951826cbe6 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -665,6 +665,7 @@ ENABLE_APISERVER_BASIC_AUDIT: $(yaml-quote ${ENABLE_APISERVER_BASIC_AUDIT:-}) ENABLE_APISERVER_ADVANCED_AUDIT: $(yaml-quote ${ENABLE_APISERVER_ADVANCED_AUDIT:-}) ENABLE_CACHE_MUTATION_DETECTOR: $(yaml-quote ${ENABLE_CACHE_MUTATION_DETECTOR:-false}) ADVANCED_AUDIT_BACKEND: $(yaml-quote ${ADVANCED_AUDIT_BACKEND:-log}) +KUBE_GCE_API_ENDPOINT: $(yaml-quote ${KUBE_GCE_API_ENDPOINT:-}) EOF if [ -n "${KUBELET_PORT:-}" ]; then cat >>$file </etc/gce.conf [global] EOF + if [[ -n "${KUBE_GCE_API_ENDPOINT:-}" ]]; then + cat <>/etc/gce.conf +api-endpoint = ${KUBE_GCE_API_ENDPOINT} +EOF + fi if [[ -n "${PROJECT_ID:-}" && -n "${TOKEN_URL:-}" && -n "${TOKEN_BODY:-}" && -n "${NODE_NETWORK:-}" ]]; then use_cloud_config="true" cat <>/etc/gce.conf @@ -1695,7 +1700,7 @@ function start-kube-addons { sed -i -e "s@__CALICO_TYPHA_CPU__@$(get-calico-typha-cpu)@g" "${typha_dep_file}" sed -i -e "s@__CALICO_TYPHA_REPLICAS__@$(get-calico-typha-replicas)@g" "${typha_dep_file}" else - # If not configured to use Calico, the set the typha replica count to 0, but only if the + # If not configured to use Calico, the set the typha replica count to 0, but only if the # addon is present. local -r typha_dep_file="${dst_dir}/calico-policy-controller/typha-deployment.yaml" if [[ -e $typha_dep_file ]]; then