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
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
On this page
Help Center/ Cloud Container Instance/ Best Practices/ Workload Management/ Performing Graceful Rolling Upgrade for CCI Applications

Performing Graceful Rolling Upgrade for CCI Applications

Updated on 2024-01-16 GMT+08:00

Scenario

When you deploy a workload in CCI to run an application, the application is exposed as a LoadBalancer Service or ingress, and connected to a dedicated ELB load balancer to allow access traffic to reach the containers directly. When rolling upgrade or auto scaling is performed on the application, your pods may fail to work with ELB and 5xx errors may occur. This section guides you to configure container probes and readiness time to achieve graceful upgrade and auto scaling.

Procedure

The following uses an Nginx Deployment as an example.

  1. On the CCI console, choose Workloads > Deployments in the navigation pane, and click Create from Image in the upper right corner.

    Figure 1 Creating a Deployment

  2. In the Container Settings area, click Use Image to select an image.
  3. Click Advanced Settings of the image, click Health Check > Application Readiness Probe, and configure the probe.

    Figure 2 Configuring the application readiness probe
    NOTE:

    The probe checks whether your container is ready. If the container is not ready, requests will not be forwarded to the container.

  4. Expand Lifecycle and configure the parameters of Pre-Stop Processing for the container.

    Figure 3 Configuring lifecycle parameters
    NOTE:

    This configuration ensures that the container can provide services for external systems during its exit.

  5. Click Next: Configure Access Settings and configure settings as shown in Figure 4.

    Figure 4 Configuring the access type and port

  6. Click Next and complete the Deployment creation.
  7. Configure the minimum readiness time.

    A pod is considered available only when the minimum readiness time is exceeded without any of its containers crashing.

    In the upper right corner of the Deployments page, click Create YAML to configure the minimum readiness time as below.
    Figure 5 Configuring the minimum readiness time
    NOTE:
    • The recommended value of minReadySeconds is the expected time for starting the service container plus the duration from the time when the ELB service delivers the member to the time when the member takes effect.
    • The value of minReadySeconds must be smaller than that of sleep to ensure that the new container is ready before the old container stops and exits.

  8. Test the application upgrade and auto scaling.

    Prepare a client outside the cluster, and configure the detection script detection_script.sh with the following content (100.85.125.90:7552 indicates the public network address for accessing the Service):
    #! /bin/bash 
    for (( ; ; ))
    do
             curl -I 100.85.125.90:7552 | grep "200 OK"
             if [ $? -ne 0 ]; then
                      echo "response error!"
                      exit 1
             fi 
    done

  9. Run the detection script (bash detection_script.sh) and trigger the rolling upgrade of the application on the CCI console. You can change the specifications of the container to trigger the rolling upgrade of the application.

    Figure 6 Modifying container specifications

    If the access to the application is not interrupted, and the returned responses are all 200OK, the graceful upgrade is successfully triggered.

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