In Enterprise Distributed Application Service (EDAS), an ingress is a collection of routing rules that are used to route external HTTP or HTTPS traffic to internal services. You can configure different Kubernetes ingresses for an 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 configure 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 rule 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 controller work together in a Kubernetes cluster:
  • 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 or HTTPS traffic to internal services.
  • An ingress controller is a reverse proxy that parses the routing rules of ingresses and routes HTTP or HTTPS traffic to the corresponding service based on the rules.
Relationships between the services, ingresses, and ingress controller

Procedure

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

    In this example, default is selected.

    Application route name The name of the ingress. The name must be unique in the selected namespace.

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

    Forwarding rules
    Note
    Take note of the following items when you create ingresses:
    • You can create multiple routing rules for an 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 The domain name to be accessed.
    OPen The TLS If you select OPen The TLS, external HTTPS requests are allowed to be routed to internal services.

    To allow external HTTPS requests, you must also specify the Transport Layer Security (TLS) certificate. In the Secret drop-down list, select the secret that stores the information about the TLS certificate. If you have not created such a secret, click New Key to create one. For more information about how to create a secret, see Create a secret.

    Path The path to be accessed. The path must start with a forward slash (/).
    Application The application to be accessed in the selected Kubernetes cluster. Select the required application from the drop-down list.
    Service name The service of the application to be accessed. Select the required service from the drop-down list.
    Service port The port of the service.
    After the ingress is created, the ingress appears in the ingress list. You can manage the ingress as needed. For example, you can view the details of the ingress, modify the routing rules, delete the ingress, and view the monitoring details of the ingress.

Verify the results

In the address bar of a browser, enter the domain name and the path that are specified in the routing rule. Use the Domain name/Path format. Check whether you can access the specified service.