DEV Community

웃

Posted on

Effortless K8s Namespace Switching Using Konfig

1. Create a directory in the .kube folder:
❯ mkdir -p ~/.kube/configs

2. Download all the config files and place them in the folder

❯ cd ~/.kube/configs
❯ mv ~/Downloads/dev.yml .
❯ mv ~/Downloads/test.yml .
Enter fullscreen mode Exit fullscreen mode

3. Install Konfig

❯ kubectl krew install konfig

4. Use Konfig to merge all the configs into a single config file that Kubernetes uses

❯ kubectl konfig merge ~/.kube/configs/* > ~/.kube/config

Now, you can easily switch between different environments using kubectx and kubens.

Top comments (0)