Deploying Nginx Ingress Controller

更新时间:
复制 MD 格式

In cloud-edge collaboration scenarios, services within an edge unit process traffic locally, which means traffic is routed within the edge node pool by default. This topic describes how to deploy the Nginx Ingress Controller on both cloud and edge node pools in an ACK Edge cluster to provide load balancing for services within the edge unit.

Important

The open source Ingress-NGINX project will no longer be maintained after March 2026. Consequently, Container Service for Kubernetes will also discontinue maintenance for the Nginx Ingress Controller component. Be aware of the associated risks. For more details, see [Product Announcement] End of Maintenance for the Nginx Ingress Controller Component.

Background

Alibaba Cloud ACK Edge adds non-intrusive enhancements for edge autonomy, edge units, edge traffic management, and native operational API support. It natively supports unified application lifecycle management and unified resource scheduling in edge computing scenarios. You can quickly add your edge nodes to a cluster.

Usage notes

Before deploying ack-ingress-nginx-v1 on a cloud or edge node pool, note the following:

  • The ACK Edge cluster must be version 1.19 or later.

  • You can deploy the component multiple times on the same ACK Edge cluster. Each deployment requires a unique release name. We recommend that you use a separate namespace for each deployment for easier management.

  • If you do not change the parameters during the initial deployment, ack-ingress-nginx-v1 deploys to the default node pool of the ACK Edge cluster.

Procedure

  1. Log on to the ACK console. In the left navigation pane, click Marketplace > Marketplace.

  2. On the Marketplace page, click the App Catalog tab, search for, and then select ack-ingress-nginx-v1.

  3. On the ack-ingress-nginx-v1 page, click Deploy in the upper-right corner.

  4. In the panel that appears, select a Cluster and a Namespace, and specify a Release Name.

    Note

    When deploying ack-ingress-nginx-v1 to a node pool, we recommend naming the release in the ack-ingress-nginx-v1-{node-pool-name} format. Example: ack-ingress-nginx-v1-edge-hangzhou.

  5. Click Next to open the Parameters page and configure the parameters.

    In the ACK console, go to the details page of your cluster. In the navigation pane on the left, choose Nodes > Node Pools. Find the IDs of the target cloud and edge node pools. You need these IDs to configure the nodeSelector parameter.

    • To deploy to a cloud node pool, configure the following parameters:

      • In the nodeSelector parameter, add the label of the cloud node pool: alibabacloud.com/nodepool-id: {node-pool-ID}.

        Note

        The nodeSelector field only requires the alibabacloud.com/nodepool-id: {node-pool-ID} label.

        ##
        nodeSelector:
          kubernetes.io/os: linux
          alibabacloud.com/nodepool-id: np-xxxx
      • In the ingressClassResource parameter, set name and controllerValue.

        Note

        If you deploy ack-ingress-nginx-v1 multiple times in the same ACK Edge cluster, ensure that the name and controllerValue are unique for each deployment. We recommend the following naming convention:

        • name: ack-nginx-{node-pool-name}. Example: ack-nginx-edge-hangzhou.

        • controllerValue: "k8s.io/ack-ingress-nginx-{node-pool-name}". Example: "k8s.io/ack-ingress-nginx-edge-hangzhou".

        ingressClassResource:
            # The name and controllerValue parameters are used instead of ingressClass.
            # The name can also be used in the kubernetes.io/ingress.class annotation.
            # To prevent overriding the default ingress class in the add-on, the default value of controllerValue is 'k8s.io/ack-ingress-nginx',
            # and the default name is 'ack-nginx'.
            # Please modify both the name and controllerValue parameters to have unique values.
            name: ack-nginx-edge-hangzhou
            controllerValue: "k8s.io/ack-ingress-nginx-edge-hangzhou"
    • To deploy to an edge node pool, configure the following parameters:

      • In the nodeSelector parameter, add the label of the edge node pool: alibabacloud.com/nodepool-id: {node-pool-ID}.

        Note

        The nodeSelector field only requires the alibabacloud.com/nodepool-id: {node-pool-ID} label.

      • Set global.edgeNodePool to true. The ack-ingress-nginx-v1 component automatically does the following:

        • Automatically changes the Service type of the Nginx Ingress Controller on edge nodes from LoadBalancer to NodePort. If you need to expose edge services to the internet, you must separately configure a load balancer with a public IP address.

        • Automatically switches the Nginx Ingress Controller image to a public image. This prevents edge nodes from failing to pull private images.

        global:
          clusterType: "Edge"
          # For an edge cluster, set this to true if the controller will be deployed in an edge node pool.
          edgeNodePool: true
      • In the ingressClassResource parameter, set name and controllerValue.

        Note

        If you deploy ack-ingress-nginx-v1 multiple times in the same ACK Edge cluster, ensure that the name and controllerValue are unique for each deployment. We recommend the following naming convention:

        • name: ack-nginx-{node-pool-name}. Example: ack-nginx-edge-hangzhou.

        • controllerValue: "k8s.io/ack-ingress-nginx-{node-pool-name}". Example: "k8s.io/ack-ingress-nginx-edge-hangzhou".

  6. Click OK to complete the installation.

  7. In the navigation pane on the left of the cluster details page, choose Applications > Helm.

    On the Helm page, the Nginx Ingress Controller service is now deployed.