KubeHelper - simplify many daily Kubernetes tasks through a web interface

Kube Helper
8 min readFeb 15, 2021

--

KubeHelper - simplifies many daily cluster tasks through a web interface. You can easily do search, analysis, run commands, cron jobs, reports, filters, git synchronization and many more.

KubeHelper is not yet another attempt to display the Kubernetes API in a GUI. Not an attempt to replace Lens, the official Dashboard, or other similar products. This is my humble contribution to the Kubernetes Open Source community. KubeHelper does not have any highly specialized direction and contains quite a few different functions that will be useful in daily work with Kubernetes.

Motivation

Kubernetes is a great and revolutionary product. I have been studying it and using it for many years, but very often there was a need to have many different functions and commands at hand. Each time you type long commands in the command line, search in history, write aliases, and so on. Of course you can do so if you wish. I like consoles and I understand that no product can replace the console. But sometimes there is no way to login into the console, or history has not been saved, or you are under the new host. Or many other reasons.

Some companies have strict rules and very often you need to forward several ssh tunnels to login into the console. Or generally you have very limited console access.

Many desktop clients require a certificate to connect to the server. And keeping the certificate from the cluster on the local machine is not 100% secure.

And what if there is no way to install the client on the local machine for access to the cluster, again you need to create aliases or copy commands from snippets. Very often I see that people are looking for certain kubectl commands, articles are published with several different commands, but there are hundreds of them, and thousands of variations. Of course, all these tasks can be automated, and surely every user / administrator of the cluster has already solved these tasks in one or another way for himself/herself, but I am sure that there are some who have not done it yet.

The same is with searching in Kubernetes cluster, sometimes you need to know where to look, and if there are a lot of resources, then it is not so easy to find what you need. I don’t want to write long commands, so I decided to create “search” for many frequently used resources. As a result, KubeHelper appeared, together with ideas that came during the development.

I also tried to look at the resources from the other point of view. Many GUI solutions show resources by namespace, a few more useful functions, and this is where the flexibility of graphical interfaces ends, and to do something different than just showing a list of resources in the namespace, again you have to turn to the console. For example group labels, find selector, view RBACs and so on …

Then I got the idea to help the community organize many commands in a single interface, install kubectl, plugins, utilities and make a graphical web interface for using the command line and also implemented other functions that will be useful in daily work with the Kubernetes cluster.

General principles and concepts

At the moment, I have prepared 3 installation options: kubectl, Helm, Terraform. Later I will add KubeHelper to the public Helm Chart Repository and to the Terraform Registry.

KubeHelper can be a very powerful assistant in your daily work with the cluster, it all depends on how many rights you give it.

By default, KubeHelper is installed with read and view permissions (get, list). Therefore, you will not break anything using it in your cluster with default settings. But during installation, you can change the ClusterRole for your needs, right up to the cluster-admin status. Detailed configuration on the Wiki.

Configuration and commands are stored in TOML format. In my opinion, this format is very convenient for this kind of task. Again, you can read a detailed description and how it works on the Wiki

Short overview over features and web interface.

Dashboard

General information about the cluster is collected in this section. The total amount of processor time, hosts (nodes), memory, the general technical information about the host (node), etc. are visible in Dashboard as well. Number, names and sizes of docker images are also displayed.

Search

Often you have to search for something in the Kubernetes cluster, for this you need to know where to look and often write non-trivial scripts or commands. Searching in the entire cluster or in a specific namespace for a keyword and selected resources solves this problem.

The principle is pretty simple and intuitive. Select namespace (all = all namespaces) in which we want to find resources by keyword. Select resources, click search, apply filters. Also, when you click on the button in the “Raws” column, you can view the resource in various formats Java POJO, YAML or JSON.

You can read a detailed description of all functions and the principle of operation on the Wiki.

Ips and Ports

The name speaks for itself, you can search for IP and ports in pods and services throughout the cluster. When you click on the found resource, detailed information about the resource will be displayed.

Security

This section is divided into 6 sections. Each section has the same buttons for selecting the namespace and searching for the corresponding resources in it.

Also, when you click the “Raw/Yaml/Json” button in the “Raws” column, you can view the resource in various formats Java POJO, YAML or JSON.

Section “Roles”: search for roles in a single namespace or in all namespaces. View subjects and role rules for each verb. Filter and group results.

Section “RBAC”: building a matrix of access to resources based on roles and rules. Filter and grouping of results.

Section “Pod Security Contexts”: show PodSecurityContext objects in a single namespace or in all namespaces.

Section “Container Security Contexts”: show ContainerSecurityContext objects in a single namespace or in all namespaces.

Section “Service Accounts”: show “Service Accounts” in a single namespace or in all namespaces.

Section “Pod Security Policies”: show “Pod Security Policies” in a single namespace or in all namespaces.

Labels Annotations Selectors

Search for labels, selectors and annotations for the allocated resources. You have the ability to filter and group results.

Grouped tab: Based on the found labels, selectors and annotations will be aggregated and grouped.

Commands

The idea of the “Commands” section is to make the KubeHelper flexible for each user. Each user can execute their own kubectl and shell commands from different consoles and view execution results. You can export your collection of commands from the git repository and much more. KubeHelper already has many ready-to-use commands. A detailed description can be found on the Wiki.

Section “Commands”: The window is divided into 3 parts, commands that can be filtered and searched, window for editing the selected command and window for outputting execution results.

Section “Management”: In this section, you can edit and create your own commands, as well as view existing commands.

Section “History”: In this section you can see all the executed commands and the result of their execution. For convenience, history is saved day by day. Several handy filters are included.

Cron Jobs

The idea of the “Cron Jobs” section is to make the execution of regular tasks, security checks, building and viewing reports of command execution a simpler and trivial task. A detailed description can be found on the Wiki.

Section “Jobs”: The window is divided into 3 parts: commands that can be filtered and searched, the window for editing the selected command and the field for creating a new “cron job”. Table with a list of active and stopped “cron jobs” and control buttons is conveniently available.

Section “Reports”: For each “cron job” a folder is created in which “cron jobs” will be saved every day. There are several convenient filters.

Configurations

The idea of the “Configurations” section is to enable the user to synchronize their configuration file with git, and it is also faster to define or change the required cron jobs. It also contains functions for managing a custom repository. A detailed description can be found on the Wiki.

Versions

KubeHelper already has kubectl preinstalled, a large number of plugins, utilities, shells, and so on. This tab displays the entire list of preinstalled programs, their versions and other information.

Questions to the community

Which new features would you add first? Which new feature will make your daily work easier?

I have created a small list of possible new features, I would appreciate your opinions and vision.

It is enough to leave a comment with just a list of numbers sorted by priority, or feel free to leave your own suggestions.

This is a corresponding Issue for proposing a new feature.

P.S.1 Please repost or leave a star on GitHub. And enjoy using it! Share it with colleagues, friends and acquaintances.

P.S.2 I would be grateful to those who wish to help to develop the project. Especially to people who will help to make the design more beautiful. :) My goal was to focus on functionality first.

Thanks. :)

--

--

No responses yet