Server load Balancer (SLB) Ingresses were phased out on February 28, 2023. Therefore, Container Service for Kubernetes (ACK) Serverless no longer provides technical support for SLB Ingresses after February 28, 2023. After SLB Ingresses are phased out, you cannot install or manage the SLB Ingress controller in an ACK Serverless cluster. We recommend that you migrate from SLB Ingresses to ALB Ingresses at the earliest opportunity. This topic describes how to migrate from SLB Ingresses to ALB Ingresses.
Background information
SLB provides limited features at Layer 7. For example, SLB does not support HTTP rewrites, redirects, overwrites, and throttling. In addition, you must manually specify the specifications of SLB instances. Therefore, SLB Ingresses provide limited support for traffic routing. ALB Ingresses provide improved traffic routing capabilities at Layer 7 based on Application Load Balancer (ALB).
Compared with SLB Ingresses, ALB Ingresses can handle complex routing based on headers or cookies and support automatic certificate discovery. ALB Ingresses also support the HTTP, HTTPS, and Quick UDP Internet Connections (QUIC) protocols to meet the requirements of Layer 7 traffic distribution for cloud-native applications. For more information about the comparison between ALB and SLB, see What is SLB?
Migration procedure
Migration example
In this example, an SLB Ingress that maps its endpoint to the domain name demo.ingress.vip is used.
Enter demo.ingress.vip into the address bar of a browser and press Enter. Welcome to nginx! appears on the page .
Step 1: Create an ALB Ingress
Install the ALB Ingress controller. For more information, see Manage the ALB Ingress controller.
Obtain the kubeconfig file of the cluster and use kubectl to connect to the cluster.
Create an AlbConfig.
Create a file named albconfig.yaml and copy the following content to the file:
apiVersion: alibabacloud.com/v1 kind: AlbConfig metadata: name: alb-demo spec: config: name: alb-test addressType: Internet zoneMappings: - vSwitchId: vsw-wz9e2usil7e5an1xi**** - vSwitchId: vsw-wz92lvykqj1siwvif**** listeners: - port: 80 protocol: HTTP
zoneMappings: the IDs of the vSwitches used by the ALB Ingress. You must specify at least two vSwitches that belong to different zones. The vSwitches that you specify must belong to the same virtual private cloud (VPC) as your cluster.
Run the following command to create the AlbConfig:
kubectl apply -f albconfig.yaml
Run the following command to check whether the ALB instance is created:
kubectl get albconfig <AlbConfig name>
Expected output:
NAME ALBID DNSNAME PORT&PROTOCOL CERTID AGE alb-demo alb-eeee6gtqbmrm19**** alb-eeee6gtqbmrm19****.cn-shenzhen.alb.aliyuncs.com 27s
Create an IngressClass.
Create a file named ingressclass.yaml and copy the following content to the file:
apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: name: alb spec: controller: ingress.k8s.alibabacloud/alb parameters: apiGroup: alibabacloud.com kind: AlbConfig name: alb-demo
parameters.name: the name of the AlbConfig that you want to use.
Run the following command to create the IngressClass:
kubectl apply -f ingressclass.yaml
Create an ALB Ingress.
Create a file named albingress.yaml and copy the following content to the file:
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: demo-ingress-alb namespace: default spec: ingressClassName: alb rules: - host: demo.ingress.vip http: paths: - backend: service: name: nginx port: number: 80 path: / pathType: Prefix
name: the name of the Ingress that you want to use. The name cannot be the same as the name of the SLB Ingress.
ingressClassName: the name of the IngressClass that you want to use.
Run the following command to create the ALB Ingress:
kubectl apply -f albingress.yaml
Run the following command to query the endpoint of the ALB Ingress:
kubectl get ing
Expected output:
NAME CLASS HOSTS ADDRESS PORTS AGE demo-ingress slb demo.ingress.vip 120.79.**.** 80 35m demo-ingress-alb alb demo.ingress.vip alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com 80 10m 46s
The endpoint of the ALB Ingress is alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com.
Run the following command to access the NGINX application by using the ALB Ingress:
curl -H "Host: demo.ingress.vip" http://alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com
Expected output:
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> .............
Step 2: Use the ALB Ingress to forward traffic
Modify the DNS record for demo.ingress.vip by replacing the endpoint of the SLB Ingress with the endpoint of the ALB Ingress. This way, the ALB Ingress is used to forward traffic.
Log on to the Alibaba Could DNS console.
On the Domain Name Resolution page, click the domain name of the ALB Ingress in the Authoritative Domain Names column.
On the DNS Settings page, click Modify in the Actions column.
In the Modify DNS Record panel, set Record Value to the endpoint of the ALB Ingress, which is alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com in this example. Then, click OK.
Enter demo.ingress.vip into the address bar of a browser and press Enter.
Welcome to nginx! appears on the page. This indicates that you can access the NGINX application by using the ALB Ingress.
Step 3: Delete the SLB Ingress
Delete the SLB Ingress.
In the left-side navigation pane of the details page, choose .
In the upper part of the Ingresses page, select the namespace to which the SLB Ingress belongs. Find the SLB Ingress and choose in the Actions column.
In the message that appears, click OK.
Uninstall the SLB Ingress controller
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose .
On the Add-ons page, click the Others tab. Find SLB Ingress Controller and click Uninstall.
In the message that appears, click OK.
FAQ
Is smooth migration from SLB Ingresses to ALB Ingresses supported?
Smooth migration from SLB Ingresses to ALB Ingresses is not supported, because SLB Ingresses are different from ALB Ingresses.