mirror of https://github.com/k3s-io/k3s
Use standalone kubectl for gke, remove special case for vagrant
also fix hack/local-up-cluster.sh kubeconfig instructionspull/6/head
parent
d44e9b4880
commit
70a576e25a
|
@ -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
|
||||
|
||||
|
|
|
@ -176,8 +176,8 @@ Logs:
|
|||
|
||||
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-context local --cluster=local --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
|
||||
cluster/kubectl.sh config use-context local
|
||||
cluster/kubectl.sh
|
||||
EOF
|
||||
|
|
Loading…
Reference in New Issue