Creating an Nginx Workload
This section describes how to use CCI to deploy an nginx workload. The following figure demonstrates the procedure.

Creating a Namespace
- Log in to the CCI console.
- Choose Namespaces in the navigation pane and then click Create in the General-computing namespace area.
- Enter a namespace name.
Select an existing VPC or create one. You must specify a CIDR block for the new VPC. The recommended CIDR blocks are 10.0.0.0/8-22, 172.16.0.0/12-22, and 192.168.0.0/16-22.
The VPC and subnet CIDR blocks cannot be set to 10.247.0.0/16 because this CIDR block is reserved by CCI for workloads. If you use this CIDR block, IP address conflicts may occur, which may result in workload creation failures or service unavailability. If you do not need to access pods through workloads, you can allocate this CIDR block to a VPC.
- Configure a subnet CIDR block.
Ensure that there are sufficient available IP addresses. If the number of IP addresses are insufficient, workloads will fail to be created.
- Click Create.
Configuring Basic Information
- Log in to the CCI console.
- In the navigation pane, choose Workloads > Deployments. On the page displayed on the right, click Create Deployment.
- Specify basic information.
- Workload Name: Enter a workload name, for example, nginx.
- 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 GB memory.

- Configure Container
Click the Open Source Images tab, and select the nginx image. Retain the default image configurations.

Configuring Workload Access Settings
- Configure workload access settings.
Three options are available, which are:
- Do not use: No entry is provided to allow access from other workloads. This mode is ideal for computing scenarios where communications with external systems is not required.
- Intranet access: A domain name or internal domain name/virtual IP address is configured for the current workload so that the workload can be accessed by other workloads in the intranet. There are two access modes: Service and ELB.
- Internet access: The current workload can be accessed from external systems using ELB.
In this example, set the workload access mode to Internet access to allow access to the Nginx workload using the IP address and port of the load balancer.
Set Service Name to nginx, and select a load balancer. If no load balancer is available, click Create an enhanced load balancer to create one.
Set Ingress Name to nginx, ELB Protocol to HTTP, and ELB Port to 80.

Set the workload port to 80 (or another port) and container port to 80. The container port must be set to 80, which is the same port set for the Nginx image in the container registry.
Set Mapping Path to / and associate it with the workload access port so that you can access the nginx workload using ELB IP address:Port.

- Click Next. After you confirm the configuration, click Submit. Then click Back to Deployment List.
In the workload list, if the workload status is Running, the workload is created successfully.

Accessing the Workload
After the nginx workload is created, you can access it using a browser.
- Click the workload name to enter its details page.
- Click the Internet access tab under Access Settings, and copy the Internet access address.

- Enter the address in the browser address box.

Clearing Resources
You will be charged when the node and workload are running. Therefore, you are advised to clear them in case of resource waste.
- In the navigation pane of the CCI console, choose Workloads > Deployments.
- Click
in the nginx workload card.

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.