Alibabacloud ECS plugin
See the 中文文档 for Chinese readme.
Table of contents
- Create a key pair
- Download plugin
- Configure clouds
- Navigate to Configure Clouds Menu
- Add New Cloud
- Configure "Cloud Name"
- Configure "Credentials"
- Configure "Region" -Required
- Configure "Image" -Required
- Configure "VPC" -Optional
- Configure "Security Group" -Optional
- Configure "ECS SSH Key" -Required
- "Test Connection" -Required
- Configure "Available Zone" -Optional
- Configure "VSW" -Optional
- Configure "Instance Type" -Optional
- Configure "Minimum number of instances" -Optional
- Configure "Init Script" -Optional
- Configure "Labels" -Optional
- Configure "Remote FS root" -Optional
- Provision Nodes
- Trouble Shooting
- Change Log
- Contact us
This plugin implements Jenkins slave node provision mechanism. In CI/CD scenario, if your Jenkins master node is under high workload, use this plugin to provision slave ECS node, offloading master's workloads.
The graph below illustrate how the Jenkins Master & Slave mechanism works.
Before starting, please make sure you have met the following requirements:
- Alibaba Cloud Account. For international user, please refer to Alibaba Cloud Global Account
- Alibaba Cloud AccessKey/SecretKey for API access.
- Jenkins Master: A running Jenkins master is necessary, this plugins only provision slave node, and DOES NOT provision master node.
A key pair is necessary for the provisioned node in order to communicate with master node using SSH tunnel.
1.1 Login to ECS Console
1.2. Navigate to "Network and Security" > "Key Pair" menu
1.3. Generate a Key Pair Click "Create SSH Key Pair" button, generate the key according to the prompt, and save the generated key pair in ".PEM" format
2.1 Login to your own Jenkins console. Navigate to the "Manage Jenkins" > "Manage Plugins" > "Available" menu
2.2 Type and search "Alibaba Cloud ECS"
2.3 Install the plugin
Alibaba Cloud Credentials Plugin is necessary and will also be installed.
Once you have finished the installation of ECS plugin, navigate to "Manage Jenkins" > "Manage Node and Clouds" > "Configure Clouds" menu
Select "Alibaba Cloud ECS"
A name is mandatory to identify the clouds.
An effective is necessary. Plugin uses the credential(aka ak/sk) to invoke Alibaba Cloud ECS OpenAPI in order to create ECS as slave node.
- Type in the ak/sk you've previously created in Prerequisites part
- Please make sure you don't have any warnings listed below:
Select the credentials you've just created
Select the right region where the slave ECS node will be provisioned.
Select the right image type.
If there is any VPCs in your selected region, they will be listed in the "VPC" drop down list. And if no VPC found, a default VPC will be created with 172.16.0.0/12 CIDR block
If there is any Security Groups in your selected region, they will be listed in the "Security Group" drop down list. And if no security group found, a default security will be created with "22/22" port range access.
- Enter the SSH Key obtained in STEP 1: Create a key pair for ECS
- Currently, only "SSH username with private key" is supported.
Before going on, you should click "Test Connection" button to run a thoroughly check and make sure all the required items are successfully configured.
Select the right available zone where the slave ECS node will be provisioned. And if no Available Zone selected, a random zone will be selected.
Select the right vsw where the slave ECS node will be provisioned. And if no VSW selected, a random vsw that doesn't overlap with the existing vsws will be created.
Select the right instance type that the slave ECS node will be provisioned. And if no instance type selected, a random instance type will be selected.
Minimum number of instances is the number of follower nodes used to generate the follower. This plugin will create the follower according to the number filled in. The number should be at least 1
Init script is the shell script to be run on the newly launched follower node instance, before Jenkins starts launching a follower node. This is also a good place to install additional packages that you need for your builds and tests.
- After saving successfully, enter new nodes to add nodes. The initialization status is as follows:
- After clicking the instance of provision via pot, the follower node will be initialized as follows:
- After a while, the state will be restored after the connection.
- Click the node drop-down box to perform relevant operations on the follower node.
- Click Configure to view the follower node information
- When you click the Save button, if the "SSH username with private key" connection test fails, the save will succeed, but "provision node" will report an error of "a problem occurred while processing the request". Therefore, please ensure that the connection is successful before saving.
- If you have any questions or requirements, please scan the following QR code with DingTalk QRCode