From 4773808767d005b4a0f03bddbfae23b2ea5b83bc Mon Sep 17 00:00:00 2001 From: Elson O Rodriguez Date: Wed, 20 Apr 2016 17:00:42 -0700 Subject: [PATCH] Improved user experience for users of OpenStack provider behind a proxy. --- cluster/kube-up.sh | 9 +++++++++ cluster/openstack/util.sh | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/cluster/kube-up.sh b/cluster/kube-up.sh index 4e179c36177..12862d5f1d8 100755 --- a/cluster/kube-up.sh +++ b/cluster/kube-up.sh @@ -64,6 +64,15 @@ elif [[ "${validate_result}" == "2" ]]; then echo "...ignoring non-fatal errors in validate-cluster" >&2 fi +if [[ "${ENABLE_PROXY:-}" == "true" ]]; then + . /tmp/kube-proxy-env + echo "" + echo "*** Please run the following to add the kube-apiserver endpoint to your proxy white-list ***" + cat /tmp/kube-proxy-env + echo "*** ***" + echo "" +fi + echo -e "Done, listing cluster services:\n" >&2 "${KUBE_ROOT}/cluster/kubectl.sh" cluster-info echo diff --git a/cluster/openstack/util.sh b/cluster/openstack/util.sh index f689720005a..a0652b9203b 100644 --- a/cluster/openstack/util.sh +++ b/cluster/openstack/util.sh @@ -233,6 +233,13 @@ function configure-kubectl() { export KUBE_MASTER_IP=$(nova show "${STACK_NAME}"-master | awk '$3=="network" {print $6}') export CONTEXT="openstack-${STACK_NAME}" export KUBE_BEARER_TOKEN="TokenKubelet" + + if [[ "${ENABLE_PROXY:-}" == "true" ]]; then + echo 'export NO_PROXY=$NO_PROXY,'"${KUBE_MASTER_IP}" > /tmp/kube-proxy-env + echo 'export no_proxy=$NO_PROXY,'"${KUBE_MASTER_IP}" >> /tmp/kube-proxy-env + . /tmp/kube-proxy-env + fi + create-kubeconfig }