Install Kubectl and Auto-Complete on CentOS

In this blog post, I will show you how to install the Kubectl command-line management tool for Kubernetes and the auto-complete tool for it.

About Kubectl

Kubectl is a command-line management tool for Kubernetes clusters running on-prem or in the cloud.

Install Tool

To install the tool on a CentOS machine, we use the following command:

yum install kubectl

Install Kubectl Auto-Complete

The auto-complete tool is convenient because it helps the flow of the commands

.To install the tool, I will run the following command:

kubectl completion bash >/etc/bash_completion.d/kubectl

After installing the auto-complete I will reload the Bash shell using the line below.

source /usr/share/bash-completion/bash_completion

Success! You're on the list.