Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The lightest and fastest manager for kubectl contexts.

Notifications You must be signed in to change notification settings

teymurgahramanov/kc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kc

kc is the kubectl contexts manager, written in pure Bash, that makes switching between contexts, adding new ones, and modifying them easy and fast. It's ideal for those managing multiple Kubernetes clusters and relying on the terminal.

Features

🔢 Easily switch between kubectl contexts using numbers.

🧩 Add new kubeconfig files with just a single command.

⭕ Easily set the default namespace for context.

⚠️ Always know which cluster you are in with the dynamic shell prompt.

🚨 Helps you to avoid making mistakes by highlighting production clusters in red.

👍 Light, without any dependencies, and installed with a single command.

Install

curl -o ~/.kc.sh -L https://raw.githubusercontent.com/teymurgahramanov/kc/v1.3.0/kc.sh && \
  sed -i '/source ~\/\.kc\.sh/d; /source ~\/kc\.sh/d' ~/.bashrc && \
  echo "source ~/.kc.sh" >> ~/.bashrc && \
  source ~/.bashrc

Use

  1. Place your kubeconfig files in the ~/.kube/ directory.
  2. Execute kc -g to generate a new unified kubeconfig file ~/.kube/config.
  3. Use kc -l to list all available kubeconfig contexts.
  4. To switch contexts, run kc -u followed by the context number (for example, kc -u 5).
  5. To set default namespace for the current context, run kc -n <namespace>.
  6. For additional options, run kc -h to view the help menu.

About

The lightest and fastest manager for kubectl contexts.

Topics

Resources

Stars

Watchers

Forks

Languages