VMware Cloud on AWS Kubernetes

Introducing support for automating vSphere with Kubernetes

VMware vCenter 7 introduced vSphere with Kubernetes. This feature allows for hosting of Kubernetes workloads in vCenter. Read more about it here.

In the Kubernetes world, a namespace is a group of resources available to host workloads similar to the resource pool concept in vCenter. These resources include not only compute but also storage and networking resources.  Namespaces provide an abstraction that holds both Kubernetes and vCenter policy allowing for vCenter administrators to provide resources to developers while maintaining control and policy enforcement.

The namespace has a separate set of permissions and allows the vCenter administrator to grant access to the developers that would use that namespace to run workloads. If the namespace needs access to a specific storage class, the administrator can grant access to that storage through a Storage Policy.

With PowerCLI 12.0, we introduced a new module – VMware.VimAutomation.WorkloadManagement, which allows you to automate tasks related to workload management in vCenter.  With the first version of this module, we are enabling the automation of setting up a new namespace.  The examples below assume you have successfully enabled workloads for a Cluster in vCenter.

You can create a new namespace using the New-WMNamespace command. Note that the namespace name must be a valid Kubernetes identifier.

You need to define a Storage Policy in vCenter that the workloads running in the namespace would use. You can define multiple Storage Policy objects if the namespace would use more than one type of storage.

For this example, we define a policy called “RedundantStorage” that we want the developers to be able to use for their application storage. We set a limit of 30000 MiB. This limit can be changed later.

This storage is available as a Kubernetes storage class that the developers can reference in their application specifications.

Next, we need to give permissions to the developers working on that project so they can use the namespace.  For this example, we assume they are members of the group team1@mydomain.local and they need Edit rights for the namespace.

Now the developers should be able to use the Kubernetes namespace.

To verify that the namespace is available, follow the “Link to CLI Tools” in the web interface shown when you open the Namespace. This provides you with the instructions specific to your version and a link to download Kubectl and the vSphere plugin. Developers should use those instructions to connect and use this namespace.


6 comments have been added so far

  1. The timing is right to start making some future plans and to enjoy yourself. I’ve read this post and if I may, I’d want to recommend a few interesting things or suggestions for your consideration. Maybe you should use this article as a reference in your upcoming writing. I’m interested in reading more about it!

Leave a Reply

Your email address will not be published. Required fields are marked *