From 698e90517db888a090c8778d9fd8e50572eba727 Mon Sep 17 00:00:00 2001 From: calvinyv Date: Mon, 8 Jun 2020 10:03:51 +0800 Subject: [PATCH] add declaration of kubectl autocompletion --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index d4f26689..3e959b97 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,25 @@ You can delete the cluster by the following command ```shell script $ ./kk delete [-f config-sample.yaml] ``` +#### Enable kubectl autocompletion + +KubeKey doesn't enable kubectl autocompletion. Refer to the guide below and turn it on: + +**Prerequisite**: make sure bash-autocompletion is installed and works. +In case that the OS is Linux based: + +```shell script +# Install bash-completion +$ apt-get install bash-completion + +# Source the completion script in your ~/.bashrc file +$ echo 'source <(kubectl completion bash)' >>~/.bashrc + +# Add the completion script to the /etc/bash_completion.d directory +$ kubectl completion bash >/etc/bash_completion.d/kubectl +``` + +More detail reference could be found [here](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) ## Documents * [Configuration example](docs/config-example.md)