Create vSphere namespaces from Aria Automation

In this post we'll take a look at how to integrate vRealize Automation (Aria Automation) and vSphere with Tanzu (TKGs)

One use-case for this is the ability to allow for self-service of Supervisor namespaces. A developer could request a namespace in a designated vRA Project and from that start to deploy their Kubernetes workloads without the need for contacting the vSphere Administrator. And since vRA both offers a UI and an extensive API the developers can request the resources the way that suits them best.

Environment Setup

The environment consists of a vSphere cluster running 7.0.3 with Workload Management enabled. The cluster is a vSAN cluster and workload management is using NSX-T as the network provider. The NSX-T cluster is running on version 4.0

Workload Management

The vRA instance we're working with is running version 8.10.2 and has Cloud Accounts connected to both vCenter and NSX-T

vRA cloud accounts

Kubernetes zone setup in Aria Automation

To start off we will add the Supervisor cluster to our Kubernetes resources in vRA

Kubernetes resources

We'll select the Cloud Account for the vCenter running the Supervisor cluster, and then we can select the Supervisor cluster itself

Select Supervisor cluster

With that the Supervisor cluster should be added

Supervisor added

Next we'll create a Kubernetes Zone which is like a Cloud Zone for compute

Add Kubernetes zone

And add in the Supervisor cluster as the compute for this zone.

Add Supervisor cluster to Kubernetes zone

Now we should have our Kubernetes Zone created

Kubernetes zone created

Now, like we have to do for Cloud Zones, we'll have to add the zone to a project for it to be able to provision to it

Add zone to project

Note that we can set limits for the number of namespaces that the project can create, and also priorities if more zones exists

Add zone with limit and priority

With that in place, let's see if we can create our self-service template

Create Cloud Template

First, let's create a new Cloud Template

Create new Cloud Template

Add in a Supervisor namespace to the canvas, create a Input for the name and hook that up to the name property of the namespace

Create CT

Before trying to deploy the template it's a good practice to run a Test. For a Supervisor namespace there's not much to be tested, but we'll do it anyways

Run test

Now, with the test passed let's deploy a real namespace!

Run deployment

Seems we have a success!

Deployment successful

And to confirm we can check the namespaces from the vSphere client

vSphere namespaces

Now let's finish up with versioning the template so that we can enable it for self-service through the Service Broker

Version the template

Service Broker catalog

Depending on the Sharing definition policy the template could now be available for requesting

Catalog item

Let's try it out!

Request catalog item

Note that the namespace name must be DNS compliant, meaning that things like spaces is not supported. This could be handled with something like a Regex constraint or an external validation tied to the input field

Hopefully this went successfully, let's see if we can verify it in vCenter.

vSphere namespaces

From the vCenter tasks pane we can also see that the integrated Harbor registry has created a project for our new namespace.

Our deployed Supervisor namespaces will also appear in the Cloud Assembly Resources

Cloud Assembly resources

Now, to tidy up, let's remove our first test deployment

Delete deployment

Which will delete the namespace in vSphere and also clean up in Harbor

Namespace removed

But, wait. What about configuration of the namespaces?

This integration between vRA and TKGs is obviously very simple. If you create a namespace in vSphere you'll have the ability to set limits, permissions, assign storage and more.

In an upcoming post we'll take a look at how to amend that with vRealize Aria Orchestrator (vRO), and later with a few of the newer abilities in vRA.

This page was modified on February 16, 2023: Added note on coming post