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.
🧩 Add new kubeconfig files with just a single command.
⭕ Easily set the default namespace for context.
🚨 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 -gto generate a new unified kubeconfig file~/.kube/config. - Use
kc -lto list all available kubeconfig contexts. - To switch contexts, run
kc -ufollowed by the context number (for example,kc -u 5). - To set default namespace for the current context, run
kc -n <namespace>. - For additional options, run
kc -hto view the help menu.