Permalink
Browse files

Updated kubectl bash completion usage in the doc.

We have moved the shell script into `kubectl completion` command in [#23801](kubernetes/kubernetes#23801), updated the bash completion usage in the doc.

Fixes kubernetes#1092
  • Loading branch information...
xingzhou committed Aug 25, 2016
1 parent 086c65a commit cbb4b8faae0c507e8d93ef4b5a8191bc7e65894b
Showing with 20 additions and 8 deletions.
  1. +20 −8 docs/getting-started-guides/gce.md
@@ -95,17 +95,29 @@ potential issues with client/server version skew.
You may find it useful to enable `kubectl` bash completion:
```
$ source ./contrib/completions/bash/kubectl
```
* If you're using kubectl with Kubernetes version 1.2 or earlier, you can source the kubectl completion script as follows:<br>
```
$ source ./contrib/completions/bash/kubectl
```
**Note**: This will last for the duration of your bash session. If you want to make this permanent you need to add this line in your bash profile.
* If you're using kubectl with Kubernetes version 1.3, use the `kubectl completion` command as follows:<br>
```
$ source <(kubectl completion bash)
```
Alternatively, on most linux distributions you can also move the completions file to your bash_completions.d like this:
**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.
```
$ cp ./contrib/completions/bash/kubectl /etc/bash_completion.d/
```
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:<br>
```
$ cp ./contrib/completions/bash/kubectl /etc/bash_completion.d/
```
* For kubectl with Kubernetes v1.3:<br>
```
$ kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl
```
but then you have to update it when you update kubectl.

0 comments on commit cbb4b8f

Please sign in to comment.