An inbound gateway (Gateway) is an instance deployed from the Gateway Class. It creates listeners to capture external traffic on specified domain names and ports. Together with routing rules, it can route the specified external traffic to the corresponding backend instances.
Create an inbound gateway to enable more granular allocation of network resources.
Resource Name | Overview | Usage Instructions |
---|---|---|
Gateway Class | In the standard Gateway API documentation, the Gateway Class is defined as a template for creating gateways. Different templates can create inbound gateways for different business scenarios, facilitating rapid traffic management. | The platform includes dedicated Gateway Classes. |
Inbound Gateway | The inbound gateway corresponds to specific resource instances, and users can exclusively utilize all listening and computing resources of this inbound gateway. It is a configuration of routing rules effective for the listener. When external traffic is detected by the gateway, it will be distributed to backend instances according to the routing rules. | It can be viewed as a load balancer instance. |
Route Rule | Route rules define a series of guidelines for traffic distribution from the gateway to services. The currently standard supported types of routing rules in the Gateway API include HTTPRoute, TCPRoute, UDPRoute, etc. | The platform currently supports listening to HTTP, HTTPS, TCP, and UDP protocols. |
The platform administrator must ensure that the cluster supports LoadBalancer type internal routing. For public cloud clusters, the LoadBalancer Service Controller must be installed. In non-public cloud clusters, the platform provides the external address pool feature, which allows LoadBalancer type internal routing to automatically obtain an IP from the external address pool for external access after configuration is complete.
alb2
name is formatted as {gatewayName}-{random}
.gateway
name.Go to Container Platform.
In the left navigation bar, click Network > Inbound Gateway.
Click Create Inbound Gateway.
Refer to the following instructions to configure specific parameters.
Parameter | Description |
---|---|
Name | The name of the inbound gateway. |
Gateway Class | The gateway class defines the behavior of the gateway, similar to the concept of storage classes (StorageClasses); it is a cluster resource. Dedicated: The inbound gateway will correspond to a specific resource instance, and the user can utilize all listeners and computing resources of this gateway. |
Specification | You can choose the recommended usage scenario based on your needs or customize the resource limits. |
Access Address | The address of the inbound gateway, which is automatically obtained by default. |
Internal Routing Annotation | Used to declare the configuration or capabilities for LoadBalancer type internal routing. For specific annotation information, please refer to LoadBalancer type internal routing annotation instructions. |
Click Create.
After the inbound gateway is created, the platform automatically creates many resources. Do not delete the resources below.
Default Created Resources | Name |
---|---|
ALB2 Type Resource | name-lb-random |
Deployment | name-lb-random |
Internal Routing |
|
Configuration Dictionary |
|
Service Account | name-lb-random-serviceaccount |
Updating the inbound gateway will cause a service interruption of 3-5 minutes. Please choose an appropriate time for this operation.
Access the Container Platform.
In the left navigation bar, click Network > Inbound Gateway.
Click ⋮ > Update.
Update the inbound gateway configuration as needed.
Note: Please set the specifications reasonably based on business requirements.
Click Update.
Monitor traffic under specified domain names and forward it to backend instances according to the bound routing rules.
If you need to monitor HTTP protocol, please contact the administrator in advance to prepare the domain name.
If you need to monitor HTTPS protocol, please contact the administrator in advance to prepare the domain name and certificate.
In the left navigation bar, click Network > Inbound Gateway.
Click Inbound Gateway Name.
Click Add Listener.
Refer to the following instructions to configure specific parameters.
Parameter | Description |
---|---|
Listener Protocol and Port | Currently supports monitoring HTTP, HTTPS, TCP, and UDP protocols, and you can custom input the port to be monitored, for example: 80 . Note:
|
Domain Name | Select an available domain name in the current namespace, used to monitor network traffic accessing this domain name. Hint: TCP and UDP protocols do not support selecting domain names. |
Click Create.
Route rules provide routing policies for incoming traffic, similar to inbound rules (Kubernetes Ingress). They expose network traffic monitored by the gateway to the internal routing of the cluster (Kubernetes Service), facilitating routing forwarding strategies. The key difference is that they target different service objects: inbound rules serve the Ingress Controller, while route rules serve the Ingress Gateway.
Once the listening is set up in the ingress gateway, the gateway will monitor traffic from specified domains and ports in real-time. The route rules can forward the incoming traffic to backend instances as desired.
HTTPRoute
, TCPRoute
, UDPRoute
.Gateway
listener name.If there is no matching rule for the Path object in the HTTPRoute type route rule, a matching rule with PathPrefix mode and a value of / will be automatically added.
Access the Container Platform.
In the left navigation bar, click Network > Route Rules.
Click Create Route Rule.
Follow the instructions below to configure some parameters.
Parameter | Description |
---|---|
Route Type | The currently supported route types are: HTTPRoute, TCPRoute, UDPRoute. Tip: HTTPRoute supports publishing to HTTP and HTTPS protocol listeners. |
Publish to Listener | In the left selection box, select the created Ingress Gateway, and in the right selection box, select the created Listener. The platform will publish the created route rules to the listener below, enabling the gateway to forward captured traffic to specified backend instances. Note: It is not allowed to publish route rules to a listener that is on port 11782 or has already mounted TCP or UDP routes. |
Match | You can add one or more matching rules to capture traffic that meets the requirements. For example, capture traffic with specified Path, capture traffic with specified method, etc. Note:
|
Action | You can add one or more actions to process the captured traffic.
Note:
|
Backend Instance | After the rule takes effect, it will forward to the backend instance according to the selected internal routes and ports in the current namespace. You can also set weights, with higher weight values resulting in a higher probability of being polled. Tip: The percentage next to the weight indicates the probability of forwarding to that instance, calculated as the ratio of the current weight value to the sum of all weight values. |
Click Create.