Skip to content

Create a route (Ingress)

In a Kubernetes cluster, Ingress exposes services from outside the cluster to inside the cluster HTTP and HTTPS routing. Traffic routing is controlled by rules defined on the Ingress resource. Here's an example of a simple Ingress that sends all traffic to the same Service:

ingress-diagram

Ingress is an API object that manages external access to services in the cluster, and the typical access method is HTTP. Ingress can provide load balancing, SSL termination, and name-based virtual hosting.

Prerequisites

Create routes

  1. After successfully logging in as the NS Edit user, click Cluster List in the upper left corner to enter the Cluster List page. In the list of clusters, click a cluster name.

  2. Click Services and Routing on the left, click the Routing tab, and click the Create Routing button in the upper right corner.

    Tip

    It is also possible to create a route via YAML.

  3. Open Create Route page to configure. There are two protocol types to choose from, please refer to the following two parameter tables for configuration.

Create a route with protocol HTTP

parameter description example value
Route name 【Type】Required
【Meaning】Enter the name of the new route.
【Note】Please enter a string of 4 to 63 characters, which can contain lowercase English letters, numbers and dashes (-), and start with a lowercase English letter, lowercase English letters or numbers.
Ing-01
Namespace 【Type】Required
【Meaning】Select the namespace where the new service is located. For more information about namespaces, please refer to Namespace Overview.
【Note】Please enter a string of 4 to 63 characters, which can contain lowercase English letters, numbers and dashes (-), and start with a lowercase English letter and end with a lowercase English letter or number.
default
Protocol [Type] Required
[Meaning] Refers to the protocol that authorizes inbound access to the cluster service, and supports HTTP (no identity authentication required) or HTTPS (identity authentication needs to be configured) protocol. Here select the route of HTTP protocol.
HTTP
Domain Name [Type] Required
[Meaning] Use the domain name to provide external access services. The default is the domain name of the cluster
Label [Type] Optional
[Meaning] Add a label for the route
Annotation 【Type】Optional
【Meaning】Add annotation for routing

Create a route with protocol HTTPS

parameter description example value
Route name 【Type】Required
【Meaning】Enter the name of the new route.
【Note】Please enter a string of 4 to 63 characters, which can contain lowercase English letters, numbers and dashes (-), and start with a lowercase English letter, lowercase English letters or numbers.
Ing-01
Namespace 【Type】Required
【Meaning】Select the namespace where the new service is located. For more information about namespaces, please refer to Namespace Overview.
【Note】Please enter a string of 4 to 63 characters, which can contain lowercase English letters, numbers and dashes (-), and start with a lowercase English letter and end with a lowercase English letter or number.
default
Protocol [Type] Required
[Meaning] Refers to the protocol that authorizes inbound access to the cluster service, and supports HTTP (no identity authentication required) or HTTPS (identity authentication needs to be configured) protocol. Here select the route of HTTPS protocol.
HTTPS
Domain Name [Type] Required
[Meaning] Use the domain name to provide external access services. The default is the domain name of the cluster
CA certificate 【Type】Required
【Meaning】Certificate for identity authentication between the server and the client, and you can also upload it locally.
Forwarding strategy 【Type】Optional
【Meaning】Specify the access strategy of Ingress.
Path: Specify the URL path for service access, the default is the root path/
Target Service: The service name for routing
Target Service Port: The port exposed by the service
Label [Type] Optional
[Meaning] Add a label for the route
Annotation 【Type】Optional
【Meaning】Add annotation for routing

Complete route creation

After configuring all the parameters, click the OK button to return to the routing list automatically. On the right side of the list, click to modify or delete the selected route.

Comments