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:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: <insert-namespace-name-here>
|
||||
```
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: <insert-namespace-name-here>
|
||||
```
|
||||
Then run:
|
||||
|
||||
```
|
||||
kubectl create -f ./my-namespace.yaml
|
||||
```
|
||||
|
||||
Then run:
|
||||
2. Alternatively, you can create namespace using below command:
|
||||
|
||||
```shell
|
||||
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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user