Create an Ingress
This section describes how to create an Ingress.
Prerequisites
-
The Application Management for Cluster Federation extension must be installed and enabled on the KubeSphere platform.
-
You need to join a federated project and have the Federated Project Management permission in the corresponding workspace.
-
To create an Ingress that supports the HTTPS protocol, you need to create a TLS Information type Secret. The Secret must contain a Base64-encoded certificate and private key. For more information, please refer to Create a Secret.
-
There is at least one Service in the project to which the Ingress belongs. For more information, please refer to Create a Stateful or Stateless Service.
Steps
-
Log in to the KubeSphere web console as a user with Federated Project Management permissions and enter your federated project.
-
Click Application Workloads > Ingress in the left navigation pane.
-
Click Create on the page.
-
On the Basic Information tab, set the basic information for the Ingress, then click Next.
Parameter Description 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.
Description
The description of the Ingress. The description can contain any characters and can be up to 256 characters long.
-
On the Routing Rules tab, click Add Routing Rule, set the routing rule parameters, then click Next.
-
Click Add Routing Rule to set a routing rule. You can set multiple routing rules, each corresponding to a domain name.
-
Hover over a created routing rule, then click
on the right to edit the routing rule settings.
-
Hover over a created routing rule, then click
on the right to delete the routing rule.
Parameter Description Domain Name
User-defined domain name.
Protocol
Protocol supported by the Ingress. The parameter value can be HTTP or HTTPS.
Secret
When the Ingress protocol is HTTPS, the Secret used to provide the certificate and key. This Secret must contain the tls.cert and tls.key fields, storing the Base64-encoded certificate and private key respectively.
Path
Domain path and its mapping relationship with the service port.
-
Click Add to set multiple paths.
-
Click
on the right of a created path to delete the path.
-
-
On the Advanced Settings tab, set labels and annotations for the Ingress, then click Create.
-
Click Add to set multiple labels or annotations.
-
Click
on the right side of a created label or annotation to delete it.
Note KubeSphere’s cluster gateway and project gateway are implemented based on the Nginx Ingress Controller. You can set annotations on the Ingress to control the gateway’s behavior. For more information, please refer to the Nginx Ingress Controller official documentation.
After the Ingress is created, it will be displayed in the Ingress list.
-