Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
{ "lCode": "en_US", "lName": "English", "folder": "en_US" }
English
 

Create a Namespace

date_range 23-Dec-19

Creating a namespace is pretty simple. The kubectl command does the magic. You don’t need to have a YAML file:

content_copy zoom_out_map
root@test3:~# kubectl create ns dev
namespace/dev created

And the new namespace dev is now created:

content_copy zoom_out_map
root@test3:~# kubectl get ns
NAME STATUS AGE
default Active 15d
dev Active 5s #<-----

Now the webserver1 pod in dev namespace won’t conflict with webserver1 pod in the sales namespace:

content_copy zoom_out_map
$ kubectl get pod --all-namespaces -o wide
NAMESPACE  NAME	READY  STATUS    RESTARTS AGE  IP		NODE NOMINATED NODE
dev		webserver1  	1/1   	Running 4		2d4h 10.47.255.249 cent222 <none> 
sales		webserver1  	1/1   Running 4		2d4h 10.47.255.244 cent222 <none>
footer-navigation