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
Help Center/ Cloud Container Instance/ Best Practices/ Workload Creation/ Using the CCI Console to Create Workloads

Using the CCI Console to Create Workloads

Updated on 2024-10-29 GMT+08:00

Using docker run Commands to Run Containers describes how you can run the WordPress workload by running the docker run commands. However, it is not convenient to use a container engine in many scenarios, such as auto scaling and rolling upgrade.

CCI provides a serverless container engine that frees you from managing clusters or servers. CCI delivers agility and high performance with only three steps. It enables you to create stateless workloads (Deployments) and stateful workloads (StatefulSets). It also enhances container security isolation and supports fast workload deployment, elastic load balancing, auto scaling, and blue-green deployment based on the Kubernetes workload model.

Creating a Namespace

  1. Log in to the CCI console. In the navigation pane, choose Namespaces.
  2. Click Create for the target namespace type.
  3. Enter a namespace name.
  4. Configure a VPC.

    Select an existing VPC or create one. Recommended CIDR blocks for the new VPC are 10.0.0.0/8-24, 172.16.0.0/12-24, and 192.168.0.0/16-24.

  5. Configure a subnet.

    Ensure that there are sufficient available IP addresses in the subnet. If IP addresses are insufficient, workload creation will fail.

  6. Click Create.

Creating a MySQL Workload

  1. Log in to the CCI console. In the navigation pane on the left, choose Workloads > Deployments. On the page displayed, click Create from Image.
  2. Specify basic information.

    • Workload Name: mysql
    • Namespace: Select the namespace created in Creating a Namespace.
    • Pods: Change the value to 1 in this example.
    • Pod Specifications: Select the general-computing pod with 0.5-core CPU and 1 GiB of memory.

    • Container Settings
      1. On the Open Source Images tab, search for the mysql image and click Use Image.

      2. Set image parameters. Specifically, set the image version to 5.7, CPU to 0.50, and memory to 1.000.

      3. In the advanced settings, enter the environment variable MYSQL_ROOT_PASSWORD and its value. The value is the password of the MySQL database. You need to set the password by yourself.

  3. Click Next: Configure Access Settings. Set Access Type to Intranet access. In this case, the workload can be accessed by other workloads in CCI by using Service name:Port. In addition, set Service Name to mysql, and map workload access port 3306 to container port 3306 (default access port of the MySQL image).

    In this way, other workloads in CCI can access the MySQL workload by using mysql:3306.

  4. Click Next. On the page that is displayed, check the configurations and then click Submit.

    In the workload list, if the workload is in the Running state, the workload is successfully created.

Creating a WordPress Workload

  1. Log in to the CCI console. In the navigation pane on the left, choose Workloads > Deployments. On the page displayed, click Create from Image.
  2. Specify basic information.

    • Workload Name: wordpress
    • Namespace: Select the namespace created in Creating a Namespace.
    • Pods: Change the value to 2 in this example.
    • Pod Specifications: Select the general-computing pod with 0.5-core CPU and 1 GiB of memory.

    • Configure Container
      1. On the Open Source Images tab page, search for the wordpress image and click Use Image.

      2. Set image parameters. Specifically, set the image version to php7.1, CPU to 0.50, and memory to 1.000.

      3. In the Advanced Settings area, expand Environment Variables and add environment variables to enable the wordpress application to access the MySQL database.

        Table 1 Description of environment variables

        Variable Name

        Variable Value/Variable Reference

        WORDPRESS_DB_HOST

        Address for accessing the MySQL database.

        Example: 10.***.***.***:3306

        WORDPRESS_DB_PASSWORD

        Password for accessing the MySQL database. The password must be the same as the MySQL password set in Creating a MySQL Workload.

  3. Click Next: Configure Access Settings.

    Set Access Type to Internet access and Service Name to wordpress, and select a load balancer. If no load balancers are available, click Create Share Load Balancer. Set ELB Protocol to HTTP and ELB Port to 9012. In the Workload Port Settings area, set a mapping between workload access port 8080 and container port 80 (default access port in the WordPress image). In the HTTP Route Settings area, set Mapping Path to / (so http://Load balancer IP address:Port can be used to access the WordPress) and Workload Access Port to 8080.

  4. Click Next. On the page that is displayed, check the configurations and then click Submit.

    In the workload list, if the workload is in the Running state, the workload is successfully created. In this case, you can click the workload to go to its details page.

    In the Access Settings area, click Internet Access and view the access address (Load balancer IP address:Port).

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