Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to install kubectl bash completion #13826

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/getting-started-guides/gce.md
Expand Up @@ -132,6 +132,24 @@ However the gcloud bundled kubectl version may be older than the one downloaded
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:

```
$ source ./contrib/completions/bash/kubectl
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a note: This will last for the duration of your bash session. If you want to make this permanent you need to addj this line in your bash profile.

Also you could mention bash_completions.d: on most linux distributions you can also move the completions file to your bash_completions.d like this:

$  cp ./contrib/completions/bash/kubectl /etc/bash_completion.d/

but then you have to update it when you update kubectl

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

**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.

Alternatively, on most linux distributions you can also move the completions file to your bash_completions.d like this:

```
$ cp ./contrib/completions/bash/kubectl /etc/bash_completion.d/
```

but then you have to update it when you update kubectl.

### Getting started with your cluster

#### Inspect your cluster
Expand Down