All Products
Search
Document Center

Elastic Container Instance:Deploy Jenkins on an ACK Serverless cluster

Last Updated:Jun 16, 2026

Deploy Jenkins on an ACK Serverless cluster and use a simple example to build and deploy an application.

Prerequisites

Considerations

You are responsible for maintaining your Jenkins system. Enterprise-level technical support is not provided for Jenkins.

Step 1: Deploy Jenkins

  1. Run the following commands to add and update the Jenkins Helm repository.

    helm repo add jenkins https://charts.jenkins.io
    helm repo update

    Expected output:

    Hang tight while we grab the latest from your chart repositories...
    ...Successfully got an update from the "jenkins" chart repository
    Update Complete. ⎈Happy Helming!⎈
    Note

    The Helm repository is located outside the Chinese mainland. If you update the repository from an ACK Serverless cluster in the Chinese mainland, the process might take longer.

  2. Install Jenkins.

    1. Run the following command to create the cicd namespace.

      kubectl create ns cicd
    2. Create a shared NAS storage volume.

      Without a persistent volume for the Jenkins home directory, all configurations are lost if the controller pod restarts.

    3. Run the following command to deploy Jenkins to the cicd namespace.

      helm -n cicd install jenkins jenkins/jenkins \
        --set persistence.existingClaim=pvc-nas \
        --set controller.serviceType="LoadBalancer"   \
        --set controller.adminPassword="admin"
      • persistence.existingClaim=pvc-nas: Required. The name of the persistent volume claim (PVC). In this example, the PVC is named pvc-nas and is created in the cicd namespace.

      • controller.serviceType="LoadBalancer": Optional. The default service type is ClusterIP.

      • controller.adminPassword="admin": Optional. If you do not set this parameter, a random password is automatically generated. To obtain the password, see Access Jenkins and get the default password.

      For more information about deployment parameters, see helm-charts.

    4. Run the following command to check the status of the Jenkins pod. Wait for the pod to enter the Running state.

      kubectl -n cicd get po

      Expected output:

      NAME        READY   STATUS    RESTARTS   AGE
      jenkins-0   2/2     Running   0          3m3s
  3. Access the Jenkins service in a web browser and log in with your username and password.

    For more information, see Access Jenkins and get the default password.

Step 2: Create a pipeline task

Create a pipeline task named first-pipeline. When you run the pipeline, Jenkins automatically launches a dynamic slave pod in your ACK Serverless cluster to execute the build job. After the job completes, the slave pod is immediately released. For more information about Jenkins configurations, see the official Jenkins documentation.

  1. Log in to Jenkins. In the left navigation pane, click New Item.

  2. In the Enter an item name field, enter first-pipeline, select Pipeline as the item type, and then click OK.

  3. Click the Pipeline tab, select the Hello World template, and then click Save.

  4. In the left navigation pane, click Build Now to start the build.

  5. In the Build History section of the left navigation pane, click a build number, such as #1, to open the build's details page. Then, click Console Output to view the build output.

Access Jenkins and get the default password

  • By default, the Jenkins service uses the ClusterIP type. To expose the service via a load balancer, run the following command:

    kubectl -n cicd patch svc jenkins -p '{"spec": {"type": "LoadBalancer"}}'
  • If you did not specify a password during deployment, run the following command to retrieve the default random password:

    kubectl -n cicd exec  -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo