Skip to content

Installing Jenkins

This page introduces how to install Jenkins before using the pipeline features.

Prerequisites

  • Before installing Jenkins, make sure there is a default storage class in the cluster where Jenkins will be installed.
  • Please ensure that it is installed in the amamba-system namespace.
  • If installing on a global service cluster, make sure to have an instance of amamba-jenkins in the Container Management -> Helm Apps , under the amamba-system namespace.

Getting Started with Installation

  1. Go to the Container Management module and find the cluster where you want to install Jenkins in the Clusters . Click the name of that cluster.

    Note

    Select the cluster for Jenkins based on your actual situation. Currently, it is not recommended to deploy it on the global service cluster as executing pipelines in Jenkins with high concurrency can consume a significant amount of resources and may cause the global service cluster to become unresponsive.

    Click Cluster Name

  2. In the left navigation bar, select Helm Apps -> Helm Charts , and find and click Jenkins .

    jenkins helm

  3. In the Version Selection , choose the desired version of Jenkins to install, and click Install .

    Install

  4. On the installation page, fill in the required installation parameters, and finally click the OK button at the bottom right.

    Fill in Configuration

    Here are some important parameters' explanation. Updates them according to your actual business needs.

    Parameter Description
    ContainerRuntime Select a runtime like podman or docker
    AdminUser Username for Jenkins
    AdminPassword Password for Jenkins
    Deploy.JenkinsHost Host address to Jenkins web service. If using Node Port, the access address will be: http://{cluster address:port}
    JavaOpts Specify JVM startup parameters for running Jenkins
    ServiceType Default is ClusterIP, supports ClusterIP, NodePort, LoadBalancer
    ServicePort Service access port
    NodePort Required if ServiceType=NodePort, range: 30000-32767
    resources.requests Resource requests for Jenkins
    resources.limits Resource limits for Jenkins
    image.registry Jenkins image registry
    eventProxy.enabled EventProxy is a sidecar to provide a reliable connection to Amamba APIServer, enables it especially when Jenkins was deployed to a cluster which does not in the same zone with global-cluster.
    eventProxy.image.registry Registry for image eventProxy.
    Required if enabled=true
    eventProxy.configMap.eventProxy.host Host to webhook address. Uses the portal address if Jenkins was deployed to a Worker cluster.
    Required if enabled=true
    eventProxy.configMap.eventProxy.proto Protocol to webhook address, http by default.
    Required if enabled=true
    eventProxy.configMap.eventProxy.webhookUrl Path to webhook address, /apis/internel.amamba.io/devops/pipeline/v1alpha1/webhooks/jenkins by default.
    eventProxy.configMap.eventProxy.token Token to access DCE, refer Global Access Key Document for token acquisition
    Required if enabled=true
  5. Go to Helm Apps to check the deployment result.

    Deployment Completed

Integrating Jenkins

Note: Currently, only integration with Jenkins installed via the DCE 5.0 platform is supported.

  1. Log in to DCE 5.0 with a user who has the role of a Workbench Administrator and go to the Workbench.

    Deployment Completed

  2. On the left navigation bar under Platform Management, click Toolchain Integration and then click the Integrate button in the upper right corner.

    Deployment Completed

  3. Select the toolchain type as Jenkins , fill in the integration name, Jenkins address, username, and password. If the Jenkins address is using the HTTPS protocol, provide the certificate. By default, the account/password for Jenkins deployed through Helm is admin/Admin01 .

    Deployment Completed

  4. After the integration is complete, a record will be successfully generated on the Toolchain List page.

  5. Now you can proceed to create pipelines in the workspace. Create a pipeline.

Integration Considerations

If Jenkins was integrated without Cluster and Namespace given, it will cause Workbench to be unable to update the configuration of the Jenkins instance, leading to the following two issues:

  • In the pipeline Notification step, when configuring the mail server address in Global Management -> Platform Settings -> Email Server Settings, the configuration cannot be updated in Jenkins.
  • In the pipeline SonarQube Configuration step, after integrating the SonarQube instance into the toolchain and binding it to the current workspace, using that instance will not work.

To address these issues, you need to go to the Jenkins backend for relevant configurations.

Configuring Email Notifications in the Jenkins Backend for the Notification Step

  1. Go to the Jenkins backend, click Manage Jenkins -> Configure System , and then scroll down to the Email Notification section.

  2. Fill in the relevant parameters. The parameter descriptions are as follows:

  3. SMTP Server: The address of the SMTP server that provides email services.

  4. Use SMTP Authentication: Choose according to your requirements. It is recommended to enable SMTP authentication.
  5. Username: The name of the SMTP user.
  6. Password: The password of the SMTP user.
  7. SMTP Port: The port used to send emails. If left blank, the default protocol port will be used.

    Note

    To configure the sender's email address, click the top-right user icon -> Settings, and then scroll down to Email Address .

    Jenkins Email Config

Configuring SonarQube Server Address in the Jenkins Backend for the SonarQube Configuration Step

  1. Go to the Jenkins backend, click Manage Jenkins -> Configure System , and then scroll down to SonarQube servers . Click Add SonarQube .

  2. Fill in the relevant parameters. The parameter descriptions are as follows:

    • Name: Assign a name to the SonarQube server configuration. The value will be required in the SonarQube Configuration step of Workbench pipeline.
    • Server URL: The URL of the SonarQube server.
    • Server authentication token: The authentication token for the SonarQube server. You can generate a token in the SonarQube console.

      • To generate an administrator token in SonarQube, follow the path: My Account -> Profile -> Security -> Generate -> Copy

      • When adding credentials, choose Secret test as a type, enter the SonarQube admin token (Token) as the Secret. If the ID is not filled in, it will be generated by default.

    Jenkins SonarQube Config

    Note

    If a SornarQube instance was already integrated and the Jenkins instance was updated with a new one, in this case, you should make sure the name was set exactly same with the SonarQube name. Which should be noted that Name is not the name entered during integration, instead, it is obtained in the SonarQube configuration step of the pipeline.

    SonarQube Name

  3. Go to the SonarQube backend to update the webhook URL. Click Administration -> Configuration -> Webhooks , select the proper webhook, and click Update .

    Note

    This step is not necessary for versions after Application Workbench v0.25.0!

    sonarqube03

    Update the URL to http://{newly deployed Jenkins address}/sonarqube-webhook/

    sonarqube03

Comments