Welcome to the Anypoint Service Mesh GCP tutorial. In this tutorial, we will walk you through the process of installing Anypoint Service Mesh on Google Cloud Platform. You will deploy a demo application and secure using Anypoint Service Mesh. To log issues, click here to go to the Github repository issue submission form. In order to successfully install Anypoint Service Mesh on GCP, you will need to create an Google Cloud Platform account and also have an Anypoint Platform Account. Click the button below to sign up for an Anypoint Platform account or log into your existing account.
Already have an account? Sign in.
From any browser, go to the URL to access Google Cloud Console: https://console.cloud.google.com/ then click on the upper left navigation bar and select VPC networks.
Click Create a VPC network, then enter the name for the network and select Automatic for Subnet creation. Then click Create and wait for the network to be created.
Click on the upper left navigation bar. Select Clusters.
Click Create Cluster and enter a name for your cluster.
Select Master Version of 1.16.x or higher.
Click Networking and select your network created in previous step.
Click CREATE and wait of cluster to be created.
From the Kubernetes Cluster page click Connect. From the Connect to the cluster popup copy the Command-line access command.
Open Terminal window. If you don’t already have the gcloud cli installed following the Google Docs to first install gcloud cli. Paste gcloud connect to cluster command from the previous step. Next run the following command to verify that you cluster is running.
To install Istio we will be using the Istio CLI. For completed instructions Istio Docs. Use the following command to download Istio CLI into your directory of choice. In this example I am using directory /Users/dennis.foley/ASM
Change into the newly downloaded directory:
Then add the current directly to path:
To install Istio we will be using the Istio CLI. From the istio directory run the following command. At the prompt Proceed? (Y/N) enter Y
Verify that Istio has been installed. You should now see the istio-system namespace
For our demo application we will be using Mythical Retail shopping cart application. This web-based UI will call several services to complete the order. Clone the demo application git repository onto your local machine.
Change to the ServiceMeshDemo directory and list out the contents to verify that the repository has been created correctly
We will now deploy the demo application to your kubernetes cluster. The deployment script takes the namespace as a parameter. We will be using mythical-payment for namespace.
You can monitory the deployment with the following commands:
Once all services are running you can test out the application. To access the application open you browser and go to the following URL
To test out the application follow these steps:
For complete instructions and documentation please visit MuleSoft Docs
Now we are ready to install Anypoint Service Mesh. To do this we will call asmctl install. This command requires 3 parameters: Client Id, Client Secret, Service Mesh license.
If you are not familiar with how to get environment Client Id and Secret, navigate to API Manager and click on the Environment Information button.
Then run the following command to install asmctl:
Next, verify that Anypoint Service Mesh has been installed correctly with the following command:
Next, we want to deploy the Anypoint Service Mesh adapter in each namespace that we want to monitor API’s. For this example, we will just be doing the nto-payment namespace that contains the demo application. To deploy the ASM Adapter we will be using a Kubernetes custom resource definition (CRD). In the ServiceMeshDemo repository, we have created the file nto-payment-asm-adapter.yaml that can modified.
Replace CLIENT ID and CLIENT SECRET with values for your environment. Save the file and run the following command
Use the following command to monitor the progress. Wait for status to change to Ready:
We will now use now use Anypoint Service Mesh auto discovery to create API’s in Anypoint Platform. We will create API’s for Customer, Inventory, Order and Payments services that are used by the demo application. Before creating the APIs, ensure the Anypoint Platform user has API Manager Environment Administrator permission, in addition to Manage APIs Configuration. This can be done by your organization admin in *Access Management.
Modify the Kubernetes custom resource definition (CRD) file demo-apis.yaml. For each API, replace ENV ID, USER and PASSWORD with the values for your environment. If you are unsure how to get the environment ID check out this article. Save the file and run the following command (NOTE: If you run this multiple times you might need to change the version number since Anypoint Platform will keep it around for 7 days).
Use the following command to monitor the progress. Wait for status to change to Ready:
You can also verify that the API’s have been created in Anypoint Platform by navigating to API Manager.
The last step is to bind the Kubernetes Services with the Anypoint Platform API’s. To do this you will use the binding definition file demo-bind-apis.yaml. Execute the following command
Use the following command to monitor the progress. Wait for status to change to Ready
Congratulations, you have completed installing Anypoint Service Mesh on GCP. To read further, please visit the GitHub repo for instructions on setting up rate limiting and other policies.
Start your 30-day free trial of the #1 platform for integration, APIs, and automation. No credit card required. No software to install.
Questions? Ask an expert.