From a9ca41e8acd9b16b411b1320421e11267e325ce8 Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Thu, 27 Apr 2017 08:52:01 -0700 Subject: [PATCH] gce.md: update kubectl instructions, remove bash completion instructions (#3477) * Remove bash completion from gce.md Bash completion instructions do not belong to this guide. (ref: #3476) Signed-off-by: Ahmet Alp Balkan * Update kubectl installation instructions on gce.md Signed-off-by: Ahmet Alp Balkan --- docs/getting-started-guides/gce.md | 53 +++++------------------------- 1 file changed, 9 insertions(+), 44 deletions(-) diff --git a/docs/getting-started-guides/gce.md b/docs/getting-started-guides/gce.md index 6efb2feed5..0c0095c94c 100644 --- a/docs/getting-started-guides/gce.md +++ b/docs/getting-started-guides/gce.md @@ -72,54 +72,19 @@ The next few steps will show you: ### Installing the Kubernetes command line tools on your workstation The cluster startup script will leave you with a running cluster and a `kubernetes` directory on your workstation. -The next step is to make sure the `kubectl` tool is in your path. -The [kubectl](/docs/user-guide/kubectl/) tool controls the Kubernetes cluster manager. It lets you inspect your cluster resources, create, delete, and update components, and much more. -You will use it to look at your new cluster and bring up example apps. +The [kubectl](/docs/user-guide/kubectl/) tool controls the Kubernetes cluster +manager. It lets you inspect your cluster resources, create, delete, and update +components, and much more. You will use it to look at your new cluster and bring +up example apps. -Add the appropriate binary folder to your `PATH` to access kubectl: +You can use` gcloud` to install the `kubectl` command-line tool on your workstation: -```shell -# OS X -export PATH=/platforms/darwin/amd64:$PATH -# Linux -export PATH=/platforms/linux/amd64:$PATH -``` + gcloud components install kubectl -**Note**: gcloud also ships with `kubectl`, which by default is added to your path. -However the gcloud bundled kubectl version may be older than the one downloaded by the -get.k8s.io install script. We recommend you use the downloaded binary to avoid -potential issues with client/server version skew. - -#### Enabling bash completion of the Kubernetes command line tools - -You may find it useful to enable `kubectl` bash completion: - -* If you're using kubectl with Kubernetes version 1.2 or earlier, you can source the kubectl completion script as follows:
- ``` - $ source ./contrib/completions/bash/kubectl - ``` - -* If you're using kubectl with Kubernetes version 1.3, use the `kubectl completion` command as follows:
- ``` - $ source <(kubectl completion bash) - ``` - -**Note**: The above commands will last for the duration of your bash session. If you want to make this permanent you need to add corresponding command in your bash profile. - -Alternatively, on most linux distributions you can also add a completions file to your bash_completions.d as follows: - -* For kubectl with Kubernetes v1.2 or earlier:
- ``` - $ cp ./contrib/completions/bash/kubectl /etc/bash_completion.d/ - ``` - -* For kubectl with Kubernetes v1.3:
- ``` - $ kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl - ``` - -but then you have to update it when you update kubectl. +**Note:** The kubectl version bundled with `gcloud` may be older than the one +downloaded by the get.k8s.io install script. See [Installing kubectl](/docs/tasks/kubectl/install/) +document to see how you can set up the latest `kubectl` on your workstation. ### Getting started with your cluster