Updated on 2023-03-01 GMT+08:00



Kubernetes uses kube-proxy to expose Services and provide load balancing. The implementation is at the transport layer. When it comes to Internet applications, where a bucket-load of information is generated, forwarding needs to be more fine-grained, precisely and flexibly controlled by policies and load balancers to deliver higher performance.

This is where ingresses enter. Ingresses provide application-layer forwarding functions, such as virtual hosts, load balancing, SSL proxy, and HTTP routing, for Services that can be directly accessed outside a cluster.

Kubernetes has officially released the Nginx-based ingress controller. nginx-ingress is an add-on that uses ConfigMaps to store Nginx configurations. The Nginx ingress controller generates Nginx configurations for an ingress and writes the configurations to the pod of Nginx through Kubernetes API. These configurations can be modified and updated by reloading.

The nginx-ingress add-on in CCE is implemented using the open-source community chart and image. CCE does not maintain the add-on. Therefore, it is not recommended that the nginx-ingress add-on be used commercially.

You can visit the open source community for more information.

  • When installing the add-on, you can add configurations by defining the Nginx configuration. The configurations take effect globally. This parameter is generated by configuring the nginx.conf file and affects all managed ingresses. You can search for related parameters in the ConfigMap. If the configured parameters are not included in the options listed in the ConfigMap, the configurations do not take effect.
  • After the add-on is installed, you can interconnect with Nginx and add Kubernetes annotations to a specific ingress to customize its behavior when creating an ingress on the CCE console. For details about the Kubernetes annotations field, see Annotations.
  • Do not manually modify or delete the load balancer and listener that are automatically created by CCE. Otherwise, the workload will be abnormal. If you have modified or deleted them by mistake, you need to uninstall the nginx-ingress add-on and re-install it.

How nginx-ingress Works

nginx-ingress consists of the ingress object, ingress controller, and Nginx. The ingress controller assembles ingresses into the Nginx configuration file (nginx.conf) and reloads Nginx to make the changed configurations take effect. When it detects that the pod in a Service changes, it dynamically changes the upstream server group configuration of Nginx. In this case, the Nginx process does not need to be reloaded. Figure 1 shows how nginx-ingress works.

  • An ingress is a group of access rules that forward requests to specified Services based on domain names or URLs. Ingresses are stored in the object storage service etcd and are added, deleted, modified, and queried through APIs.
  • The ingress controller monitors the changes of resource objects such as ingresses, Services, endpoints, secrets (mainly TLS certificates and keys), nodes, and ConfigMaps in real time and automatically performs operations on Nginx.
  • Nginx implements load balancing and access control at the application layer.
Figure 1 Working principles of nginx-ingress


  • This add-on can be installed only in CCE clusters of v1.15 or later.
  • kubernetes.io/ingress.class: "nginx" must be added to annotations of the ingress created by calling the API. If an existing ingress is connected, add kubernetes.io/ingress.class: "cce" to annotations.
  • Dedicated load balancers must be the network type (TCP/UDP) supporting private networks (with a private IP).


Before creating a workload, you must have an available cluster. If no cluster is available, create one according to Buying a CCE Cluster.

Installing the Add-on

The new console supports dedicated load balancers.

  1. Log in to the CCE console.
  2. In the navigation pane on the left, choose Add-ons and click Install under nginx-ingress.
  3. Set configuration parameters.

    • Cluster: Select a cluster.
    • Specifications: Select or customize add-on specifications as required.
    • Load Balancer: Select a shared or dedicated load balancer. If no load balancer is available, create one first. The load balancer has at least two listeners, and ports 80 and 443 are not occupied by listeners.
    • Nginx Settings: Configuring the nginx.conf file will affect all managed ingresses. You can search for related parameters through ConfigMaps. If the parameters you configured are not included in the options listed in those ConfigMaps, the parameters will not take effect.
    • Default 404 Service: By default, the 404 service provided by the add-on is used. To customize the 404 service, enter the namespace/service name. If the service does not exist, the add-on installation will fail.

  4. Click Install.

Change History

Table 1 CCE add-on versions

Add-on Version

Supported Cluster Version

Community Version (for Only Clusters of v1.17 and Later)