Overview
You can create a Cloud Native Gateway for your TKE, associate services from a registry or TKE, and then create routing policies for the services in the gateway, enabling them to be exposed through the gateway. This guide uses TKE as an example. You need to complete the following steps:
1. Create a Cloud Native Gateway.
2. Associate a service source.
3. Add a service.
4. Configure routing rules for the service.
5. Call the API. Currently, Cloud Native Gateway supports new purchases via allowlist only for microservices scenarios, where it acts as the access layer for Polaris services. Other scenarios do not support new access. When accessing the console for non-qualifying scenarios, you will be redirected to the Polaris console.
Experience Flow
If microservices are deployed to TKE, the Cloud Native Gateway can directly associate services from TKE.
Operation Steps
Step 1: Creating a Cloud Native Gateway
Step 2: Associating with the Service Source
1. Click the ID of the created Cloud Native Gateway to go to the Basic Information page.
2. In the left menu bar, choose Service & Route > Service Source. On the Service Source page, click New. For the service source type, select TKE. For the service instance, select an available instance that resides in the same VPC as the Cloud Native Gateway. Then, click OK.
Step 3: Adding a Service
1. Choose Service & Route > Service. In the service list, click New. For the service type, select K8S Service. For the service source, select the service source associated in the previous step. Then, enter the namespace name and service name for the TKE.
2. Click OK. After the creation is complete, you can view the service information in the service list.
Step 4: Configuring Routing Rules for the Service
1. After the backend service is added, click the service name to enter the Service & Route > Route page.
2. Click Create, configure the routing information, and then click Next. At least one of the request method, request path, or Host must be configured.
3. Configure the backend information for the route. After confirming that the backend service information is correct, click OK to complete the route creation. Route Priority Detection (Optional): When multiple routes exist under the same service, you can use route priority detection to confirm the matching order of requests and avoid route conflicts.
Step 5: Accessing the Route
1. Go to the Basic Information page of the Cloud Native Gateway and obtain the CLB IP address.
2. Use the CLB IP address and the configured route path to access the API. Execute a curl command for testing. You can then access the TKE through the Cloud Native Intelligent Gateway.
curl http://<GWLB IP>/<Route Path>