Creating Jenkins servers
    • PDF

    Creating Jenkins servers

    • PDF

    Article Summary

    Available in Classic

    Before use

    Q. What is Jenkins?

    • It is a service that provides a server with a representative tool called Jenkins for Continuous Integration(CI) and Continuous Delivery(CD).
    • It is a tool that helps you enhance software quality and improve development productivity by automating the build, test, and deployment processes.
    • By constantly integrating source changes into your project, you can detect errors inside your code in the early stage and continue to provide reliable releases through fast feedback.
    • "Jenkins" uses an open source called Jenkins that provides a Continuous Integration service in software development.

    Q. What are the benefits of using Jenkins?

    • You can improve your development productivity by automating the build, test, and deployment processes using Continuous Integration.
    • You can enhance software quality through the automated test.
    • Continuous Integration enables rapid delivery of stable releases.

    Q. How do I create Jenkins server?

    • You can select and create Jenkins server image from Console > Server > Server menu.
    • Create a server with your desired specification and add storage as needed.
    • You will be charged according to a monthly or hourly pricing plan, and you can set your access environment after the server creation.
    • To use Jenkins, you need to create a public IP and add port 18080 in ACG settings.
    • After connecting to the Console, you can easily create a server by following the steps.

    devtools-1-1-01_en

    Q. I cannot connect to Jenkins.

    • To use Jenkins, you need to create a public IP address and attach it to a server, and you are also required to add 18080 port to ACG. (Please refer to 'Access Environment Settings'.)
    • If you cannot connect even after confirming the public IP address and ACG, Jenkins process may be suspended. Restart the process by executing the restart command on the terminal. (Please refer to 'ManageJenkinsprocess'.)

    Q. Where can I find the necessary Administrator password for Unlock Jenkins screen?

    • You can get Administrator password used on Unlock Jenkins screen during Jenkins initial configuration process by connecting to the server and opening the /var/lib/jenkins/secrets/initialAdminPassword file.
    • Administrator password is a one-time temporary password used during the initial configuration phase.

    Q. Which directory is Jenkins installed in?

    • It is installed in the /var/lib/jenkins directory.
    • Jenkins installation path includes the configuration file(config.xml), the job storage path(/jobs), and the logs(/logs).
    • We recommend that you back the installation path up to prevent a data loss.

    Q. How do I reset Jenkins Admin password?

    • To reset Jenkins Admin password:
      1. Connect to a server
      2. Edit [Jenkins Installation Path]/config.xml.
    • Jenkins Initial Installation Path: /var/lib/jenkins
      1. Change the useSecurity field to false.
      • <useSecurity>false</useSecurity>
      1. Delete the authorizationStrategy and securityRealm fields.
        • <authorizationStrategy>, <securityRealm>
      2. Restart Jenkins service.
        • CentOS: $ service jenkins restart
        • Ubuntu: $ systemctl restart jenkins

    About Jenkins

    Jenkins is a leading tool for Continuous Integration (CI) and Continuous Delivery (CD), helping to improve software quality and improve development productivity by automating the build, test, and deployment processes. By constantly integrating changes into your project, you can detect errors inside your code in the early stages and continue to provide reliable releases through fast feedback.

    Create Jenkins server

    How to create Jenkins server is as follows.

    Step 1. Connect to Console

    Connect to the Console and select Server > Server menu.

    lamp-1-1-02_en

    ① To create a server, click [Create Server] button.

    Step 2. Select server image

    Select Jenkins server image to create a server.
    devtools-1-1-03_en

    ① Select Applications > Jenkins.

    ② Click [Next] button.

    ③ Check the popup window’s instructions (to create a public IP address and ACG for using Jenkins and get an initial password).

    ④ Click [OK] button to close the popup window.

    Step 3. Set server

    Select a storage type, server type, plan, and zone, and enter a server name.

    lamp-1-1-04_en

    ① Select a zone.

    • The currently provided zone is ‘KR-1’.

    ② Select a storage type to use as boot storage.

    ③ Select the desired server type.

    • Some server specifications may not be supported depending on the boot disk type.
    • Select one between Compact server type and Standard server type depending on your purpose.

    ④ You can choose either the monthly or hourly pricing plan.

    ⑤ Enter a server name.

    • It is a name for users to distinguish a server and cannot be used in duplicate.

    ⑥ Click [Next] button.

    Step 4. Set authentication key

    Select 'Use an Existing Authentication Key' if you have an existing authentication key. If not, create a new one referring to the procedures below.

    lamp-1-1-05_en

    ① Select Create a New Authentication Key.

    ② Enter an authentication key name.

    ③ Click [Create & Save Auth Key] button to save the authentication key file to your local PC.

    • Issue a new authentication key.
    • After saving, please keep the authentication key in a safe place on your PC.
    • The authentication key will be used to get an initial administrator password.

    ④ Click [Next] button.

    Step 5. Set firewall

    You can set a firewall by using your ACG or by creating a new ACG.

    Firstly, this describes how to set a firewall using your ACG.

    lamp-1-1-06_en

    ① You must select ACG. Select one of your ACGs, including the default ‘ncloud-default-acg’.

    • Up to 5 ACGs can be selected.
    • You must select ACG for [Next] button to be activated in order to proceed with the settings.

    ② If you want to create and configure a new ACG besides your ACGs, select Create a New ACG.

    ③ Click [Next] button.

    To create a new ACG to set up your firewall:

    lamp-1-1-07_en

    ① In Create a New ACG, click [Create ACG] button.

    ② Enter ACG name.

    ③ In ACG settings, enter a protocol, an access source, and an allowed port to create ACG.

    • Protocol: Select from TCP, UDP, and ICMP.

    • Access source: Enter an IP address or ACG name.

    • Allowed port: Specify a single port or range.

    • For terminal connections, ACG of a server to be connected must have the rule for SSH 'TCP/22', and the rule of 'TCP/18080' must be set additionally to use Jenkins.

    • To add a rule, enter a protocol, an access source, and an allowed port, and click [Add] button.

    ④ If both ports 2280 and 18080 are added, click [Create] button.

    Step 6. Confirm

    Finally, confirm the settings.

    devtools-1-1-08_en

    ① Make sure that the server image, server, authentication key, and ACG are set up properly.

    ② After the final confirmation, click [Create Server] button.

    • This may take several minutes or longer for the server to be created.

    View on the server list

    View the created server in your list.

    lamp-1-1-09_en

    ① The created server appears in your list.

    ② Wait until the server status becomes running after the server has been created and the package has been installed.

    Access environment settings

    Create a public IP address

    To use Jenkins, you must use a public IP address to access, and you will be charged for using a public IP address.

    lamp-1-1-11_en

    ① Click [Create Public IP] button to get a public IP address.

    ② Select Jenkins server to attach the public IP address to from Select Server.

    ③ Click [OK] button.

    Set port forwarding

    To connect to a server with a terminal program(such as Putty), you must set port forwarding.

    lamp-1-1-12_en

    ① To connect to a server, click [Set Port Forwarding].

    ② On Set Port Forwarding screen, set an external port number. The external port number input range is in 1024~65,534 and cannot be used for other service purposes than the feature to connect to a server.(The internal port number is set to 22.)

    ③ If you click [Add] button, the settings will be added at the bottom, and you can edit or delete the settings by clicking [Edit] or [Delete] button.

    ④ If you click [Apply] button, SSH connection to the set external port can be made using a terminal program.

    Set ACG

    Add terminal connection SSH('TCP/22') and Jenkins('TCP/18080') rules to ACG.

    If you have already added rules upon the server creation, you do not need to perform ACG settings in this step.

    lamp-1-1-13-1_en

    ① Select ACG chosen when creating the server and click Set ACG at the top.

    ② Enter ACG name.

    ③ When you’re finished setting, click [Create] button.

    lamp-1-1-13-2_en

    ① Select ACG you created.

    ② Click [Set ACG] button at the top.

    ③ In Set ACG Rules, enter a protocol, an access source, and an allowed port to create it.

    • Protocol: Select from TCP, UDP, and ICMP.

    • Access source: Enter an IP address or ACG name.

    • Allowed port: Specify a single port or range.

    • For terminal connections, ACG of a server to be connected must have the rule for SSH 'TCP/22', and the rule of 'TCP/18080' must be set additionally to use Jenkins.

    • To add a rule, enter a protocol, an access source, and an allowed port, and click [Add] button.

    ④ Once the settings have been completed, click Apply button.

    Get server admin password

    To connect to a server with a terminal program(such as Putty), you need to know the administrator password.

    lamp-1-1-14_en

    ① From the menu on the left, select Server menu.

    ② Select a server and click [Get Admin Password] from Manage Servers.

    ③ Click [Drop Files Here or Click to Upload] button to attach the authentication key file (.pem) saved on your PC when creating the server.

    ④ After attaching, click [Get Password] button to get a password to use when first logging in to the server via a terminal program.

    • Please change the password to one that the administrator can easily remember after first logging in.

    Connect to terminal

    You can manage Jenkins process by connecting to a server with a terminal program(Putty, etc.).

    Connect to server via terminal program

    devtools-1-1-21_en

    ① Execute a terminal program(such as Putty).

    ② Enter the values of ‘Public IP’ and ‘External Port’ that you have confirmed in your server list or Show, and click [Open] button to connect to the server.

    • Get a public IP: 'Public IP' of Port Forwarding Information in [Show] after selecting a server in Console > Server > Server List
    • Get an external port number: ‘External Port’ of Port Forwarding Information in [Show] after selecting a server in Console > Server > Server List

    ③ Enter your user information and password to log in.

    • login as: root
    • password: The administrator password you see above

    ④ Please change the root account’s password to one that you can easily remember after first logging in.
    Enter the ‘passwd root’ command to input a new password.

    Manage Jenkins process

    You can manage Jenkins process with the following commands.

    • Start and stop Jenkins process.
    • CentOS
    shell> service jenkins start
    shell> service jenkins stop
    
    • Ubuntu
    shell> systemctl start jenkins
    shell> systemctl stop jenkins
    
    • Check Jenkins process.

      • CentOS
      shell> service jenkins status
      
      • Ubuntu
       shell> systemctl status jenkins
      

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.