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 fi
kubectl="${KUBECTL_PATH:-${kubectl}}" kubectl="${KUBECTL_PATH:-${kubectl}}"
# While GKE requires the kubectl binary, it's actually called through # GKE stores it's kubeconfig in a separate location.
# gcloud. But we need to adjust the PATH so gcloud gets the right one.
if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then
detect-project &> /dev/null detect-project &> /dev/null
export PATH=$(get_absolute_dirname $kubectl):$PATH
kubectl="${GCLOUD}"
# GKE runs kubectl through gcloud.
config=( config=(
"alpha" "--kubeconfig=${HOME}/.config/gcloud/kubernetes/kubeconfig"
"container" "--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
"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"
) )
fi fi

View File

@ -176,8 +176,8 @@ Logs:
To start using your cluster, open up another terminal/tab and run: To start using your cluster, open up another terminal/tab and run:
cluster/kubectl.sh config set-cluster local --server=http://${API_HOST}:${API_PORT} --insecure-skip-tls-verify=true --global cluster/kubectl.sh config set-cluster local --server=http://${API_HOST}:${API_PORT} --insecure-skip-tls-verify=true
cluster/kubectl.sh config set-context local --cluster=local --global cluster/kubectl.sh config set-context local --cluster=local
cluster/kubectl.sh config use-context local cluster/kubectl.sh config use-context local
cluster/kubectl.sh cluster/kubectl.sh
EOF EOF