From c82a5e402c10e4c6821519020c8b46360ca91276 Mon Sep 17 00:00:00 2001 From: Rajesh Deshpande Date: Thu, 20 Jun 2019 00:42:32 +0530 Subject: [PATCH] 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 --- .../tasks/administer-cluster/namespaces.md | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/namespaces.md b/content/en/docs/tasks/administer-cluster/namespaces.md index 6900d6d558..d8d7e9b827 100644 --- a/content/en/docs/tasks/administer-cluster/namespaces.md +++ b/content/en/docs/tasks/administer-cluster/namespaces.md @@ -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: -``` + ```yaml + apiVersion: v1 + kind: Namespace + metadata: + name: + ``` + 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 + ``` Note that the name of your namespace must be a DNS compatible label.