July 28, 2023 ・ Kubernetes
Kubernetes at Your Fingertips
Kubernetes, a powerful container orchestration platform, has become the go-to choice for managing and scaling applications. While kubectl is a versatile command-line tool for interacting with Kubernetes clusters, it can sometimes be challenging to remember and type all the necessary commands. Kube-dialog is a CLI tool that simplifies the process by providing a user-friendly interface to navigate and manage Kubernetes resources with ease.
Before using kube-dialog, you need to have the 'dialog' utility installed on your system, as it is a crucial part of the script. To install 'dialog', use the following commands based on your distribution:
apt install dialog
yum install dialog
To install kube-dialog, follow these simple steps:
Clone the GitHub repository:
Change to the kube-dialog directory:
Make sure 'kd' script is executable:
(Optional) Install the 'kd' script to /usr/bin for system-wide access:
Kube-dialog is a dialog wrapper for the kubectl utility that operates with existing Kubernetes artifacts. While it cannot create resources, it does allow you to list, select, edit and delete them. Kube-dialog automatically adds hotkeys to the items in its menus, making it even more convenient to use.
Kube-Dialog Usage Example
Let's walk through a typical kube-dialog session to observe and manage Kubernetes resources:
- Select a cluster:
You will be presented with a list of available clusters. Use the arrow keys to navigate and the Enter key to select the desired cluster. The selected cluster will be remembered for the next kube-dialog run, so you won't have to select it again unless you want to change it.
- Select a namespace:
Once the cluster is selected, you will be prompted to choose a namespace. Again, use the arrow keys to navigate and the Enter key to select the appropriate namespace. The selected namespace will also be remembered for the next kube-dialog run, so you won't have to select it again unless you want to change it.
- Choose the type of object to observe:
After selecting the namespace, you will be presented with a list of object types to observe, such as pods, jobs, statefulsets, deployments, etc. Use the arrow keys to navigate, and press the Enter key to select the object type you want to observe.
- Select a specific object:
Kube-dialog will display a list of objects of the chosen type in the selected namespace. Use the arrow keys to navigate, and press the Enter key to select the object you want to work with.
- Choose an action:
Once you have selected a specific object, you will be presented with a list of available actions, such as get, describe, logs, delete, or start an interactive shell (for pods). Use the arrow keys to navigate, and press the Enter key to select the desired action.
- View results or perform the action:
Kube-dialog will generate the corresponding kubectl command for the chosen action and execute it. Depending on the action you chose, the details of the selected objects will be displayed in the terminal, the logs will be shown, the interactive shell will be launched, or the object will be deleted. This allows you to efficiently manage your Kubernetes resources.
The auto hotkeys assigned to menu items streamline the process, and the tool's ability to remember your selected cluster and namespace ensures that Kubernetes is always at your fingertips. Kube-dialog is a game-changer for those who frequently interact with Kubernetes clusters. By providing a user-friendly and efficient interface, it empowers you to manage your resources with unprecedented speed and simplicity. Say goodbye to cumbersome kubectl commands and embrace the future of Kubernetes management with kube-dialog. Try it today and experience the thrill of having the full power of Kubernetes right at your fingertips!