All Products
Search
Document Center

API Gateway:Access K8s services registered in an SAE application by using an HTTP API

Last Updated:Aug 27, 2025

If you want to access a service in a Serverless App Engine (SAE) application from an external system or client, you can use an HTTP API and a route in the Cloud-native API Gateway console for the access. This improves service accessibility and system integration. This topic describes how to configure an HTTP API to access services in SAE applications.

Prerequisites

  1. A Cloud-native API Gateway instance is created. For more information, see Create a gateway instance.

  2. An SAE application is created in the same virtual private cloud (VPC) as the gateway instance. For more information, see Deploy a microservices application by using a JAR package in the SAE console.

  3. Access based on Kubernetes (K8s) service names is configured for the SAE application. For more information, see Configure application access based on Kubernetes Service names.

Process overview

  1. Create an HTTP API: In this step, you configure the basic information of the API.

  2. Create a route:

    1. Configure routing rules: In this sub-step, you configure how the API maps with the K8s service in the SAE application. This ensures that requests can be accurately routed to the destination service.

    2. Associate an environment: In this sub-step, you associate an environment, such as the production, testing, or development environment, with the API to ensure that the route configurations can be applied as expected in actual deployments.

    3. Associate the service: In this sub-step, you associate service instances with the routing rules to implement dynamic service discovery and scheduling. System flexibility and scalability improve on this basis.

  3. Debug the route: In this step, you verify whether Cloud-native API Gateway is integrated as expected with the K8s service by simulating requests and analyzing responses. This ensures the efficiency and stability of service invocation.

Procedure

Step 1: Create an HTTP API

  1. Log on to the API Gateway console.

  2. In the left-side navigation pane, click Cloud-native API Gateway > API. In the top navigation bar, select a region.

  3. On the API page, click Create API in the upper-left corner.

  4. In the dialog box that appears, click Create in the HTTP API section. In the Create HTTP API panel, configure the API Name and Description parameters as prompted.

Step 2: Create a route

Click the name of the API that you want to manage. On the API details page, click Create Route. In the Create Route panel, configure the parameters.

1. Configure basic route information

image

The following items describe the parameters:

  • Route Name: the name of the route. The name cannot be modified after the route is created.

  • Domain Name: You can click Add Domain Name on the right to create a domain name in the Add Domain Name panel.

  • Path: Select Prefix from the drop-down list and enter a forward slash (/) in the field to match HTTP requests that start with a /.

2. Associate an environment, gateway, or VPC

  1. When you create a gateway instance, the system automatically creates a default environment and associates the environment with the instance. You can also use the default environment to associate with the route in this sub-step.

  2. (Optional) If you do not want to use the default environment, click Create Environment next to the drop-down list to create a custom environment. Configure the Environment Name, Instance, and Description parameters.

    image

  3. Scenarios: Select Single Service from the drop-down list.

3. Create a service

  1. In the Backend Services parameter, click the drop-down list below Service Name and click Create Service.

    image

  2. Select SAE Kubernetes from the Source Type drop-down list.

    image

    The following items describe the parameters for creating a service:

    1. Namespace: Select an existing namespace in SAE from the drop-down list.

    2. Services: Select the K8s service registered in the SAE application from the list..

  3. Save and publish the route.

Step 3: Debug the route

  1. After the route is published, find the route in the route list and click Debug in the Actions column.

  2. In the debugging panel, configure the input parameter and click Send. The response of the API is displayed on the right.

    image

References

  • For information about how to open your application in a container service for public access, see Access applications in ACK by using an HTTP API.

  • For more information about the frequently asked questions (FAQ) about using Cloud-native API Gateway. see FAQ.