Creating a namespace
Applications must be created or deployed under a namespace in an IBM® Cloud Private cluster. Namespaces are required to organize users and their applications.
Required user type or access level: Cluster administrator or team administrator
- Log on as a cluster administrator.
- From the navigation menu, click Manage > Namespaces.
- Click Create Namespace.
- Enter a name for your namespace. The namespace name must meet the Kubernetes requirements for namespaces, including:
- Be unique. You cannot use a duplicate namespace name.
- Not exceed 63 characters in length.
- Contain only lowercase letters, numbers, and the dash symbol (-).
- Click Create.
After the deployment completes, a new namespace is displayed on the Namespaces page.
Note: Be sure to scroll the All namespaces
menu to view all of your namespaces.
Adding a label
You can use labels to create network policies that are based on a namespace selector. You cannot add labels for a namespace from the IBM Cloud Private management console. To add namespace labels, use the Kubernetes CLI.
-
Install the
kubectl
command line interface. See Accessing your cluster from the kubectl CLI. -
View a list of all namespaces.
kubectl get namespaces
The output resembles the following code:
NAME STATUS AGE default Active 6h dev Active 2h kube-system Active 6h qa Active 2h
-
Add label.
kubectl label namespaces dev team=dev