-
-
Notifications
You must be signed in to change notification settings - Fork 14
Home
KubeHelper - simplifies many daily cluster tasks through a web interface. Search, analysis, run commands, cron jobs, reports, filters, git synchronization and many more.
- KubeHelper overview
- Installation
- KubeHelper utilities, plugins and shells
- Contributing & Development
- Dashboard - common cluster information.
- Search - search, filter, view resources in a cluster.
- Ips and Ports - search, filter, view services and pods ips, ports and detailed information.
- Security - search, filter, view roles, rules, RBAC, pod and container security contexts, service accounts, pod security policies.
- Labels Annotations Selectors - search, filter, view, group of labels, annotations and selectors in resources.
- Commands - commands execution, management, creation, history.
- Cron Jobs - creating, execution, control of cron jobs and view reports.
- Configurations - configure KubeHelper, change config, push, pull config commands, cron jobs from repository.
- Versions - KubeHelper utilities, plugins and shells
- Commons - KubeHelper common information
- Examples - KubeHelper commands and configuration examples
- Screenshots
Displays common information about cluster. Such as cluster nodes, pods count, memory and cpu capacity for whole cluster. Detailed information about each node and images list and size.
Search through the whole cluster or in a specific namespace by keyword and selected resources. The search is also carried out by the contents of the configuration files. Filters and groups results.
By clicking the "Raw/Yaml/Json" button in "Raws" column, you can see the original object in the form of Java POJO, YAML OR JSON Formats. Change the font size and stretch the window to full screen.
-
Namespace:
If namespace is 'all' then search will be done on all namespaces otherwise search will be only in selected namespace. -
Skip kube* namespaces:
If namespace is 'all' then search will be done on all namespaces except namespaces with prefix 'kube'. -
Skip native Env variables:
If Resource "EnvironmentVariable" is selected, then search will be performed only in Environment Variables which are defined with Deployment or other Kubernetes Resource defined. If deselected then the search will be performed natively on all pods containers. This means that the KubeHelper will take all the environment variables for each container. Keep in mind that if there are too many pods, the operation may take longer. -
Search field:
If the field is empty, then all information from selected resources will be displayed, otherwise KubeHelper will filter all resources by this string. -
Resources:
Search will be performed only on selected resources. -
Clear all:
Kube Helper saves model state. Search results will be saved and visible during the user session. Clear all” button cleans up all data in the model and sets the model to the default state.
Search ips and ports on the whole cluster or in a specific namespace for pods and services. Filters and groups results. By clicking on a resource - a detailed information about it will show.
-
Namespace:
If namespace is 'all' then search will perform on all namespaces otherwise search will be done only in selected namespace. -
Clear all:
Kube Helper saves model state. Search results will be saved and visible during the user session. “Clear all” button cleans up all data in the model and sets the model to the default state.
Security section has 6 different tabs. Each tab has the same buttons with the same functionality. By clicking on the "Raw/Yaml/Json" button in "Raws" column, you can see the original object in the form of Java POJO, YAML OR JSON Formats. Change the font size and stretch the window to full screen.
-
Namespace:
If namespace is 'all' then search will be done on all namespaces otherwise search will be done only in selected namespace. -
Clear all:
Kube Helper saves model state. Search results will be saved and visible during the user session. “Clear all” button cleans up all data in the model and sets the model to the default state. -
Skip kube* namespaces:
If namespace is 'all' then search will be done on all namespaces except namespaces with prefix 'kube’.
When searching by roles, click on the “role” and subjects and rules for each verb will show. Filters and group roles results.
Searches for roles, rules and subjects and builds permissions access matrix. Filters and groups results.
Searches for all or namespaced pods and shows values from PodSecurityContext object.
Searches for all or namespaced pods and shows values from container SecurityContext object.
Searches for all or namespaced service accounts.
Searches for all or namespaced pod security policies and shows it values.
Search on the whole cluster or in a specific namespace for labels, selectors and annotations and selected resources. Filters and groups results.
Some resources are too long therefore, instead of all the text, there is a button by clicking on which the entire text of the resource will appear. Filters and groups results.
-
Namespace:
If namespace is 'all' then search will be done on all namespaces otherwise search will be done only in selected namespace. -
Skip kube* namespaces:
If namespace is 'all' then search will be done on all namespaces except namespaces with prefix 'kube'. -
Skip auto generated hash labels:
Kubernetes generated many labels with hash content. If Resource "Skip auto generated hash labels" is selected, then the search will skip the labels generated by the Kubernetes. -
Resources:
Search will be performed only on selected resources. -
Clear all:
Kube Helper saves model state. Search results will be saved and visible during the user session. “Clear all” button cleans up all data in the model and sets the model to the default state.
The search results will be displayed. Filters and groups results.
Based on the search, labels, selectors and annotations will be aggregated and grouped. By clicking on a grouped object, will be shown in which resources it occurs. Filters and groups results.
The idea of the commands section is to make KubeHelper expandable for each user individually for his/her needs. The commands section allows user to execute kubectl and shell commands from bash, sh, zsh, fish and ksh shells.
The ability to create your own commands. Stores them to git repository and view reports about executed commands for a certain period. Also, the table for commands already contains a large number of predefined commands.
The window is divided into 3 parts. In the commands table you can search and group predefined commands and your own commands. Commands are already grouped by group and file. By clicking on the command row, the command will appear in two boxes.
The command which is highlighted in blue lets you modify before execution. The final command will be highlighted in red, and such red-highlighted commands will be executed from the command line by KubeHelper. These two fields are synchronized. This is done in order to prevent errors that often happen when a command consists of more than one line.
Very often, to execute a command, you need to indicate in which namespace this or that resource is located at. For ease of use, the already defined commands have a variable called MY_NAMESPACE
,
which you will need to replace with the name of your namespace. The combobox "Namespace"
makes this change automatically. When a namespace is selected in the combobox, the variable
MY_NAMESPACE
will be automatically replaced with the selected namespace. You can use this variable in your defined commands.
Select the shell in which your command should be executed and click execute. The result will be shown in the command output window. The result can be viewed in a full-screen window, as well as reduced or increased font.
Here you have the opportunity to create and view all commands that KubeHelper contains in raw format. You can create your own files with commands, delete and edit as well. The predefined commands in KubeHelper are read-only and you cannot change them.
The TOML
format was chosen for storing commands. It is very simple and perfect for this task. An example below will be described with how a command can and should be for a KubeHelper to interpret it correctly.
A very important note. The command editor is nothing more than an <div contenteditable="true">
. Therefore, in order to avoid problems with new lines, use the git repository to save and synchronize your commands. If you create a new command from a Commands Management Tab, then a new line must be done by pressing the Shift+Enter
, otherwise your file with commands will be not valid.
-
+
button allow you to create a new file with commands. User defined commands will be stored in the container folder/kubehelper/commands
. You can sync commands by cloning your repository. The folder structure is not important. You can save commands in different directories or subdirectories. -
-
button deletes the file with commands. -
refresh
button refreshes the commands state. Scans the command folder anew. -
save
button saves edited commands file.
KubeHelper automatically scans the /kubehelper/git
folder for command files and will try to interpret all files with the toml
extension as command files. KubeHelper scans the /kubehelper/git
folder down to 10 subdirectories.
Here you have the opportunity to view all executed commands with their outputs. To record the execution of commands every day a new file will be created. The command entry has a simple structure and contains from 3 parts: execution time, command and command execution output All three parts are separated by horizontal dividers. At the top right are some handy helper commands.
- Reduce or increase font size.
- Filter commands: show all executed commands, last week, last mont or for last year.
- Word wrap wraps long lines to the content width.
- Show only executed commands without their outputs.
- Refresh whole history
The idea of cron jobs section is to provide an opportunity to perform permanent regular tasks, do analysis, make security checks, build reports without human intervention according to specified criteria and commands.
The window is divided into 3 parts. In the commands table you can search and group your and predefined commands. Commands are already grouped by group and file. By clicking on the command row, the command will appear in two boxes.
The command which is highlighted in blue, can be modified before execution. The final command will be highlighted in red, and such red-highlighted commands will be executed from the command line by KubeHelper. These two fields are synchronized. This is done in order to prevent errors that often happen when a command consists of more than one line.
After creating a cron job, it will appear in a section in which all cron job will be displayed. Cron jobs will be performed in accordance with the cron expression. The execution of each command will be recorded in the corresponding report. Cron jobs can be stopped, started again or completely deleted. After deleting the cron job, the reports will not be deleted and will be visible for viewing
-
Cron Job Name:
can contain only:letters
,numbers
,-
and_
-
Cron Expression:
valide cron expression. You can build your cron expression for example by using this service: crontab.guru -
Cron Job Description:
is an optional field. -
Shell
with which the command should be executed.
For each cron job, a folder will be created in which reports will be recorded. You can select the folder with the reports in the upper left corner. There are several built-in helper functions for viewing reports. All reports will be saved in the folder /kubehelper/reports
- Reduce or increase font size.
- Word wrap: wraps long lines to the content width.
- Refresh all reports
The idea of creating a configuration file is to give the user more options for fine-tuning of KubeHelper, as well as the ability to save the state in case of rebooting or deleting the container.
At the moment, in the configuration file, you can save cron jobs and configuration for the git repository where your commands and this configuration file are stored. The configuration file has a
TOML
format. You can save the config file in your repository.
The configuration file should be called kubehelper-config.toml
. If the kubehelper-config.toml
file exists in /kubehelper/git
folder, KubeHelper will read configuration from it.
If the file does not exist, then the default file will be created and located in the root project directory. KubeHelper scans configuration file for changes every time. This uses the following
logic.
If the cron job is not running, but is marked as active in the configuration file, the cron job will be started. If a cron job does not exist, it will be automatically created.
You can also edit the config file in the configuration tab. After saving, KubeHelper will automatically apply the changed state. You can also edit cron job execution command, shell and description.
Other fields are just read only. The cron job must comply with the validation rules.
On the top bar, you can add your repository data, clone, pull and push states. If the data for the git repository is entered in the configuration file, the fields will be automatically filled in with them.
If you want to enter other data that is not in the configuration file, then first remove the value from the configuration file. Then you will be able to enter any values in the fields.
The password can be entered in the password entry field and it will be automatically saved in the application cache and after restart will no longer be available.
A very important note. The config editor is nothing more than an <div contenteditable="true">
. Therefore, in order to avoid problems with new lines, use the git repository to save and synchronize your config. If you are editing the config file online, from a Configuration Tab, then a new line must be done by pressing the Shift+Enter
, otherwise your file will be not valid.
KubeHelper includes many different utilities, plugins and shells that you can use to write your commands. This section displays all installed utilities, plugins, their versions, how they are called from the command line and links to their documentation.
-
N/A
in search results means that the namespace is not applicable to this type of resource, or this resource is visible to the entire cluster, or simply no value is assigned. - Each table is customizable. You can change column size, sort values in columns, show/hide one or more columns.
Commands format overview. You can add commands in different files and directories, the names and numbers do not matter.
-
Command name
can contain only:letters
,numbers
,-
and_
symbols. -
Command group
this is a logical separator for grouping different types of commands. Based on these groups, a filter will be built in the table with commands. -
Command description
is the text to describe the command. -
Command
can be written in various forms. Below are some examples. For example, if a newline character is present in a command, you must enclose the command in triple single quotes.
In some cases, you can write the command in triple double quotes. The formatting will be preserved. You can make sure of this when the command is displayed in the command editing window for execution.
[get-nodes-labels] #Command name
group = "kubectl get" #Command group
description = "Get all nodes labels." #Command description
command = "kubectl get nodes --show-labels" #Command
[get-scheduleable-nodes]
group = "kubectl get"
description = "Get scheduleable nodes."
command = '''kubectl get nodes --output 'jsonpath={range $.items[*]}{.metadata.name} {.spec.taints[*].effect}{"\n"}{end}'
| awk '!/NoSchedule/{print $1}' '''
[get-nodes-pod-numbers]
group = "kubectl get"
description = "Gets a list of nodes and the number of pods on them."
command = """ kubectl get po -o json --all-namespaces |
jq '.items | group_by(.spec.nodeName) |
map({"nodeName": .[0].spec.nodeName, "count": length}) |
sort_by(.count)' """
Here's an example of what a config file might / should look like.
[git]
url = "https://github.com/KubeHelper/kubehelper.git" #(Optional) - Git url for sync config and commands
user = "kubehelper" #(Optional) - If the repository is protected we need username
password = "pass" #(Optional) - If the repository is protected we need password
branch = "default branch" #(Optional) - By default will be sync with default branch
email = "journame@yourcompany.com" #(Optional) - Email for commit
#list of cron jobs
[[cron_job]]
name = "your_job-name" #(*Mandatory, Unique) - Cron job name. Should contains only letters, numbers, '_' and '-'.
isActive = true #(*Mandatory) - If the flag is active, the job will start automatically after the application starts. Possible states: [true|false]
expression = "*/20 * * * * *" #(*Mandatory) - Cron job expression. Every 20 seconds.
command = "kubectl get pods -A --field-selector = status.phase = Running | grep -v Complete" #(*Mandatory) - Cron job command
shell = "bash" #(*Mandatory) - execution shell
description = "my always active cron job" #(Optional) - Cron Job description text
[[cron_job]]
name = "your_job-name2" #(*Mandatory Unique) - Cron job name. Should contains only letters, numbers, '_' and '-'.
isActive = false #(*Mandatory) - If the flag is active, the job will start automatically after the application starts. Possible states: [true|false]
expression = " * */5 * * * *" #(*Mandatory) - Cron job expression. Every 5 minutes.
command = "kubectl get pods -A --field-selector = status.phase = Running | grep -v Complete" #(*Mandatory) - Cron job command
shell = "bash" #(*Mandatory) - execution shell
description = "my always inactive cron job" #(Optional) - Cron Job description text
You can find more examples on this page crontab.guru.
#every minute
* * * * *
#every day at 00:00
0 0 * * *
#every 60 minutes
0 * * * *
#every morning at 09:00.
0 9 * * *