×
Community Blog Migrate from Nginx Ingress to Alibaba Cloud Cloud Native Solution

Migrate from Nginx Ingress to Alibaba Cloud Cloud Native Solution

This article introduces how to migrate from self-managed Nginx Ingress to Alibaba Cloud cloud-native solutions—ALB, MSE, or APIG.

by Fakhri Darmawan, Solution Architect Alibaba Cloud Indonesia

Continue from previous blog about Nginx Ingress Replacement Option - Alibaba Cloud Community.

Alibaba Cloud provide multiple option to migrate from Nginx Ingress to ALB, MSE or APIG. Here is how to migrate for each of solution.

Migrate to ALB

Follow up this document for detail how to migrate Best practice for migrating from a self-managed NGINX Ingress to an ALB Ingress - Container Service for Kubernetes - Alibaba Cloud Documentation Center. This is the High level of how to migrate.

1

1.  Put the domain weight of ALB and Nginx

2

2.  Gradually migrate the domain traffic

3

3.  Delete resource in nginx ingress

4

Migrate to MSE

This is the high level how to migrate to MSE from Nginx Ingress, for the detail can take a look at this documentation Migrate traffic from an NGINX Ingress gateway to an MSE Ingress gateway - Microservices Engine - Alibaba Cloud Documentation Center. This is high level step migrate nginx to MSE.

5

1. Migrate Routing Rules

Create MSE cloud native gateway and create migration configuration. The MSE cloud-native gateway automatically listens to the changes of all Ingress resources that are associated with the source Ingress class in the cluster, and makes the configurations of the domain names and routes of the Ingress resources take effect.

2. Check Routes

Check the compatibility of the Ingress resources to which the cloud-native gateway listens. If all Ingress annotations are compatible with the cloud-native gateway, proceed to the next step.

3. Select a Traffic Switching Method

a. Reuse original cluster slb

In this method, you need to add the MSE cloud-native gateway to the backend vServer group of the SLB instance that is associated with the NGINX Ingress gateway. During the migration, the SLB instance distributes business traffic to the MSE cloud-native gateway based on the configured weight. After the migration is complete, all business traffic on the SLB instance is switched to the MSE cloud-native gateway.

b. DNS resolution to SLB

For the DNS service provided by the DNS vendor, add the mappings between all domain names involved in route migration and the IP address of the SLB instance that is associated with the cloud-native gateway. We recommend that you use DNS records to gradually switch traffic based on configured weight values.

4. Switch Traffic

a. Reuse original cluster SLB

Use weight - Specify the weight based on which traffic is switched to the MSE cloud-native gateway. You can set the weight to a value ranging from 1 to 100 based on your business requirements. We recommend that you set the weight to a value ranging from 1 to 10 for the first time.

b. DNS resolution to SLB

For the DNS service provided by the DNS vendor, add the mappings between all domain names involved in route migration and the IP address of the SLB instance that is associated with the cloud-native gateway. We recommend that you use DNS records to gradually switch traffic based on configured weight values.

Rollback Option

If the traffic distribution is not as expected, you can use one of the following methods to immediately roll back the traffic to NGINX Ingress Controller.

Reuse Original Cluster SLB: Set the weight to 0 to terminate the migration.

DNS Resolution to SLB: For the DNS service provided by the DNS vendor, delete the mappings between the business domain names and the IP address of the SLB instance that is associated with the MSE cloud-native gateway.

Migrate to APIG

The step detail to migrate Nginx ingress to APIG is available on this document Migrate a self-managed NGINX Ingress gateway to Cloud-native API Gateway - API Gateway - Alibaba Cloud Documentation Center. Step to migrate similar like MSE. This is high level of how APIG core configuration that was suitable for ingress.

Cloud-native API Gateway supports two core configuration modes to meet different management needs and use cases:

  1. Listen to Kubernetes Ingress (Ingress mode): The gateway runs as an APIG Ingress Controller. It is compatible with Kubernetes Ingress resources and annotations supported by APIG Ingress. This mode is suitable for teams that want to continue using native Kubernetes workflows, such as GitOps.
  2. Configure APIs in the console (API management mode): You can configure the gateway through the Alibaba Cloud Management Console or OpenAPI. This mode provides full API lifecycle management, advanced security policy configuration, and API operation capabilities. It is suitable for scenarios that require centralized governance and fine-grained control.

Mode One: Listen to K8s Ingress (Ingress Mode)

In this mode, the Cloud-native API Gateway is deployed as a Kubernetes cluster's Ingress Controller to manage the cluster's north-south traffic.

Core Advantages

Smooth migration: Offers a path to migrate a self-managed Nginx Ingress to Cloud-native API Gateway. This process minimizes migration costs and the risk of business disruption for Nginx Ingress users.

Maintain Kubernetes-native workflows: Fully compatible with Kubernetes Ingress resources and annotations. Teams can continue to use existing workflows, such as kubectl apply and GitOps, to manage routing rules.

Enhanced features: Builds on Nginx Ingress compatibility by providing more powerful administration capabilities, such as global rate limiting.

Scenarios

This mode is ideal for migrating existing Nginx Ingress users. It is also suitable for teams that are Kubernetes-centric and rely on GitOps to manage application releases. Development and operations teams can use this mode to quickly implement cluster traffic routing and basic administration.

High Compatibility with Nginx Ingress Annotations

APIG Ingress, the Ingress Controller for Cloud-native API Gateway, supports most Nginx Ingress annotations. It supports 51 annotations, which cover 90% of user scenarios. You can migrate existing Kubernetes Ingress YAML files without major changes.

Configure APIs in the Console (API Management Pattern)

In this mode, Cloud-native API Gateway acts as a centralized API management platform. You can define and manage APIs through the Alibaba Cloud Management Console, or using an API or Terraform. This mode upgrades your capabilities from simple route forwarding to full API administration.

Core Advantages

Centralized administration: Allows platform teams, architects, or security teams to manage all APIs from a unified view and enforce security, compliance, and traffic policies.

Full lifecycle management: Supports the complete API lifecycle, from design, development, and testing to publishing and unpublishing. This includes version control, release auditing, and one-click rollbacks.

Advanced security capabilities: Natively integrates complex authentication mechanisms, such as OpenID Connect (OIDC), JWT, and custom authentication and authorization.

API operations and ecosystem: Supports consumer management, subscription relationships, and call quotas for APIs. This enables the API economy.

Scenarios

This mode is ideal for enterprises that need fine-grained, centralized administration of APIs. It is also suitable for businesses with high requirements for API security and identity authentication, teams that need to manage API versions, perform phased releases, and conduct audits, and scenarios where you build an open platform and need to manage third-party developers (consumers) and their call quotas.

0 1 0
Share on

Alibaba Cloud Indonesia

126 posts | 22 followers

You may also like

Comments

Alibaba Cloud Indonesia

126 posts | 22 followers

Related Products