Use standalone kubectl for gke, remove special case for vagrant

also fix hack/local-up-cluster.sh kubeconfig instructions
This commit is contained in:
Jeff Lowdermilk
2015-04-20 15:45:50 -07:00
parent d44e9b4880
commit 70a576e25a
2 changed files with 5 additions and 18 deletions

View File

@@ -100,25 +100,12 @@ elif [[ ! -x "${KUBECTL_PATH}" ]]; then
fi
kubectl="${KUBECTL_PATH:-${kubectl}}"
# While GKE requires the kubectl binary, it's actually called through
# gcloud. But we need to adjust the PATH so gcloud gets the right one.
# GKE stores it's kubeconfig in a separate location.
if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then
detect-project &> /dev/null
export PATH=$(get_absolute_dirname $kubectl):$PATH
kubectl="${GCLOUD}"
# GKE runs kubectl through gcloud.
config=(
"alpha"
"container"
"kubectl"
"--project=${PROJECT}"
"--zone=${ZONE}"
"--cluster=${CLUSTER_NAME}"
)
elif [[ "$KUBERNETES_PROVIDER" == "vagrant" ]]; then
# When we are using vagrant it has hard coded kubeconfig, and do not clobber public endpoints
config=(
"--kubeconfig=$HOME/.kubernetes_vagrant_kubeconfig"
"--kubeconfig=${HOME}/.config/gcloud/kubernetes/kubeconfig"
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
)
fi