curl -Lvk -XGET {application-path-from-runtime-manager} --resolve {hostname}:443:{ip-address-of-controller}
Deploy a Mule Application to Runtime Fabric
Deploy a Mule application to Anypoint Runtime Fabric and test the inbound traffic for deployed applications.
Before You Begin
Before deploying an application to Anypoint Runtime Fabric, you must perform the following:
-
Install and configure Anypoint Runtime Fabric. See Begin Runtime Fabric Installation for more information.
-
Ensure that Runtime Fabric is associated with an environment.
-
Determine the resource allocation requirements for your application. See Determine Application Resource Allocation on Runtime Fabric for more information.
-
Your Anypoint user may require the Exchange Contributors permission to deploy applications to Runtime Fabric.
Deploy an Application
To deploy an application, perform the following steps:
-
Sign into Anypoint Platform.
-
Navigate to Runtime Manager, and select the Applications section.
-
Click Deploy application.
-
Provide a name for your application in the Application Name field.
The name can contain only lowercase alphanumeric characters, hyphens, and underscores.
-
Click Choose File to select the application to deploy, then select one of the following options:
-
Import file from Exchange: Enables you to select a Mule application stored in Anypoint Exchange.
-
Upload file: Enables you to select a Mule application file from your filesystem.
-
-
Select the name of your Runtime Fabric from the Deployment Target drop-down list.
The Deployment Target, Ingress, and Properties, and JVM tabs are displayed. Use these tabs to enter additional configuration information for your application.
-
Select the Deployment Target tab.
This tab displays the name and type of the deployment target you selected above.
-
Select the Mule runtime engine version from the Runtime Version drop-down list.
-
Select the number of replicas, or instances, of the application to deploy.
A minimum of two replicas is required for high availability. -
To enable Mule clustering across each replica of the application, enable Run in Runtime Clustering Mode.
-
To enforce the deployment of replicas across different nodes, select Enforce deploying replicas across nodes. This option is only available for Runtime Fabric version 1.5.25 or later.
This can cause some replicas in the deployment to remain in Pending status if there are unsufficient worker nodes or resources available on the worker nodes needed to deploy each replica. The deployment status will transition to Running after all replicas are deployed on different worker nodes. -
Specify the number of Cores and amount of Memory to allocate to each replica of the application by adjusting the sliders to the appropriate values.
See how to determine resource allocation for applications deployed to Runtime Fabric.
-
Specify network configuration for the application:
-
Click the Ingress tab.
-
Enable or disable the following options:
-
Enable inbound traffic to this application to allow incoming HTTP requests to be processed by this application. Ensure your application is configured to accept connections on port 8081.
-
Enable Last-Mile security to forward HTTPS connections to be decrypted by this application. This requires an SSL certificate to be included in the Mule application, and also requires more CPU resources.
-
-
-
Configure application properties:
-
Click the Properties tab.
-
Specify your application properties as key-value pairs.
-
-
Click Deploy Application.
If the Deploy Application button is disabled, ensure that you have uploaded a valid Mule application file. Also ensure that the Mule runtime engine version you selected is the same as the version used by your application.
Result: Runtime Manager displays a status message confirming the application deployment. After the deployment starts, you’ll be directed to the applications list page where you can view the deployment status.
For newly deployed applications, the status initially displays as Starting. The status updates to Started if the application is successful. Monitor the application status to ensure that it starts successfully.
Verification
To test inbound traffic for deployed applications, you can send a request using the controller IP address along with a host header set to the domain. The host header depends on the structure of the application URL.
-
Determine which endpoint exposes the application. The Application url field on the Manage application page in Runtime Manager contains this information.
-
Run the following cURL command for verification:
In the following example,
{application-path-from-runtime-manager}
is set tohttps://newapp.example-rtf.dev
, and192.168.64.14
is the IP address of a controller machine in your cluster.curl -Lvk https://newapp.example-rtf.dev/ --resolve newapp.example-rtf.dev:443:192.168.64.14
Common Issues
If your application remains in the Starting status for several minutes, this may be due to specifying a lower amount of resources. It’s common for applications to take several minutes to start up when selecting 0.3 cores or lower.
If the application encounters an error during startup, the deployment will stop and the status updates to Failed. An error message preview is displayed when clicking on the application and viewing the right sidebar. To view the entire message, click on the Manage Application button. Viewing the application logs in Ops Center or using your third party logging provider will provide more details.
An error message indicating insufficient resources
is returned when Runtime Fabric doesn’t have the CPU cores or memory available for the deployment. When selecting multiple replicas, it’s important to know that the cores and memory specified applies to each replica.
If a re-deployment to an existing running application fails, the previous application remains running and active. This behavior enables zero-downtime application re-deployments. Runtime Manager will report the details and status of the failed deployment to help resolve the failure.