Supervisor Series: Ep 4. Deploying a 3-Tier Application with Cloud Consumption Interface (CCI)

Self-service is a crucial part of Developer Experience. Platform consumers need to be able to quickly and efficiently access Iaas Services provided by the Supervisor. Cloud Consumption Interface achieves this through a common cloud web portal (UI), API, and CLI. 

In this episode we will deploy the same application as we did last time, but this time using Cloud Consumption Interface (CCI).

image-20230818003841-3

Accessing Cloud Consumption Interface (CCI)

General Availability (GA) of CCI has been formally announced at VMware Explore Las Vegas. As of today, the Initial Access (IA) phase of CCI is open for all vSphere+ customers. This presents an exclusive opportunity for these users to get a firsthand experience of CCI’s powerful offerings and contribute to its refinement through valuable feedback.

CCI can be accessed from VMware Cloud Services portal, by launching vSphere+ and selecting a vCenter that has Developer Experience enabled.

Note: You can learn more about the Developer Experience enablement in this video.

image-20230818004231-4

Once logged in, users can browse through Projects they have been assigned to and select the one they want to use. We will deploy the application in the default project.

After clicking on Supervisor Namespaces, we will see a landing page, where we can create new Namespaces and download the kubectl cci plugin which we will need later. 

Note: The landing page will be only displayed during the initial setup. To ensure a smooth workflow later on, we recommend downloading the kubectl cci plugin at this point.

image-20230818004537-5

Creating a namespace

The first thing we need to do is to create a new Supervisor Namespace, called namespace-1. We will select basic Namespace class which is available by default, and select onprem region to specify where we want to create the namespace. Note that Supervisor and vCenter name have been abstracted away in a cloud-like fashion.

image-20230818004646-6

Once the namespace is created, we will see all available Services that are available for consumption.

image-20230824120408-1

Deploying a VM

Now that we have a namespace, we will start with deploying a Virtual Machine which will host our MySQL database. We will select a VM name, VM image, and VM class. Notice how the VM YAML manifest is automatically generated for us on the right side of the screen!

image-20230818004738-7

We now have an option to configure some advanced settings, such as SSH keys, Persistent Volumes, and Load Balancer. For our demo we will configure the Load Balancer to expose our VM on required ports - ssh (22) and mysql (3306).

We will also paste in our cloud-config to configure the database using cloud-init. We can just use clear text as the base64 encoding will be done for us.

image-20230818004813-8

Before deploying the VM, we also have an option to download the YAML manifest that has been generated.

Deploying a TKG cluster

Next we need a TKG cluster. We will click into Tanzu Kubernetes Grid service tile and select ClusterClass API and Custom Configuration options. We will proceed with configuring the cluster with the same values as we've used before. Again, notice how the TKG YAML manifest is automatically generated and updated based on the values we select!

image-20230818004858-9

We will configure Control Plane with a single replica and Ubuntu as the OS Image.

image-20230824122257-1

We will create a Nodepool with 2 worker node replicas.

image-20230824122404-2

image-20230818005036-11

Once we have configured the control plane and worker nodes, we can again download the YAML, and proceed with deployment.

How to generate an API token

To access CCI we will have to generate an API token. This can be done in VMware Cloud Services, under My Account. Minimum required roles are Assembler User and Service Broker User.

image-20230818010731-1

Deploying the application via CLI

To connect to CCI using CLI, we first need to download and configure the kubectl cci plugin on our cli machine.

We login to CCI using the API token we have generated earlier by executing the following command:

  • kubectl cci login -t token --server api.mgmt.cloud.vmware.com

Once logged in, the first thing we need to do is to obtain the Supervisor IP. To do this, we switch context to cci and describe the supervisor namespace:

  • kubectl config use-context cci
  • kubectl describe svns -A

image-20230818005144-12

Now we can login to the tkg cluster we deployed earlier, by using the Supervisor IP and following command:

  • kubectl vsphere login --server=SupervisorIP --tanzu-kubernetes-cluster-name tkg-cc-1 --tanzu-kubernetes-cluster-namespace namespace-1 --vsphere-username yourusername@domain

image-20230818005218-13

Now we can proceed with deploying the application in the same way as we would in any other environment.

Note: If you are interested in detailed steps, feel free to check out the previous episode where we discuss them in detail.image-20230818005304-14

Once we have the External IP of the Frontend service, we can open it in a browser to make sure our application loads correctly. image-20230818005345-15

See this episode in action

Before you go

In this episode, we have shown you how you can deploy a 3-tier application on a Supervisor, using Cloud Consumption Interface.

For more episodes visit the Supervisor Series Activity Path.

Subscribe to our VMware vSphere YouTube channel to get notified as soon as we release new episodes.

Thank you and see you soon!

Filter Tags

Modern Applications vSphere 8 vSphere with Tanzu Kubernetes Supervisor Tanzu Kubernetes Grid VM Service Document Feature Walkthrough Operational Tutorial Proof of Concept Quick-Start