Improve productivity while working with Kubernetes using kubectl power tools Kubectx and kubens

 

Background

If you are a DevOps or Site Reliability Engineer (SRE) engineer, most probably you will be working with multiple clusters. You might also be working with multiple namespaces across these clusters. It can be quite time consuming to switch between contexts and namespaces while working with the kubectl command-line tool.

kubectl power tools

Kubernetes is quite popular nowadays and it is very common for people to work with Kubernetes clusters using kubectl as command-line interface. Most people prefer to work with kubectl instead of working with GUI based tools.

For SRE and DevOps engineers as well as developers who are working with multiple clusters say for example Dev, staging / UAT and Production environments, they need to switch the context. In many enterprises, the Kubernetes clusters are shared by different teams. In order to isolate workloads, kubernetes namespaces are used. You need to provide the namespace everytime any command is executed.

In such scenarios switching between namespaces on the same cluster and also switch the whole context to point to a different cluster can be a cumbersome task. That is where I came across two power tools while working with kubectl, kubectx and kubens.

In the video, we can see how to install kubectx and kubens along with Fuzzy Search (FZF) tool for interactive mode.

Conclusion

Using kubectx and kubens helps to improve productivity while working with kubectl. We don't need to remember lengthy context names and also names of each and every namespace in the cluster. Get more productive by using these power tools.

Until next time, Code with Passion and Strive for Excellence.

Share:
spacer

No comments:

Post a Comment