Configure Gateway
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.
TOC
Terminology
Prerequisites
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.
Example Gateway and Alb2 custom resource (CR)
- See Gateway Class introduction below.
alb2name is formatted as{gatewayName}-{random}.gatewayname.
Creating Gateway by using the web console
-
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.
-
Click Create.
Creating Gateway by using the CLI
Viewing Resources Created by the Platform
After the inbound gateway is created, the platform automatically creates many resources. Do not delete the resources below.
Updating Gateways
Updating the inbound gateway will cause a service interruption of 3-5 minutes. Please choose an appropriate time for this operation.
Updating Gateway by using the web console
-
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.
Add Listener
Monitor traffic under specified domain names and forward it to backend instances according to the bound routing rules.
Prerequisites
-
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.
Add Listener by using the web console
-
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.
-
Click Create.
Add Listener by using the CLI
Creating Route Rules
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.
Example HTTPRoute custom resource (CR)
- The available types are:
HTTPRoute,TCPRoute,UDPRoute. Gatewaylistener 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.
Creating Route by using the web console
-
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.
-
Click Create.