Adding alternative command to create namespace (#14974)

* Adding alternative command to create namespace

As this is first place user look to find details to create a namespace, added an alternative command to create a namespace. Also, this is mostly used way to create namepsace instead of YAML.

* Correcting Formatting

Correcting formatting for changes

* Update namespaces.md
This commit is contained in:
Rajesh Deshpande
2019-06-20 00:42:32 +05:30
committed by Kubernetes Prow Robot
parent 5a4b7a38bc
commit c82a5e402c
@@ -89,13 +89,18 @@ kind: Namespace
metadata: metadata:
name: <insert-namespace-name-here> name: <insert-namespace-name-here>
``` ```
Then run: Then run:
```shell ```
kubectl create -f ./my-namespace.yaml kubectl create -f ./my-namespace.yaml
``` ```
2. Alternatively, you can create namespace using below command:
```
kubectl create namespace <insert-namespace-name-here>
```
Note that the name of your namespace must be a DNS compatible label. Note that the name of your namespace must be a DNS compatible label.
There's an optional field `finalizers`, which allows observables to purge resources whenever the namespace is deleted. Keep in mind that if you specify a nonexistent finalizer, the namespace will be created but will get stuck in the `Terminating` state if the user tries to delete it. There's an optional field `finalizers`, which allows observables to purge resources whenever the namespace is deleted. Keep in mind that if you specify a nonexistent finalizer, the namespace will be created but will get stuck in the `Terminating` state if the user tries to delete it.