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:
committed by
Kubernetes Prow Robot
parent
5a4b7a38bc
commit
c82a5e402c
@@ -83,18 +83,23 @@ See the [design doc](https://git.k8s.io/community/contributors/design-proposals/
|
|||||||
|
|
||||||
1. Create a new YAML file called `my-namespace.yaml` with the contents:
|
1. Create a new YAML file called `my-namespace.yaml` with the contents:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: <insert-namespace-name-here>
|
name: <insert-namespace-name-here>
|
||||||
```
|
```
|
||||||
|
Then run:
|
||||||
|
|
||||||
Then run:
|
```
|
||||||
|
kubectl create -f ./my-namespace.yaml
|
||||||
|
```
|
||||||
|
|
||||||
```shell
|
2. Alternatively, you can create namespace using below command:
|
||||||
kubectl create -f ./my-namespace.yaml
|
|
||||||
```
|
```
|
||||||
|
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.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user