skip to Main Content

How to switch to a different Kubernetes namespace?

kubectl config set-context --current --namespace=my-namespace

When working with Kubernetes, a common task is to change the Kubernetes namespace using kubectl, allowing users to switch between different environments or application scopes. This is often achieved by setting a default namespace in Kubernetes or by using commands to change context namespace directly. Furthermore, understanding the distinction between Kubernetes namespace vs context and how to set the namespace for the current context can help optimize cluster management. By ensuring you know how to view the current Kubernetes namespace and adopting kubectl namespace best practices, you can manage and navigate your resources more effectively.

How to Create a Soft Symbolic Link (symlink) in Unix/Linux

# Create a soft symbolic link from /mnt/original (file or folder) to ~/link
ln -s /mnt/original ~/link

See also:

You way be wondering why I wrote this blog post? This is pretty well known and there are hundreds of results in Google if you forget. Well, the problem is most of the current Google results require you to scroll down very far to get to the main point. So with this post, I can just google for “chinhdo symbolic link” and I find what I need immediately right at the top of the page.

How to Configure Git Username and Email Address

git config --global user.name "<your name>"
git config --global user.email "<youremail@somewhere.com>"

Related Commands

Show current git configuration:

git config --list 

Additional Information

If you get this error in Visual Studio Code when trying to commit without first setting git username/email, then run the above commands to fix: “Make sure you configure your ‘user.name’ and ‘user.email’ in git.”

You way be wondering why I wrote this blog post? The reason is that most of the current Google results require you to scroll down very far to get to the main point. So with this post, I can just google for “chinhdo git username” and I find what I need immediately right at the top of the page.

Back To Top