Create a vSphere Namespace
vSphere Namespace
You can use the
vSphere Supervisor
automation REST
APIs to create namespaces on a
Supervisor
. You can set resource quotas,
storage, as well as permissions for the DevOps users.- EnablevSphere Supervisoron a vSphere cluster.
- Create users and groups for the DevOps engineers who will use the namespace. For more information about how to create users and groups through the Web Services APIs, see thevSphere Web Services SDK Programming Guide.
- Create storage policies for persistent storage used by thevSphere Pods and the pods inside aTKGcluster.
- Create VM Classes and content libraries for DevOps provisioned VMs. See Create a VM Class in vSphere Supervisor and Creating and Managing Content Libraries for VM Provisioning in vSphere Supervisor.
- Required privileges on theSupervisor:
- Retrieve theSupervisorID by filtering the clusters available in thevCenter Serversystem.Use theGET https://request and retrieve the ID of the cluster on which you want to create a namespace from the list of cluster summary JSON objects.<vcenter_ip_address_or_fqdn>/api/vcenter/namespace-management/clusters
- Retrieve the ID of the storage policy that you configured for placement of the persistent volumes fromvSphere Pods andTKGclusters.
- Configure the access control to the objects in the namespace.Populate the properties of theInstances.Accessdata structure with appropriate values:PropertyDescriptiondomainSet the domain name of thevCenter Serversystem on which the namespace is created.subject_typeSet the type of the user accounts that are associated with the specific role for the namespace. You must select between theUSERandGROUPoptions.subjectSet the name of the user or group that have permissions to access the namespace objects.roleSet the role that is associated with the predefined set of privileges that you want to grant the specific user or group. You can select between theEDIT,VIEWandOWNERroles.The owner role is introduced in vSphere 7.0 Update 2a. When a DevOps engineer creates a namespace in a self-service manner, the Namespace Self-Service grants the owner role to the namespace creator. See Self-Service Namespace Management.
- Populate theInstances.CreateSpecdata structure with the appropriate namespace specification information.The namespace specification can contain the following information:PropertyDescriptionclusterSet the ID of theSupervisoron which the namespace is created.namespaceSet a name of the namespace following the DNS label standard defined in RFC 1123. The name must be unique across all namespaces in the currentvCenter Serversystem.networksOptional. You can set the workload networks used by thevSphere Namespace. Passnullas a value of this parameter, if theSupervisoris configured to useNSXas networking solution. The workload networking support for such namespaces is provisioned byNSX.If theSupervisoruses the vSphere networking stack, pass the workload network to be associated with the namespace. If you passnullas a value of this parameter, thevSphere Namespaces on the cluster are automatically associated with the cluster primary workload network. See Configuring the vSphere Networking Stack for vSphere Supervisor.descriptionOptional. You can set a description of the namespace.access_listOptional. You can set the access control that is associated with the namespace in Step 3.storage_specsOptional. You can set the amount of storage dedicated to each storage policy associated with the namespace and the maximum amount of storage that is used by the namespace. Use theStorageSpecspecification to configure the storage quotas on the namespace.resource_specOptional. You can set resource limitations to the namespace. You can limit the CPU, memory, the maximum number of pods that can exist on the namespace, and so on.creatorOptional. The Namespace Self-Service populates this parameter with information about the DevOps user who created the namespace withcubectl. The user name and domain of the namespace creator are stored with this parameter.vm_service_specOptional. The VM Service specification for the Dev-Ops provisioned virtual machines.
- Create a namespace object on theSupervisorby using the namespace create specification.Use thePOST https://request and submit an<vcenter_ip_address_or_fqdn>/api/vcenter/namespaces/instancesInstances.CreateSpecJSON object in the request body.
Share the namespace with DevOps engineers and provide them with the user or group configured for accessing the namespace.