CloudHub 2.0 deployment through Maven in Mule

  • December 14, 2022

CloudHub 2.0 simplifies the deployment and running of the MuleSoft application in a containerized environment, based on the Kubernetes. It provides for deployments across 12 regions globally.

Why Cloudhub 2.0

  • There’s no need to manage a dedicated load balancer because CloudHub 2.0 provides a built-in Ingress load balancer with auto-scaling capabilities in the private space.
  • We have the option to configure inbound and outbound firewalls. This enables us to block or allow traffic from specific ports.
  • We’re provided with built-in security policies that secure the services and sensitive data with encrypted secrets.

CloudHub 2.0 vs. CloudHub 1.0

CloudHub 1.0 CloudHub 2.0
Provision/Scaling Supported Supported
URL rewriting Supported (DLB) Supported (app level)
Load Balancer Logs Not supported Supported (download)
Multiple custom endpoints Partially supported Supported
Multiple truststores (client certificates for mutual TLS) Not supported Supported
Direct Connect/VPC Peering Supported (not self service) Not supported
VPC/VPN/Transit Gateway Supported Supported (private access)
Outbound firewall rules Not supported Supported
Log forwarding Supported (per app) Supported (per app)
Custom notifications (CloudHub Connector) Supported Not supported

Implementation steps needed in pom.xml for deployment are:

  • In the Mule project, in pom.xml we need to make sure our Mule maven plugin version is 3.7.1 or above for deployment to CloudHub 2.0.
  • We must also add the necessary “configuration” details for CloudHub 2.0 in the pom.xml file.
<mule.maven.plugin.version>3.7.1</mule.maven.plugin.version>

<configuration>
<cloudhub2Deployment>
<uri>https://anypoint.mulesoft.com</uri>
<provider>MC</provider>
<environment>Sandbox</environment>
<target>Cloudhub-US-East-2</target>
<username>${anypoint.username}</username>
<password>${anypoint.password}</password>
<applicationName>cloudhub2-test</applicationName>
            <businessGroupId>**********-e628</businessGroupId>
<replicas>1</replicas>
<vCores>0.1</vCores>
</cloudhub2Deployment>
<classifier>mule-application</classifier>
</configuration>
  • We can publish to Exchange through Anypoint Studio with Project Type set to Example.

Publish to Exchange

  • We can verify this from Exchange.

Verify from Exchange

  • Open the command prompt in the project location, where pom.xml is present. Run the below Maven command to deploy the application.
mvn clean package deploy -DmuleDeploy -Danypoint.username=<username> -Danypoint.password=<password>
  • This gives us Build Success, and we can check the Running status in Runtime Manager on the Anypoint platform.

Running status in Runtime Manager

Mpte: Common Issues faced during deployment:

  • GAV could not be retrieved from Exchange – Bad Request

GAV stands for GroupId, ArtifactId, VersionId.

Resolution: The publish to Exchange step is necessary for Cloudhub 2.0 Deployment.

Configuration is invalid while building

  • Configuration is invalid while building.

Resolution: Make sure the Mule Maven plugin version is 3.7.1 or higher.

— By Payal Jain