Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Container Engine/ User Guide/ Network/ Ingresses/ Migrating Data from a Bring-Your-Own Nginx Ingress to a LoadBalancer Ingress

Migrating Data from a Bring-Your-Own Nginx Ingress to a LoadBalancer Ingress

Updated on 2025-02-18 GMT+08:00

This section describes how to migrate data from a bring-your-own Nginx ingress to a LoadBalancer ingress.

LoadBalancer ingresses are implemented based on Huawei Cloud ELB. LoadBalancer ingresses offer better traffic management compared to bring-your-own Nginx ingresses because of the following advantages:

  • Fully managed and O&M-free: ELB is a fully managed cloud service that requires no worker node, making it completely O&M-free.
  • High availability: ELB enables active-active disaster recovery within a city across AZs. This ensures seamless traffic switchover in the event of a failure. Dedicated load balancers provide a comprehensive health check system to ensure that incoming traffic is only routed to healthy backend servers, improving the availability of your applications.
  • Auto scaling: ELB can automatically scale to handle traffic spikes.
  • Ultra-high performance: A single load balancer supports up to 1 million queries per second and tens of millions of concurrent connections.
  • Integration with cloud services: ELB can run with various cloud services, such as WAF.
  • Hot updates of configurations: Configuration changes can be updated in real-time without requiring a process reload. This helps to prevent disruptions to persistent connections.

Example Scenarios

A company is using a CCE cluster on Huawei Cloud to run their services. They have set up ingress forwarding rules using their NGINX Ingress Controller, which includes domain-based and URL-based forwarding rules. Their services are accessible externally through a DNS domain name. When a client requests access to the domain name example.com, Nginx Ingress forwards the requests to the pod associated with the Service based on the forwarding rules created on the ingress.

To develop services, the company must transfer their data from Nginx ingress to a LoadBalancer ingress. To maintain service stability, they want to keep the DNS domain name and IP addresses of their backend servers unchanged. To meet this requirement, you can configure LoadBalancer ingress rules in the CCE cluster to preserve the previous forwarding rules. Then, configure weighted DNS records to transfer data from the Nginx ingress to the LoadBalancer ingress.

NOTICE:
  • Migrate data during off-peak hours.
  • ELB is billed. For details, see Billing Overview.

Configuring the Target LoadBalancer Ingress

  1. Create an ingress for migration and route it to the original backend service.

    In this example, an existing load balancer is used to create an ingress, and the elbingress.yaml is for reference only. You can also choose to automatically create a load balancer associated with the ingress. For more information, see Creating a LoadBalancer Ingress Using kubectl.
    apiVersion: networking.k8s.io/v1
    kind: Ingress 
    metadata: 
      name: ingress-test
      annotations: 
        kubernetes.io/elb.id: <your_elb_id>  # Replace it with the ID of your existing load balancer.
        kubernetes.io/elb.ip: <your_elb_ip>  # Replace it with the IP of your existing load balancer.
        kubernetes.io/elb.class: performance  # A dedicated load balancer is used.
        kubernetes.io/elb.port: '80' 
    spec:
      rules: 
      - host: 'example.com'            # Replace it with your domain name.
        http: 
          paths: 
          - path: '/'
            backend: 
              service:
                name: <your_service_name>  # Replace it with the name of your target Service, which is the same as the Service associated with the original Nginx ingress.
                port: 
                  number: 8080             # Replace 8080 with the port number of your target Service.
            property:
              ingress.beta.kubernetes.io/url-match-mode: STARTS_WITH
            pathType: ImplementationSpecific
      ingressClassName: cce  

  2. Run the following command to create the ingress:

    kubectl apply -f elbingress.yaml

Redirecting Traffic to the LoadBalancer Ingress

Before redirecting traffic, ensure you have created record A to map the service domain name to the public IP address of the company's Nginx ingress. You can configure weighted DNS records to transfer data from the Nginx ingress to the LoadBalancer ingress.

Figure 1 Using DNS to redirect traffic

To redirect traffic, do as follows:

  1. Go to Public Zones.
  2. On the Public Zones page, click the domain name (example.com) of the public zone.
  3. The Record Sets page is displayed. You can find an A record, which contains the public IP address of the Nginx ingress. Change the weight of the A record to 9.
  4. Add an A record set. To do so, click Add Record Set, and set Value to the public IP address of the target LoadBalancer ingress and Weight to 1.

    Figure 2 Adding a record set

  5. Gradually increase the weight of the DNS record for the LoadBalancer ingress to 100% without affecting any services.

Deleting Redundant Resources

After all persistent connections to the Nginx ingress are released and there is no more traffic being forwarded to it, you can safely release any unnecessary resources such as the Nginx ingress, NGINX ingress Controller, and webhook after observing for a period of time.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback