Starting February 28, 2023, Container Service for Kubernetes (ACK) Serverless retires SLB Ingress: you can no longer install or manage the SLB Ingress Controller add-on through the cluster, and SLB Ingress is no longer supported. Migrate SLB Ingress to ALB Ingress promptly. This topic walks you through creating ALB Ingress, shifting DNS traffic, and deleting the SLB Ingress.
Background
SLB has limited Layer 7 capabilities—it does not support features such as HTTP header rewriting, redirection, URL rewriting, or rate limiting, and requires manual instance specification management. ALB Ingress is a Layer 7 gateway with stronger Ingress traffic management.
ALB Ingress uses Alibaba Cloud Application Load Balancer (ALB). It supports header- and cookie-based routing, automatic certificate discovery, HTTP, HTTPS, and QUIC, and better handles Layer 7 traffic for cloud-native applications. See Introduction to the SLB product family for an ALB and SLB feature comparison.
Migration process
Migration example
This example uses an Ingress resource whose endpoint resolves to demo.ingress.vip.
Enter demo.ingress.vip in your browser's address bar to see Welcome to nginx!.
Step 1: Create an ALB Ingress
-
Install the ALB Ingress Controller add-on per Manage the ALB Ingress controller.
-
Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
-
Create an AlbConfig:
-
Create albconfig.yaml with the following content:
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: HTTPzoneMappings: vSwitch IDs for the ALB Ingress. Specify at least two vSwitches in different zones in the same VPC as your cluster.
-
Create the AlbConfig:
kubectl apply -f albconfig.yaml -
Verify that 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 ingressclass.yaml with the following content:
apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: name: alb spec: controller: ingress.k8s.alibabacloud/alb parameters: apiGroup: alibabacloud.com kind: AlbConfig name: alb-demoparameters.name: The
AlbConfigname to bind. -
Create the IngressClass:
kubectl apply -f ingressclass.yaml
-
-
Create an ALB Ingress:
-
Create albingress.yaml with the following content:
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: Ingress name. Must differ from the SLB Ingress name.
-
ingressClassName: IngressClass name.
-
-
Create the ALB Ingress:
kubectl apply -f albingress.yaml -
Get the ALB Ingress endpoint:
kubectl get ingExpected 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 46sNote the ALB Ingress endpoint from the output, such as
alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com. -
Access the Nginx application through the ALB Ingress:
curl -H "Host: demo.ingress.vip" http://alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.comExpected 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: Shift traffic to ALB Ingress
Update the DNS record for demo.ingress.vip to point to the ALB endpoint instead of the SLB endpoint to route traffic through the ALB Ingress.
-
Log on to the Alibaba Cloud DNS console.
-
On the Configure domain name page, click the domain name on the All Zone Names tab.
-
On the Settings page, find the target DNS record and click Modify in the Actions column.
-
In the Modify Record dialog box, set Record Value to the ALB Ingress endpoint (for example,
alb-eeee6gtqbmrm1****.cn-shenzhen.alb.aliyuncs.com), and click OK. -
Enter demo.ingress.vip in your browser's address bar.
The browser displays Welcome to nginx!, confirming that Nginx is reachable through the ALB Ingress and that cutover from SLB Ingress to ALB Ingress succeeded.
Step 3: Delete the SLB Ingress
-
Delete the SLB Ingress:
In the left navigation pane of the cluster management page, choose .
-
On the Ingresses page, select the appropriate Namespace, find the SLB Ingress, and choose in the Actions column.
-
In the dialog box, click OK.
-
Uninstall the SLB Ingress Controller add-on:
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Add-ons.
-
On the Add-ons page, open the Others tab, find SLB Ingress controller, and click Uninstall.
-
In the dialog box, click OK.
FAQ
Can I perform a seamless migration from SLB Ingress to ALB Ingress?
No. In-place migration is not supported because ALB and SLB are different load balancer types.