From 544e7aaee4d560dbc1d0a83ee31fd91afa729811 Mon Sep 17 00:00:00 2001 From: xilabao Date: Mon, 6 Feb 2017 09:23:01 +0800 Subject: [PATCH] allow to set local kubeconfig and update the prompt --- hack/local-up-cluster.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 7d82af3821e..10ce20382ef 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -450,16 +450,16 @@ function start_apiserver { kube::util::write_client_kubeconfig "${CONTROLPLANE_SUDO}" "${CERT_DIR}" "${ROOT_CA_FILE}" "${API_HOST}" "${API_SECURE_PORT}" controller kube::util::write_client_kubeconfig "${CONTROLPLANE_SUDO}" "${CERT_DIR}" "${ROOT_CA_FILE}" "${API_HOST}" "${API_SECURE_PORT}" scheduler - if [[ -z "${AUTH_ARGS}" ]]; then - if [[ "${ALLOW_ANY_TOKEN}" = true ]]; then + if [[ -z "${AUTH_ARGS}" ]]; then + if [[ "${ALLOW_ANY_TOKEN}" = true ]]; then # use token authentication - if [[ -n "${KUBECONFIG_TOKEN}" ]]; then + if [[ -n "${KUBECONFIG_TOKEN}" ]]; then AUTH_ARGS="--token=${KUBECONFIG_TOKEN}" else AUTH_ARGS="--token=system:admin/system:masters" fi else - # default to use certificate authentication + # default to the admin client cert/key AUTH_ARGS="--client-key=${CERT_DIR}/client-admin.key --client-certificate=${CERT_DIR}/client-admin.crt" fi fi @@ -688,7 +688,12 @@ fi if [[ "${START_MODE}" != "kubeletonly" ]]; then echo cat <