diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 7d82af3821..10ce20382e 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 <