odo create namespace
odo create namespace
lets you create a namespace/project on your cluster. If you are on a Kubernetes cluster, running the command will create a Namespace resource for you, and for an OpenShift cluster, it will create a Project resource.
Any new namespace created with this command will also be set as the current active namespace, this applies to project as well.
Running the command
To create a namespace, run the following command:
odo create namespace <name>
Example
$ odo create namespace odo-dev
✓ Creating the namespace "odo-dev" [1s]
✓ Namespace "odo-dev" is ready for use
✓ New namespace created and now using namespace: odo-dev
Optionally, you can also use project
as an alias to namespace
.
To create a project, run the following command:
odo create project <name>
Example
$ odo create project odo-dev
✓ Creating the project "odo-dev" [1s]
✓ Project "odo-dev" is ready for use
✓ New project created and now using project: odo-dev
Using either of the aliases will not make any change to the resource created on the cluster. This command is smart enough to detect the resources supported by your cluster and make an informed decision on the type of resource that should be created.
So you can run odo create project
on a Kubernetes cluster, and it will create a Namespace
resource, and you can run odo create namespace
on an OpenShift cluster, it will create a Project
resource.