< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Create Ingresses

This section describes how to create an Ingress.

Prerequisites

  • You should join a cluster or a project and have the Application Workload Management permission within the cluster or the project. For more information, refer to "Cluster Roles" and "Project Roles".

  • To create an Ingress that supports the HTTPS protocol, you need to create a Secret of type TLS Information, which must contain Base64-encoded certificates and private keys.

  • There must be at least one service in the project to which the Ingress belongs.

Steps

  1. Log in to the KubeSphere web console with a user who has the Application Workload Management permission and enter your cluster or project.

  2. Click Application Workloads > Ingresses in the left navigation pane.

  3. Click Create on the page.

  4. On the Basic Information tab, set the basic information for the Ingress, then click Next.

    ParameterDescription

    Name

    The name of the Ingress. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and can be up to 253 characters long.

    Alias

    The alias of the Ingress. Different Ingresses can have the same alias. The alias can only contain Chinese characters, letters, numbers, and hyphens (-), cannot start or end with a hyphen (-), and can be up to 63 characters long.

    Description

    The description of the Ingress. The description can contain any characters and can be up to 256 characters long.

  5. On the Routing Rules tab, click Add Routing Rule, set the routing rule parameters, then click Next.

    • Click Add Routing Rule to set routing rules. You can set multiple routing rules, each corresponding to a domain name.

    • Hover the cursor over a created routing rule, then click pen on the right side to edit the routing rule settings.

    • Hover the cursor over a created routing rule, then click trash-light on the right side to delete the routing rule.

    ParameterDescription

    Domain

    The user-defined domain name.

    Protocol

    The protocol supported by the Ingress. The value can be HTTP or HTTPS.

    Secret

    The Secret used to provide the certificate and key when the Ingress protocol is HTTPS. This Secret must contain the tls.cert and tls.key fields, which store the Base64-encoded certificate and private key, respectively.

    Path

    The domain path and its mapping relationship with the service port.

    • Click Add to set multiple paths.

    • Click trash-light on the right side of a created path to delete the path.

  6. On the Advanced Settings tab, set labels and annotations for the Ingress, then click Create.

    • Click Add to set multiple labels or annotations.

    • Click trash-light on the right side of a created label or annotation to delete it.

    Note

    The cluster gateway and project gateway in KubeSphere are implemented based on Nginx Ingress Controller. You can set annotations on the Ingress to control the behavior of the gateway. For more information, see Nginx Ingress Controller Documentation.

    Note

    After installing the "KubeSphere Gateway" extension and enabling the cluster gateway, workspace gateway, or project gateway, you need to select the corresponding IngressClassName in the Advanced Settings tab when creating an Ingress.

    After the Ingress is created, it will be displayed in the Ingress list.

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.

What’s on this Page