Deploying a three-tier application is a common task for many organizations, and as more companies move to the cloud, it’s essential to understand how to deploy such applications in the cloud environment. In this blog post, we will explore how to deploy a three-tier application from vRealize Automation 8 in Google Cloud Platform (GCP) using a blueprint.
Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google. It provides a wide range of services such as virtual machines, storage, and networking, among others, that can be used to deploy and run applications in the cloud. One of the advantages of using GCP is its high availability and scalability, which makes it an excellent option for deploying enterprise-grade applications.
vRealize Automation 8 Overview
vRealize Automation 8 is a cloud automation platform that enables IT teams to automate the delivery and management of infrastructure, applications, and custom services. It provides a self-service catalog for end-users to request IT services, including the ability to deploy and manage multi-tier applications.
Deploying a Three-Tier Application from vRA 8 in GCP
To deploy a three-tier application from vRA 8 in GCP, we will use a blueprint. A blueprint is a set of instructions that define the components, configuration, and dependencies of an application. In this example, we will use a blueprint to deploy a simple three-tier application that consists of a web server, application server, and database server.
The following are the steps required to deploy the application:
- Create a new project in GCP and enable the Compute Engine API.
- Create a service account in GCP and assign it the necessary roles.
- Create a blueprint in vRA 8 and add the necessary components and dependencies.
- Publish the blueprint in vRA 8 and create a deployment.
- Monitor the deployment in vRA 8 and GCP.
Let’s go through each step in detail.
Step 1: Create a new project in GCP and enable the Compute Engine API. To create a new project in GCP, follow these steps:
- Go to the GCP Console (console.cloud.google.com).
- Click on the project drop-down menu in the top left corner of the screen.
- Click on the “New Project” button.
- Enter a name for the project and click on the “Create” button.
- Once the project is created, select it from the project drop-down menu.
- Enable the Compute Engine API by navigating to APIs & Services > Library and searching for Compute Engine. Click on the “Enable” button.
Step 2: Create a service account in GCP and assign it the necessary roles. To create a service account in GCP, follow these steps:
- Go to the GCP Console (console.cloud.google.com).
- Navigate to the IAM & Admin > Service Accounts page.
- Click on the “Create Service Account” button.
- Enter a name for the service account and click on the “Create” button.
- On the “Create Key” tab, select “JSON” as the key type and click on the “Create” button. This will download a JSON file containing the service account key.
- Assign the service account the necessary roles by navigating to IAM & Admin > IAM and adding the roles “Compute Instance Admin (v1)” and “Service Account User” to the service account.
Step 3: Create a blueprint in vRA 8 and add the necessary components and dependencies. To create a blueprint in vRA 8, follow these steps:
- Log in to the vRA 8 Console.
- Click on “Design” in the top menu
- Click on “Blueprints” in the left-hand menu and then click on the “New Blueprint” button.
- Enter a name for the blueprint and select the “Cloud Template” as the blueprint type.
- In the blueprint canvas, drag and drop the following components from the component palette onto the canvas: Compute, Load Balancer, Database, and Networking.
- Connect the components together by dragging and dropping the appropriate connectors between them.
- Configure the components by double-clicking on them and entering the necessary information such as the VM template, disk size, network settings, etc.
- Add any necessary dependencies between the components, such as making the application server depend on the database server.
- Save the blueprint.
Step 4: Publish the blueprint in vRA 8 and create a deployment. To publish the blueprint in vRA 8 and create a deployment, follow these steps:
- Click on “Publish” in the top menu of the blueprint canvas.
- Enter a version number and any release notes, and then click on the “Publish” button.
- Click on “Deployments” in the left-hand menu and then click on the “New Deployment” button.
- Select the published blueprint from the dropdown list and enter a name for the deployment.
- Configure any necessary settings such as the number of instances for each component.
- Click on the “Deploy” button.
Step 5: Monitor the deployment in vRA 8 and GCP. To monitor the deployment in vRA 8 and GCP, follow these steps:
- In vRA 8, navigate to the deployment’s details page by clicking on the deployment name in the deployments list.
- Monitor the deployment status and any associated tasks or events.
- In GCP, navigate to the Compute Engine > Instances page to view the deployed VM instances.
- Monitor the VM instance status and any associated logs or metrics.
Code Example The following is an example code snippet that can be used to define the components in the blueprint:
resources: - name: web-server type: Cloud.Machine properties: flavor: small image: CentOS 7 networks: - network: my-network assignment: static ipAddress: 10.0.0.10 userData: value: | #!/bin/bash yum install -y httpd systemctl enable httpd systemctl start httpd - name: app-server type: Cloud.Machine properties: flavor: medium image: CentOS 7 networks: - network: my-network assignment: static ipAddress: 10.0.0.20 userData: value: | #!/bin/bash yum install -y java-1.8.0-openjdk curl -L https://tomcat.apache.org/download-80.cgi#8.5.38 -o /tmp/tomcat.tar.gz mkdir /opt/tomcat tar xzvf /tmp/tomcat.tar.gz -C /opt/tomcat --strip-components=1 systemctl enable tomcat systemctl start tomcat - name: database-server type: Cloud.Machine properties: flavor: large image: CentOS 7 networks: - network: my-network assignment: static ipAddress: 10.0.0.30 userData: value: | #!/bin/bash yum install -y mariadb-server systemctl enable mariadb systemctl start mariadb
In conclusion, deploying a three-tier application from vRA 8 in GCP using a blueprint can be a straightforward process if you follow the necessary steps. By using GCP, you can benefit from its high availability and scalability features, which are essential for enterprise-grade applications. Additionally, vRA 8’s automation capabilities can help streamline the deployment process and reduce the likelihood of errors. By leveraging these tools and technologies, you can deploy a robust and scalable application infrastructure in the cloud.