Kontext is a single binary application, that takes yet another approach on kubeconfig management.
Kontext is a single binary application designed to simplifykubeconfig management for Kubernetes users. It offers a declarative approach to streamline the handling of multiple clusters and contexts.
Key Features:
Context Switching: Seamlessly switch between contexts with minimal input, listing available options from your current kubeconfig file.
Groups Management: Organize sources into groups for efficient bundling and switching, enabling or disabling multiple sources collectively.
Sources Configuration: Define include and exclude patterns to manage kubeconfig files, ensuring duplicates are removed for clarity.
Verbosity Control: Adjust output levels from Trace to Fatal for tailored debugging and logging needs.
Backup Configurations: Automatically backupkubeconfig files with configurable paths across different operating systems.
Audience & Benefit:
Ideal for Kubernetes users, DevOps engineers, and Site Reliability Engineers (SREs), Kontext enhances workflow efficiency by simplifying context management. Its features reduce manual errors and improve overall productivity in cluster administration.
README
kontext
Kontext is a single binary application, that takes yet another approach on kubeconfig management.
Features
Kontext has several features, that will ease your life when dealing with different kubeconfig files.
Context
Switch between a context by just calling the binary, without any arguments. It will read your current kubeconfig file
and list all available options.
Groups
Groups refer to one or more sources and can be used to bundle kubeconfig files together. You
can switch between groups and enable or disable multiple sources at once.
Sources
Source include or exclude kubeconfig files as a glob pattern. A source always computes all
included sources files first and then removes all duplicates. After the include section has
been computed the same happens for all files, that shall be excluded. Take a look at the
example to understand sources in depth.
Usage
[I] ➜ kx -h
manage kubernetes config files, contexts, groups and sources
Usage:
kontext [flags]
kontext [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
get get [context|group] [name], defaults to context
help Help about any command
reload reload the active group
set set [context|group] [name]
version version for kontext
Flags:
-h, --help help for kontext
-v, --verbosity int verbose output (default 3)
Use "kontext [command] --help" for more information about a command.
Verbosity
You can tweak the verbosity by using the following levels:
Kontext can be installed via winget, ensuring easy setup across supported environments.
Configuration
Have a look at the example. It should be well described and show you
how to configure kontext. Kontext will look at different paths for the configuration file, depending on
your operating system:
Linux
MacOS
Windows
~/.config/kontext/kontext.yaml
~/.config/kontext/kontext.yaml
LocalAppData\kontext\kontext.yaml
Backups
As kontext will override your kubeconfig file pretty often, it allows you to configure backups. All
backups are placed within a dedicated backup directory, that can be configured within the configuration file.
There are defaults, that are specific to all operating systems:
Linux
MacOS
Windows
~/.local/share/kontext/backup
~/Library/Application Support/kontext/backup
LocalAppData\kontext\backup
Contributing
Contributions are always welcome, have a look at the contributing guidelines to get started.