All Products
Search
Document Center

Container Service for Kubernetes:Deploy Jenkins in an ACK serverless cluster and complete application build and deployment

Last Updated:Mar 26, 2026

This tutorial walks you through deploying Jenkins in an ACK Serverless cluster using Helm, then running your first pipeline build. Jenkins runs its controller on a persistent pod and dynamically creates agent pods in the cluster for each build job.

Prerequisites

Before you begin, ensure that you have:

Usage notes

Jenkins is a community-maintained open source tool. Alibaba Cloud does not provide technical support for Jenkins. You are responsible for maintaining your Jenkins installation.

Step 1: Deploy Jenkins

Configure the Helm repository

Add the Jenkins Helm repository and update your local chart index:

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!
The Jenkins Helm repository is hosted outside the Chinese mainland. If your ACK Serverless cluster is deployed in the Chinese mainland, the helm repo update command may take longer than usual.

Install Jenkins

  1. Create the cicd namespace:

    kubectl create ns cicd
  2. Create a NAS volume for the Jenkins home directory. Without persistent storage, all Jenkins configurations and job history are lost whenever the controller pod restarts. Create a Network Attached Storage (NAS) volume and a persistent volume claim (PVC) named pvc-nas in the cicd namespace before proceeding:

  3. Deploy Jenkins in the cicd namespace:

    helm -n cicd install jenkins jenkins/jenkins \
      --set persistence.existingClaim=pvc-nas \
      --set controller.serviceType="LoadBalancer" \
      --set controller.adminPassword="admin"
    Parameter Description Required
    persistence.existingClaim=pvc-nas Name of the PVC that mounts the NAS volume. Must match the PVC you created in the cicd namespace. Yes
    controller.serviceType="LoadBalancer" Exposes the Jenkins Service externally via a cloud load balancer. The default is ClusterIP, which is accessible only within the cluster. In an ACK Serverless cluster, set this to LoadBalancer so you can reach the Jenkins UI from a browser. No
    controller.adminPassword="admin" Sets a fixed admin password. If omitted, Jenkins generates a random password. See Get the randomly generated password if you skip this parameter. No

    For all available parameters, see jenkins/helm-charts.

  4. Wait for the Jenkins controller pod to reach Running status:

    kubectl -n cicd get po

    Expected output:

    NAME        READY   STATUS    RESTARTS   AGE
    jenkins-0   2/2     Running   0          3m3s

Access Jenkins

Once the pod is running, open a browser and navigate to the external IP address of the Jenkins Service. Log in with the username admin and the password you set during installation.

To look up the external IP address, run:

kubectl -n cicd get svc jenkins

The EXTERNAL-IP column shows the load balancer IP.

Get the randomly generated password

If you did not set controller.adminPassword during installation, retrieve the generated password with:

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

Change the Service type after installation

If you deployed Jenkins with the default ClusterIP Service type and want to expose it via a load balancer afterward, run:

kubectl -n cicd patch svc jenkins -p '{"spec": {"type": "LoadBalancer"}}'

Step 2: Create a pipeline build

Jenkins integrates with the ACK Serverless cluster through the Kubernetes plugin. When you trigger a build, Jenkins dynamically creates an agent pod in the cluster to run the job. The pod contains a jnlp container that acts as the Jenkins agent and connects back to the controller. After the build completes, Jenkins immediately terminates the agent pod, so cluster resources are consumed only during active builds.

The following steps create a pipeline build named first-pipeline using the Hello World template.

  1. Log in to Jenkins and click New Item in the left-side navigation pane.

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

  3. At the top of the configuration page, click the Pipeline tab. Select the Hello World template and click Save.

    pipeline

  4. In the left-side navigation pane, click Build Now to trigger the build.

  5. After the build starts, click Build History in the left-side navigation pane, then click 1# to open the build details. Click Console Output to view the build log and confirm the build succeeded.

What's next

  • Customize the agent pod template to use a specific container image or add multiple containers for language-specific builds. See Jenkins Kubernetes Plugin.

  • Configure source code management and webhooks to trigger pipeline builds automatically on code changes. See Jenkins documentation.