Updated on 2025-07-30 GMT+08:00

HTTP Route

Creating an HTTP Route on the Console

  1. Log in to the UCS console. In the navigation pane, choose Service Meshes.
  2. Click the name of the target service mesh to go to its details page.
  3. In the navigation pane, choose Service Gateways > Gateway Routes.
  4. In the upper right corner, click Create Route.

  5. Configure parameters and click OK in the lower right corner.

    • Protocol: HTTP
    • Route Name: Enter a name, for example, test.
    • Namespace: Select the namespace where the route will be created.
    • Service Gateway: Select the namespace and name of the gateway that the route will be associated with.
    • Service Domain Name: This parameter is optional.
    • URL: Select Prefix match or Exact match and enter a URL.
    • Destination Service: Select the destination service and port. The destination service is automatically filtered based on the selected namespace and protocol.

Creating an HTTP Route Using YAML

  1. Log in to the UCS console. In the navigation pane, choose Service Meshes.
  2. Click the name of the target service mesh to go to its details page.
  3. In the navigation pane, choose Service Gateways > Gateway Routes.
  4. In the upper right corner, click Create from YAML.

  5. Configure parameters and click OK in the lower right corner.

    The following describes the parameters in the YAML file. (Configure the parameters based on site requirements.)
    apiVersion: gateway.networking.k8s.io/v1beta1
    kind: HTTPRoute
    metadata:
      name: httproute1
      namespace: whtest 
    spec:
      parentRefs:
      - name: gateway     # Mandatory. It indicates the name of the gateway that the route will be associated with.
        namespace: whtest # Optional. It indicates the namespace of the gateway that the route will be associated with. If this parameter is not specified, the namespace where the route is located is used by default.
      hostnames: ["nginx.example.com"] # Optional.
      rules:
      - matches:
        - path:
            type: PathPrefix
            value: /
        - path:
            type: Exact
            value: /headers
        backendRefs:
        - name: nginx
          port: 1111