-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0643ba7
commit 5769c01
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
content/blog/how-to-switch-namespace-in-kubernetes/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: 'How to Switch Namespaces in Kubernetes' | ||
date: "2023-08-23" | ||
slug: 'how-to-switch-namespace-in-kubernetes' | ||
tags: | ||
- devops | ||
- kubernetes | ||
- how-to | ||
show: true | ||
author: shivam | ||
--- | ||
|
||
|
||
## What is Namespace in Kubernetes? | ||
|
||
In simple words, namespaces offer a means of segregating sets of resources within a unified cluster. | ||
|
||
|
||
## Changing Namespaces Using the kubectl Command | ||
|
||
We can change namespace with using `kubectl` cli tool like: | ||
|
||
``` | ||
kubectl config set-context --current --namespace=<new-namespace> | ||
``` | ||
|
||
### Verifying namespace change | ||
|
||
With same `kubectl` tool we can verify easily with command: | ||
|
||
``` | ||
kubectl config view --minify --output 'jsonpath={..namespace}' | ||
``` | ||
|
||
<center>Hope this helps 🙏🙏🙏</center> |