In EDAS, an ingress is a collection of routing rules that are used to route external HTTP traffic to internal services. You can configure different Kubernetes ingresses for one application. This way, external requests can be routed to different Services in a cluster based on different routing rules. This topic describes how to configure an ingress for an application and routing rules in the EDAS console.

Prerequisites

Add a service

Background information

By default, an ingress controller is deployed when you create a Kubernetes cluster. The ingress controller is used to parse the routing rules of the ingresses in the cluster. After the ingress controller receives a request that matches a routing method of an ingress, the request is routed to the corresponding Service. Then, the Service forwards the request to pods and the pods process the request.

The following content describes how the Services, ingresses, and ingress controllers in a Kubernetes cluster work together:
  • A Service is an abstraction of an application that is deployed on a set of replicated pods.
  • An ingress is a collection of routing rules that are used to route external HTTP traffic to internal Services.
  • An ingress controller is a reverse proxy that parses the routing rules of ingresses and routes HTTP traffic to the corresponding Service based on the rules.
Relationships between Services, ingresses, and ingress controllers

Procedure

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Application Routing.
  3. In the top navigation bar of the Application Routing (Kubernetes Ingress) page, select a region. Then, select a namespace.
  4. On the Application Routing (Kubernetes Ingress) page, click Create application route.
  5. In the Create application route (k8s advance) panel, specify K8s Cluster, K8s namespace, and Application route name. Click Add forwarding rule, set relevant parameters, and then click Yes.
    Create an ingress for an application
    Parameter Description
    K8s Cluster Select a Kubernetes cluster from the drop-down list.
    K8s namespace The objects in the system are allocated to different namespaces to form logically isolated projects, groups, or user groups. This way, you can separately manage different object groups that share all resources of the cluster.
    • default: The default namespace. If no namespace is specified for an object, the default namespace is used.
    • kube-system: The namespace of the objects that are created by the system.
    • kube-public: The namespace that is automatically created by the system. This namespace can be read by all the users, including the users who are not authenticated.

    In this example, default is selected.

    Application route name Enter a custom name. The name must be unique in the selected namespace.

    The name can contain lowercase letters, digits, and hyphens (-) and must start with a letter and end with a letter or a digit.

    Forwarding rules
    Note
    Follow these rules when you create ingresses:
    • You can create multiple routing rules for one ingress.
      • The combination of a specific domain name and a specific path can be used as the address of only one Service.
      • A Service can correspond to multiple combinations of domain names and paths.
    • You can create the same routing rules for different ingresses.
    domain name Specify the domain name to be accessed.
    Path Specify the path to be accessed. The path must start with a forward slash (/).
    Application Select the application to be accessed in the selected Kubernetes cluster from the drop-down list.
    Service Select the Service of the application service to be accessed from the drop-down list.
    Port Specify the service port.
    After the ingress is created, the ingress appears in the ingress list. You can perform multiple operations. For example, you can view the details of the ingress, modify the routing rules, and delete the ingress.

Verify the result

In the address bar of a browser, enter the domain name and the path that are specified in the routing method. Use the domain name/path format. Check whether you can access the backend service that corresponds to the specified Service.