Cloud server with Jenkins
Jenkins is an open source continuous integration server. The application is designed to automate various stages of software development, including software build, testing and deployment.
You can create a cloud server with a ready-made Jenkins application.In Russia, the application runs on a cloud server with a customized SelectOS 1.1 operating system .In other countries — Ubuntu 24.04.
Create a cloud server with Jenkins
For Jenkins to work, the cloud server must be accessible from the Internet.To do this, create a private subnet and connect a public IP address — you can do this when creating the server.To configure Jenkins, when creating the server, specify user data — custom configuration settings for the operating system.
After you create a server with Jenkins, a free TLS certificate from Let's Encrypt® is automatically issued for the domain you specify.To issue the certificate, you must add an A record for the domain and specify the public IP address of the server in the record value.The domain can be added to Selectel (actual) DNS hosting.
1. Create a public IP address
Create a public IP address so that the cloud server with Jenkins can be accessed from the internet.
Use the Create a Public IP Address subsection of the Public IP Addresses instruction.
2. Add an A-record for the domain
Add a resource record to access Jenkins by domain.
Select the type of resource entries in the group — A.In the entry value, specify the public IP address that you created earlier.
3. Create a server with Jenkins
-
In the Dashboard, on the top menu, click Products and select Cloud Servers.
-
Click Create Server.
-
In the Name and Location block:
3.1 In the Name field, enter the name of the server. This will be set as the host name in the operating system.
3.2 In the Region and Pool fields, select the region and pool segment in which the server will be created. The list of available server configurations and resource costs depends on the pool segment. Once the server is created, the pool segment cannot be changed.
-
In the Source block, open the Applications tab.
-
Select
Cloud Jenkins
. -
Optional: if you need a lower version of the application, in the Version field, select the desired version.
-
In the Configuration block, select the server configuration depending on the number of users. If there are less than 100 users, select a configuration from 2 vCPUs, RAM from 4 GB and boot disk size from 20 GB. You can select:
- fixed configuration — rulers in which the ratio of resources is fixed;
- or an arbitrary configuration in which any resource ratio can be specified.
The configurations use different processors depending on the line and pool segment.
7.1 To select a fixed configuration, click Fixed, open the tab with the desired ruler and select the configuration.
7.2 To select an arbitrary configuration, click Arbitrary, specify the number of vCPUs and the RAM size.
7.3 To select a local disk as the server boot disk, check the Local SSD NVMe disk checkbox . To select a network disk as the boot disk, do not check the checkbox.
The amount of RAM allocated to the server may be less than the amount specified in the configuration — the operating system kernel reserves some RAM depending on the kernel version and distribution. You can check the allocated amount on the server with
sudo dmesg | grep Memory
.After the server is created, you can change the configuration.
-
If you did not check the Local SSD NVMe disk checkbox in step 7.3., the first specified network disk will be used as the server boot disk. In the Disks:
8.1. In the Disk Type field, select the type of network boot disk.
8.2 Specify the size of the network boot disk in GB or TB. Observe the maximum size limits of network disks.
-
Optional: Add additional network disks to the server. In the Disks:
9.1. In the Disk Type field, select the network disk type.
9.2 Specify the size of the network disk in GB or TB. Observe the maximum size limits of the network disks.
9.3 To add another additional disk, click Add, select the type of disk and specify its size.
Once the server is created, you can disconnect additional disks from it or connect new ones.
-
In the Network block, connect an existing private subnet with the cloud router or create a new one:
Existing private subnet
New private subnet
10.1 Click Private Subnet.
10.2 In the Public IP Address for Internet Access field, select the public IP address you created earlier.
10.3. Expand the block with private subnet settings.
10.4. In the Subnet field, select an existing subnet.
10.5. In the Private IP field specify the private IP address of the server. The public IP address will be automatically connected to the private address.
10.1 Click Private Subnet.
10.2 In the Public IP Address for Internet Access field, select the public IP address you created earlier.
10.3. Expand the block with private subnet settings.
10.4 If you have existing networks in the project, select New Subnet in the Subnet field.
10.5 Optional: Change the CIDR of the subnet.
10.6 Optionally: enable the DHCP toggle switch.
10.7. Optional: in the Gateway field, change the IP address of the default gateway.
10.8. In the Network field, select the existing network where the subnet will be created or New network. For a private subnet with a public IP address, router-<network_name>
, where <network_name>
is the network name, will be automatically created.
10.9. If you selected New Network, enter the name of the network.
-
Select security groups to filter traffic on server ports. Without security groups, traffic will not be allowed. If there is no block, port security is disabled on the server network . With traffic filtering disabled, all traffic will be allowed.
-
In the Access block:
12.1 Place an SSH key on the server for secure connection.
To add a new SSH key to the cloud platform, click Add SSH Key, enter the key name, paste the public SSH key in OpenSSH format, and click Add.
If an SSH key is added to the cloud platform, select the existing key in the SSH Key field.
12.2 Optionally: in the Password for "root" field, copy the password of the
root
user (a user with unlimited rights to all actions on the system). Save the password in a safe place and do not pass it on in public. -
In the Advanced Settings block:
13.1 Optional: If you plan to create multiple servers and want to increase the fault tolerance of your infrastructure, add a server to a placement group. To create a new group, click Create Group, enter a group name, and select the placement policy on different hosts:
- preferably soft-anti-affinity. The system will try to place servers on different hosts. If there is no suitable host when creating a server, it will be created on the same host;
- anti-affinity is mandatory. Servers in a group must be located on different hosts. If there is no suitable host when creating a server, the server will not be created.
If a group has been created, select a placement group in the Placement Group field.
13.2 Optional: add server tags to add additional information or filter servers in the list. Operating system and configuration tags are automatically added. To add a new tag, enter a tag in the Tags field.
-
In the Automation block, in the User data field, insert the script that will be executed when the system boots:
#cloud-config
write_files:
- path: "/opt/gomplate/values/user-values.yaml"
permissions: "0644"
content: |
username: "<administrator_username>"
password: "<administrator_password>"
domain: "<example.ru>"
email: "<root@example.ru>"Specify:
<administrator_username>
— Jenkins administrator username;<administrator_password>
— Jenkins administrator password. Must be more than eight characters long;<example.ru>
— domain to access Jenkins. For the domain, you need to add an A-record and specify the public IP address you specified in step 10 in the record value. If the domain is added to Selectel DNS hosting (actual), use the instructions Add a resource record. After the server is created, a TLS certificate from Let's Encrypt® will be automatically issued for the domain;<root@example.ru>
— Jenkins administrator email to create an account and receive Let's Encrypt® notifications.
-
Check the price of the cloud server.
-
Click Create.