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.
🔢 Easily switch between kubectl contexts using numbers.
🧩 Merge multiple kubectl config files into one with just a single command.
🚨 Helps you to avoid making mistakes by highlighting production clusters in red.
👍 Light, without any dependencies, and installed with a single command.
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
- Place your kubeconfig files in the
~/.kube/
directory. - Execute
kc -g
to generate a new unified kubeconfig file~/.kube/config
. - Use
kc -l
to list all available kubeconfig contexts. - To switch contexts, run
kc -u
followed by the context number (for example,kc -u 5
). - For additional options, run
kc -h
to view the help menu.