Welcome to the Anypoint Service Mesh Azure Red Hat OpenShift tutorial. In this tutorial, we will walk you through the process of installing Anypoint Service Mesh on Azure Red Hat OpenShift. 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 Azure Red Hat OpenShift, you will need to create an Enterprise Azure 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 Azure Portal. Open Terminal window. If you don’t already have the Azure CLI installed following the Install Azure CLI to first install Azure CLI. Then run the command:
Run the following command:
Run the following command:
Run the following command:
Run the following command:
Run the following command:
Run the following command:
Log in to the web admin console.
At the top right corner, click on the question-mark circle, CommandLine Tools, and download the appropriate oc - OpenShift Command Line Interce (CLI). The oc tool is just the OpenShift version of kubectl, with additional CLI options specifically for OpenShift.
Connect via the CLI:
Verify the current Kubenetes context has been configured to point to the ARO cluster.
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 and supported by Anypoint Service Mesh (1.7.x or 1.8.x at this time).
Change into newly downloaded directory (the Istio version downloaded and to be installed):
Add current directory directly to path:
To install Istio we will be using the Istio CLI. By default, OpenShift doesn’t allow containers running with user ID 0. You must enable containers running with UID 0 for Istio’s service accounts by running the command below.
From the istio directory, install Istio using the OpenShift profile:
After the installation is complete, expose an OpenShift route for the ingress gateway
Verify that Istio has been installed. You should now see the istio-system namespace:
For our demo application we will be using Northern Trail Outfitters 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 nto-payment for namespace
The Istio sidecar injected into each application pod runs with user ID 1337, which is not allowed by default in OpenShift. To allow this user ID to be used, execute the following commands for the nto-payment namespace.
CNI on OpenShift is managed by Multus, and it requires a NetworkAttachmentDefinition to be present in the application namespace in order to invoke the istio-cni plugin.
You can monitor 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. First lets enable API Analytics by setting the disableMixerHttpReports flag to false:
Download the latest Anypoint Service Mesh CLI and make it executable:
Now we are ready to install Anypoint Service Mesh. To do this we will call asmctl install. This command requires 3 parameters:
If you are not familiar with how to get Client Id and Client Secret, navigate to API Manager and click on the Environment Information button.
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 APIs. 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 create the file nto-payment-asm-adapter.yaml that can be 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 the status to change to Ready.
After you provision the adapter, you must set the istio-injection=enabled label on the namespace by runnning the following command:
Redeploy all the existing applications in the namepsace. See Step 6.2 in MuleSoft Docs
Verify the Envoy sidecar is injected within each pod in the Kubernetes Cluster by running the following command:
We will 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 with the values for your environment. If you are not familiar with how to get Environment Id, navigate to API Manager and click on the Environment Information button. You’ll need to Configure Connected Apps to get the client credentials into your CRD file. This requires Org Adminstrator role.
For each API, replace clientId and clientSecret with the values from the connected app configured. Keep in mind that these are not the same as the ones from either the environment or business group in API Manager. NOTE: If you run this multiple times you might need to change the version number in demo-apis.yaml, 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. Go to Anypoint Platform and navigate 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
If you go to API Management in Anypoint Platform and refresh the page you will see that the API’s are now Active. You have completed the installation of Anypoint Service Mesh. If you would like to continue to learn about applying some policies against the Kubernetes services, visit this GitHub file.
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.