Service Mesh (ASM) supports two sidecarless modes: Ambient Mesh mode and Alibaba Centralized Mesh Gateway (ACMG) mode. This topic describes how to deploy sample applications in these two modes. This helps you prepare the environment in advance so that you can experience the features of the sidecarless modes as soon as possible.
Prerequisites
A Container Service for Kubernetes (ACK) cluster that meets the specified conditions is created. For more information, see the "Supported Kubernetes clusters and configurations" section in Limits.
An ASM instance is created and enabled with the Ambient Mesh mode or ACMG mode.
In the Dataplane Mode section of the Create Service Mesh page, select Enable Ambient Mesh mode or Enable ACMG Mode. Configure other settings based on your business requirements. For more information, see Create an ASM instance.
The ACK cluster is added to the ASM instance. For more information, see Add a cluster to an ASM instance.
An ingress gateway is created. For more information, see Create an ingress gateway.
Deploy sample applications
In this example, the Bookinfo application is deployed. For more information, see Deploy an application in an ACK cluster that is added to an ASM instance.
Deploy sample applications in the ACK cluster
Log on to the ASM console. In the left-side navigation pane, choose .
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
Enable the Ambient Mesh mode or ACMG mode.
Ambient Mesh mode
On the Global Namespace page, find the default namespace and click Switch to Ambient Mesh Mode in the Dataplane Mode column. In the Submit message, click OK.
ACMG mode
Use kubectl to connect to the ASM instance based on the information in the kubeconfig file and enable the ACMG mode.
kubectl label namespace default istio.io/dataplane-mode=acmg
Download the YAML file of the Bookinfo application from the Istio repository on GitHub. Then, run the following command to deploy the Bookinfo application in the default namespace:
kubectl apply -f bookinfo.yaml
Deploy a sleep application.
Create a sleep.yaml file that contains the following content:
Run the following command to deploy the sleep application in the default namespace:
kubectl apply -f sleep.yaml
Deploy a notsleep application.
Create a notsleep.yaml file that contains the following content:
Run the following command to deploy the notsleep application in the default namespace:
kubectl apply -f notsleep.yaml
Deploy mesh resources in the ASM instance
Create a bookinfo-gateway.yaml file that contains the following content.
The YAML file is used to create an Istio gateway and a virtual service.
Use kubectl to connect to the ASM instance based on the information in the kubeconfig file, and then run the following command to deploy mesh resources:
kubectl apply -f bookinfo-gateway.yaml
Verify basic features
Run the following commands to configure environment variables for the ingress gateway:
export GATEWAY_HOST=istio-ingressgateway.istio-system export GATEWAY_SERVICE_ACCOUNT=ns/istio-system/sa/istio-ingressgateway
Run the following commands to test whether the Bookinfo application works properly with or without an ingress gateway.
Run the following command:
kubectl exec deploy/sleep -- curl -s "http://$GATEWAY_HOST/productpage" | grep -o "<title>.*</title>"
Expected output:
<title>Simple Bookstore App</title>
Run the following command:
kubectl exec deploy/sleep -- curl -s http://productpage:9080/ | grep -o "<title>.*</title>"
Expected output:
<title>Simple Bookstore App</title>
Run the following command:
kubectl exec deploy/notsleep -- curl -s http://productpage:9080/ | grep -o "<title>.*</title>"
Expected output:
<title>Simple Bookstore App</title>
The preceding output indicates that the Bookinfo application can work properly with or without an ingress gateway.