Marco Bravo

Logo

Marco Bravo's DEV Profile If you don’t know, ask – if you know, share! ~ opensource mindset Baseball ball image


➠ "We may not have control over our circumstances, but we do have control over our minds"
➠ What do I want to do next?
Cloud and rainbow image

View My GitHub Profile

3 February 2020

Kubernetes with the power of tmux and kubectl

by Marco Bravo

Working in a computer image

A kubectl plugin that uses tmux to make troubleshooting Kubernetes much simpler.

Kubernetes is a thriving open source container orchestration platform that offers scalability, high availability, robustness, and resiliency for applications. One of its many features is support for running custom scripts or binaries through its primary client binary, kubectl. Kubectl is very powerful and allows users to do anything with it that they could do directly on a Kubernetes cluster.

This is one of many examples from a repository of common Kubernetes aliases that shows one way to simplify functions in kubectl. For something simple like this scenario, an alias is sufficient.

To create something more powerful than a simple alias, you can use kubectl plugins. Plugins are like standalone scripts written in any scripting language but are designed to extend the functionality of your main command when serving as a Kubernetes admin.

Tmux is a very powerful tool that many sysadmins and ops teams rely on to troubleshoot issues related to ease of operability—from splitting windows into panes for running parallel debugging on multiple machines to monitoring logs. One of its major advantages is that it can be used on the command line or in automation scripts.

Aliases are always helpful for simple troubleshooting in Kubernetes environments. When the environment gets more complex, a kubectl plugin is a powerful option for using more advanced scripting. There are no limits on which programming language you can use to write kubectl plugins. The only requirements are that the naming convention in the path is executable, and it doesn’t have the same name as an existing kubectl command.

To read the complete code or try the plugins, check the kube-plugins-github repository.

Full article

tags: kubernetes - k8s - tmux - kubectl