Kubectl Change Namespace -

Kubectl Change Namespace -

alias kchns='kubectl config set-context --current --namespace' Then use:

However, you can change the namespace in several effective ways: (most common) kubectl get pods -n my-namespace 2. Change default namespace for current context (persistent until changed) kubectl config set-context --current --namespace=my-namespace After this, kubectl get pods will use my-namespace without -n . 3. View current namespace kubectl config view --minify -o jsonpath='{..namespace}' 4. Using kubectl plugin kubens (if installed) # Install kubens (part of kubectx) git clone https://github.com/ahmetb/kubectx /opt/kubectx ln -s /opt/kubectx/kubens /usr/local/bin/kubens Change namespace kubens my-namespace 5. Quick alias for convenience Add to ~/.bashrc or ~/.zshrc : kubectl change namespace

The short answer:

Akash Ali

Hi, I'm Akash Ali. I'm a passionate gamer who enjoys playing a wide variety of games. I created Pc Compressed Games to support fellow gamers by offering access to highly compressed games that are simple to download and fun to play. My mission is to make gaming more accessible and… More »

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button