DEV Community

웃

Posted on • Edited 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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay