Configuring Cluster Environments
Prerequisites
Two new VPCs have been created, and their CIDR blocks do not overlap. In this example, the VPC is named vpc-A and the CIDR block is 172.16.0.0/16. The other VPC is named vpc-B and the CIDR block is 172.17.0.0/16.
Creating a Cluster in the Testing Environment
- Log in to the CCE console and click Buy Cluster in the upper right corner on the Clusters page.
- Configure the cluster. The following lists some key parameter configurations. You can configure other parameters as required or use their default values. For details, see Buying a CCE Standard/Turbo Cluster.
- Type: CCE Turbo Cluster
- Cluster Version: Select the latest version.
- VPC: Select vpc-A with the CIDR block of 172.16.0.0/16.
- Configure other parameters, complete the cluster creation, and wait until the cluster is running.
- In the navigation pane, choose Nodes, click the Nodes tab, and click Create Node in the upper right corner.
- Configure the node. The following lists some key parameter configurations. You can configure other parameters as required or use their default values. For details, see Creating a Node.
- Specifications: Select a flavor with 4 vCPUs and 16 GiB of memory.
- OS: Huawei Cloud EulerOS 2.0
- EIP: Select Auto create and bind an EIP to the node. The EIP can be used to pull public network images and perform other operations.
- Confirm the specifications and create the node.
One node can meet the basic requirements in this practice.
Creating a Cluster in the Production Environment
- Log in to the CCE console and click Buy Cluster in the upper right corner on the Clusters page.
- Configure the cluster. The following lists some key parameter configurations. You can configure other parameters as required or use their default values. For details, see Buying a CCE Standard/Turbo Cluster.
- Type: CCE Turbo Cluster
- Cluster Version: Select the latest version.
- VPC: Select vpc-B with the CIDR block of 172.17.0.0/16.
- Configure other parameters, complete the cluster creation, and wait until the cluster is running.
- In the navigation pane, choose Nodes, click the Nodes tab, and click Create Node in the upper right corner.
- Configure the node pool. The following lists some key parameter configurations. You can configure other parameters as required or use their default values. For details, see Creating a Node.
- Specifications: Select a flavor with 4 vCPUs and 16 GiB of memory.
- OS: Huawei Cloud EulerOS 2.0
- EIP: Select Auto create and bind an EIP to the node. The EIP can be used to pull public network images and perform other operations.
- Confirm the specifications and create the node. One node can meet the basic requirements in this practice.
Creating VPC Peering Connections
To enable Jenkins to access the API servers of the testing and production clusters, VPC peering connections need to be created since they are located in different VPCs.
- Log in to the VPC console. In the navigation pane, choose Virtual Private Cloud > VPC Peering Connections.
- Enable the network between the Jenkins server and the testing cluster.
- In the upper right corner, click Create VPC Peering Connection. Configure the parameters following instructions.
- VPC Peering Connection Name: peering-XA
- Local VPC: vpc-X where the Jenkins server resides
- Peer VPC: vpc-A where the testing cluster resides
Figure 1 Creating a VPC peering connection
- Click Create Now.
- Click the name of the created VPC peering connection and add routes.
Click Add Route and add the CIDR block of vpc-A (172.16.0.0/16) to the route table of vpc-X.
Select Add a route for the other VPC and add the CIDR block of vpc-X (192.168.0.0/16) to the route table of vpc-A.
Figure 2 Adding a route
- Click OK.
- In the upper right corner, click Create VPC Peering Connection. Configure the parameters following instructions.
- Repeat the preceding steps to enable the networking between the Jenkins server and the production cluster.
- In the upper right corner, click Create VPC Peering Connection. Configure the parameters following instructions.
- VPC Peering Connection Name: peering-XB
- Local VPC: vpc-X where the Jenkins server belongs
- Peer VPC: vpc-B where the testing cluster resides
- Click OK.
- Click the name of the created VPC peering connection and add routes.
Click Add Route and add the CIDR block of vpc-B (172.17.0.0/16) to the route table of vpc-X.
Select Add a route for the other VPC and add the CIDR block of vpc-X (192.168.0.0/16) to the route table of vpc-B.
- Click OK.
- In the upper right corner, click Create VPC Peering Connection. Configure the parameters following instructions.
Interconnecting with SWR
This solution uses SoftWare Repository for Container (SWR) to store container images built using Jenkins.
- Log in to the SWR console.
- Create an organization to manage images. For details, see Organization Management.
- Obtain the long-term valid docker login login command. For details, see Obtaining a Long-Term Valid Login Command.
This login command will be used when images are uploaded through pipelines. For details, see Implementing Continuous Integration and Deployment.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot