L7 routing supports capabilities such as URI path matching and request header matching. Complete the following preparations before you implement L7 routing capabilities.
Prerequisites
-
A Service Mesh (ASM) Enterprise Edition instance is created, with Enable Ambient Mesh selected. For more information, see Create an ASM instance.
-
A Kubernetes cluster is created and meets the Kubernetes cluster and configuration requirements. For more information about how to create a cluster, see Create an ACK dedicated cluster (discontinued) or Create an ACK managed cluster.
-
The cluster is added to the ASM instance.
-
The
istioctlservice mesh debugging tool is downloaded for your operating system and platform. For more information, see Istio.
Step 1: Set the data plane mode to Ambient
Set the data plane mode of the default global namespace to Ambient.
-
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 .
-
On the Global Namespace page, in the Dataplane Mode column, click Switch to Ambient Mesh Mode for the
defaultnamespace. In the Confirm dialog box, click OK.
Step 2: Enable waypoint for the default namespace
In Ambient mode, L7 capabilities depend on waypoint. This step enables waypoint for all services in the default namespace.
-
Create a Gateway resource. ASM creates a waypoint proxy based on this resource.
kubectl apply -f - <<EOF apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: waypoint spec: gatewayClassName: istio-waypoint listeners: - name: mesh port: 15008 protocol: HBONE EOF -
Enable waypoint for all services in the
defaultnamespace.kubectl label namespace default istio.io/use-waypoint=waypoint --overwrite
Step 3: Deploy services in the data plane cluster
Deploy the helloworld, sleep, httpbin, NGINX, or mocka service based on your scenario. Each of the following sections provides the manifest content for one service and the command that deploys it.
Deploy the helloworld service
Create a file named helloworld-application.yaml with the following content:
Deploy the helloworld application:
kubectl apply -f helloworld-application.yaml
Deploy the sleep service
Create a file named sleep-application.yaml with the following content:
Deploy the sleep application:
kubectl apply -f sleep-application.yaml
Deploy the httpbin service
Create a file named httpbin-application.yaml with the following content:
Deploy the httpbin application:
kubectl apply -f httpbin-application.yaml
Deploy the NGINX service
Create a file named nginx.yaml with the following content:
Deploy the NGINX application:
kubectl apply -f nginx.yaml
Deploy the mocka service
Create a file named mocka-application.yaml with the following content:
Deploy the mocka application:
kubectl apply -f mocka-application.yaml