Project Gateway

    In addition to project gateways, KubeSphere also supports cluster-scope gateway to let all projects share a global gateway.

    This tutorial demonstrates how to enable a project gateway on KubeSphere for external access to Services and Routes.

    You need to create a workspace, a project and a user (). The user must be invited to the project with the role of admin at the project level. For more information, see .

    1. Click Enable Gateway. In the pop-up window, you can select two access modes for the gateway.

      NodePort: You can access Services with corresponding node ports through the gateway.

    2. You can also enable Tracing on the Enable Gateway page. You have to turn on Application Governance when you create composed applications so that you can use the Tracing feature and use different grayscale release strategies. Once it is enabled, check whether an annotation (for example, ) is added for your route (Ingress) if the route is inaccessible.

    3. In Configuration Options, add key-value pairs to provide configurations for system components of NGINX Ingress controller. For more information, see .

    4. After you select an access method, click OK.

    If you select NodePort, KubeSphere will set a port for http and https requests respectively. You can access your Service at EIP:NodePort or Hostname:NodePort.

    For example, to access your Service with an elastic IP address (EIP), visit:

    • https://EIP:32471

    When you create a Route (Ingress), you can customize a host name to access your Service. For example, to access your Service with the host name set in your Route, visit:

    • http://demo.kubesphere.io:32734
    • You may need to open ports in your security groups and configure relevant port forwarding rules depending on your environment.

    • NodePort is not recommended for a production environment. You can use LoadBalancer instead.

    You must configure a load balancer in advance before you select LoadBalancer. The IP address of the load balancer will be bound to the gateway to provide access to internal Services and Routes.

    Note

    Cloud providers often support load balancer plugins. If you install KubeSphere on major Kubernetes engines on their platforms, you may notice a load balancer is already available in the environment for you to use. If you install KubeSphere in a bare metal environment, you can use for load balancing.