You can deploy the NGINX Ingress controller by installing ack-ingress-nginx or ack-ingress-nginx-v1 from the Marketplace page in the Container Service for Kubernetes (ACK) console. This topic describes how to manually update ack-ingress-nginx to ack-ingress-nginx-v1 from the Marketplace page in the ACK console.
Prerequisites
An ACK cluster that runs Kubernetes 1.20 or later is created.
Chart version 4.0.17 and later (ack-ingress-nginx-v1 version 1.8.0-aliyun.1 and later) support only Kubernetes 1.22 or later. If the cluster runs Kubernetes 1.20, select chart version 4.0.16 (ack-ingress-nginx-v1 version 1.2.1-aliyun.1).
ack-ingress-nginx is installed in the cluster from the Marketplace page in the ACK console.
Background information
The Ingress API v1beta1 is deprecated in Kubernetes 1.24. As a result, earlier versions of the NGINX Ingress controller cannot run as expected in ACK clusters that run Kubernetes 1.24.
NGINX Ingress controller 0.44.0 uses the Ingress API v1beta1. If NGINX Ingress controller 0.44.0 is deployed in your cluster by installing ack-ingress-nginx, the NGINX Ingress controller cannot run as expected after you update the Kubernetes version of your cluster to 1.24.
To ensure the compatibility with template parameters, NGINX Ingress controller 1.1.0 and later are deployed by installing ack-ingress-nginx-v1. To update the NGINX Ingress controller to 1.1.0 or later, you must manually install ack-ingress-nginx-v1 and then uninstall ack-ingress-nginx.
This topic is not applicable to the NGINX Ingress controller that is deployed from the Add-ons page in the ACK console. For more information about how to update the NGINX Ingress controller, see Update the NGINX Ingress controller.
Step 1: Install ack-ingress-nginx-v1
Install ack-ingress-nginx-v1 from the Marketplace page in the ACK console
Install ack-ingress-nginx-v1 for each NGINX Ingress controller deployed by installing ack-ingress-nginx. For more information, see Deploy multiple Ingress controllers in a cluster.
Do not set the value of the controller.ingressClassResource.name parameter in ack-ingress-nginx-v1 to the value of the controller.ingressClass parameter in ack-ingress-nginx. Otherwise, the NGINX Ingress controller may not run as expected due to Ingress class conflicts.
(Optional) Modify the SLB specification and parameters
If you have modified the Server Load Balancer (SLB) specification or parameters in ack-ingress-nginx, you may want to migrate the modifications to ack-ingress-nginx-v1. To do this, configure the controller.service (for Internet-facing SLB instances) or controller.service.internal (for internal-facing SLB instances) annotation in ack-ingress-nginx-v1 to configure a LoadBalancer Service. For more information about how to use annotations to configure LoadBalancer Services, see Add annotations to the YAML file of a Service to configure CLB instances.
Step 2: Create a new Ingress and test whether ack-ingress-nginx-v1 can route traffic as expected
After you install ack-ingress-nginx-v1, create a new Ingress based on the configuration of the original Ingress. Modify the Ingress class that is specified in the Ingress. Example of the original Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: nginx-intranet # The Ingress class specified in the original Ingress is nginx-intranet.
spec:
rules:
- host: test-ingress.com
http:
paths:
- path: /foo
backend:
service:
name: web1-service
port:
number: 8080
pathType: ImplementationSpecific
- path: /bar
backend:
service:
name: web1-service
port:
number: 8080
pathType: ImplementationSpecific
Create a new Ingress.
If the Ingress class is specified by using an annotation, you need to modify the name of the Ingress class, but do not modify other annotations.
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-ingress-v1 # Create a new Ingress. namespace: default annotations: kubernetes.io/ingress.class: nginx-intranet-v1 # Change the name of the Ingress class to the Ingress class name used by nginx-intranet-v1. In this example, the Ingress class name is nginx-intranet-v1. spec: rules: - host: test-ingress.com http: paths: - path: /foo backend: service: name: web1-service port: number: 8080 pathType: ImplementationSpecific - path: /bar backend: service: name: web1-service port: number: 8080 pathType: ImplementationSpecific
If the Ingress class is specified by using the
spec.ingressClassName
parameter, repeat the preceding steps to create a new Ingress and change the value of thespec.ingressClassName
parameter in the new Ingress.
After you create the new Ingress, you can configure the hosts file to map the domain name to the IP address of the new Classic Load Balancer (CLB) instance. Then, test whether ack-ingress-nginx-v1 can route traffic as expected.
Step 3: Switch traffic to ack-ingress-nginx-v1
After you confirm that ack-ingress-nginx-v1 can route traffic as expected, modify DNS resolution settings to switch traffic to ack-ingress-nginx-v1.
Log on to the Alibaba Cloud DNS console or the console where you can configure resolution settings for the domain name that you use and map the domain name to the IP address of the new CLB instance. The modification to DNS resolution settings takes effect after a period of time. We recommend that you pay attention to your business during this period in case errors occur. You can view the container logs and metrics to monitor the progress of the switchover.
What to do next
After you confirm that the traffic is completely switched to ack-ingress-nginx-v1 and your business can be accessed as expected, uninstall ack-ingress-nginx. Log on to the ACK console. Select your cluster and go to the cluster details page. In the left-side navigation pane, choose . Find the Helm release that is named ack-ingress-nginx and click Delete in the Actions column.