Kubefeeds Team A dedicated and highly skilled team at Kubefeeds, driven by a passion for Kubernetes and Cloud-Native technologies, delivering innovative solutions with expertise and enthusiasm.

Effortless K8s Namespace Switching Using Konfig

15 sec read

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 .

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.

Kubefeeds Team A dedicated and highly skilled team at Kubefeeds, driven by a passion for Kubernetes and Cloud-Native technologies, delivering innovative solutions with expertise and enthusiasm.