# ahmetb/kubectx

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ahmetb-kubectx).**

19,829 stars · 1,379 forks · Go · Apache-2.0

## Links

- GitHub: https://github.com/ahmetb/kubectx
- Homepage: https://kubectx.dev
- awesome-repositories: https://awesome-repositories.com/repository/ahmetb-kubectx.md

## Topics

`kubectl` `kubectl-plugins` `kubernetes` `kubernetes-clusters`

## Description

kubectx is a set of command-line productivity tools designed to simplify the switching of cluster contexts and active namespaces for Kubernetes CLI users. It serves as a context manager that allows users to quickly change the current cluster environment and default namespace within the configuration.

The tool provides capabilities for renaming cluster contexts to improve identification and the ability to toggle rapidly between two clusters by preserving the previous active state. It also supports launching isolated shell sessions constrained to a specific cluster or configured as read-only to prevent accidental changes.

The utility includes interactive context filtering and searching through integration with external fuzzy-search tools. It also provides mechanisms for updating the active namespace for a cluster, reducing the requirement to use explicit namespace flags in every command.

## Tags

### DevOps & Infrastructure

- [Context Management](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-cluster-management/context-management.md) — Provides a command-line tool to rapidly switch between active Kubernetes cluster contexts and namespaces.
- [Active Namespace Selection](https://awesome-repositories.com/f/devops-infrastructure/active-namespace-selection.md) — Updates the active namespace for the current context to reduce the need for explicit namespace flags. ([source](https://github.com/ahmetb/kubectx))
- [Active Namespace Switching](https://awesome-repositories.com/f/devops-infrastructure/active-namespace-switching.md) — Provides functionality to update the current namespace for the active cluster, including non-existent namespaces. ([source](https://github.com/ahmetb/kubectx/blob/master/README.md))
- [Kubernetes Cluster Management](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-cluster-management.md) — Enables quick switching between different Kubernetes clusters to avoid typing long context names.
- [Namespace Switching](https://awesome-repositories.com/f/devops-infrastructure/namespace-management-tools/namespace-switching.md) — Implements a utility to update the active namespace for the current cluster to reduce the need for explicit flags.
- [Client Cluster Contexts](https://awesome-repositories.com/f/devops-infrastructure/cluster-management/client-cluster-contexts.md) — Allows modifying the name of cluster contexts within the client configuration to improve identification. ([source](https://github.com/ahmetb/kubectx))

### Operating Systems & Systems Programming

- [Client Context Switching](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/kernel-development/paging-and-context-switching/client-context-switching.md) — Provides a utility to quickly change the active cluster context and toggle back to the previously used environment. ([source](https://github.com/ahmetb/kubectx/blob/master/README.md))

### Development Tools & Productivity

- [Configuration File Manipulation](https://awesome-repositories.com/f/development-tools-productivity/configuration-file-manipulation.md) — Programmatically parses and modifies the YAML kubeconfig file to update current context and namespace settings.
- [Kubectl Context Switchers](https://awesome-repositories.com/f/development-tools-productivity/kubectl-context-switchers.md) — Quickly changes the current cluster environment and default namespace for Kubernetes CLI operations.
- [Kubectl Workflow Optimizations](https://awesome-repositories.com/f/development-tools-productivity/kubectl-workflow-optimizations.md) — Speeds up daily Kubernetes operations using shortcuts and interactive menus to navigate environments.
- [Kubernetes CLI Productivity Tools](https://awesome-repositories.com/f/development-tools-productivity/kubernetes-cli-productivity-tools.md) — Provides a set of shell scripts for renaming contexts and launching isolated shells restricted to specific clusters.
- [Context Toggling](https://awesome-repositories.com/f/development-tools-productivity/context-toggling.md) — Stores the previous active context in a temporary variable to allow rapid switching between two clusters.
- [Interactive Context Menus](https://awesome-repositories.com/f/development-tools-productivity/interactive-context-menus.md) — Provides a fuzzy-searchable menu to select clusters or namespaces when compatible search tools are installed. ([source](https://github.com/ahmetb/kubectx/blob/master/README.md))
- [Subshell Environment Isolation](https://awesome-repositories.com/f/development-tools-productivity/isolated-execution-environments/subshell-environment-isolation.md) — Spawns a new shell process with a modified environment to restrict operations to a specific cluster context.

### Software Engineering & Architecture

- [Kubernetes Context Isolation](https://awesome-repositories.com/f/software-engineering-architecture/environment-isolation/project-specific-shell-isolation/kubernetes-context-isolation.md) — Starts new shell sessions constrained to a specific cluster context or configured as read-only. ([source](https://github.com/ahmetb/kubectx/blob/master/README.md))
