How to change default Namespace in Kubernetes?

0 votes

Hi Guys,

I am new to Kubernetes. By default, all the resources are running in the default namespace. I have created one namespace. But still, the new resources are launching in the default namespace. Can anyone tell me how can I change the default namespace?

Jul 5 in Kubernetes by akhtar
• 18,250 points
102 views

1 answer to this question.

0 votes

Hi@akhtar,

Kubernetes will automatically create one namespace named default namespace. You need to change the default namespace name in the configuration file. You can use the below-given command.

$ kubectl config set-context --current --namespace=namepsace_name

This command will automatically update the namespace name in the configuration file. I hope this will help you.

answered Jul 5 by MD
• 42,420 points

Related Questions In Kubernetes

0 votes
1 answer

Kubernetes: Unable to get services in namespace: logs"system:serviceaccount:default:default"

Your approach is wrong here. Namespace is ...READ MORE

answered Oct 26, 2018 in Kubernetes by ajs3033
• 7,280 points
2,640 views
0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,280 points
852 views
0 votes
1 answer

How do I sign-in to kubernetes dashboard?

Since version 1.7 Dashboard uses more secure ...READ MORE

answered Sep 7, 2018 in Kubernetes by DareDev
• 6,850 points
608 views
0 votes
2 answers
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
7,619 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,890 points

reshown Apr 12, 2019 by Kalgi 2,239 views
0 votes
1 answer

How to create deployment build in kubernetes?

Hi@akhtar, To create any resources in kubernetes you ...READ MORE

answered May 18 in Kubernetes by MD
• 42,420 points
44 views
0 votes
1 answer

How to launch one Pod in a particular namespace in minikube?

Hi@akhtar, You can pass your namespace name when ...READ MORE

answered Jun 30 in Kubernetes by MD
• 42,420 points
45 views