All Products
Search
Document Center

Container Service for Kubernetes:Deploy Jenkins in an ACK cluster and then create and deploy an application

Last Updated:Feb 28, 2026

Jenkins is used to implement continuous integration and continuous deployment (CI/CD). You can deploy Jenkins in Container Service for Kubernetes (ACK) clusters to ensure high availability of services and reduce O&M costs. This topic describes how to deploy Jenkins in an ACK cluster, and then create and deploy a simple application.

Prerequisites

Before you begin, make sure that you have:

Limits

  • Alibaba Cloud does not provide technical support for Jenkins. You are responsible for maintaining your Jenkins deployment.

Important

The Helm charts and images for Jenkins are hosted outside China. Pulls may fail from China-based networks. Use one of the following workarounds:

Step 1: Add the Jenkins Helm repository

Run the following commands to add the Jenkins Helm chart repository and update the 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!

Step 2: Install Jenkins

  1. Create a namespace named cicd:

       kubectl create ns cicd
  2. Deploy Jenkins to the cicd namespace: The following table describes the Helm chart parameters: For all available parameters, see jenkinsci/helm-charts.

    ParameterDescriptionRequired
    persistence.storageClassStorageClass for the persistent volume. alicloud-disk-essd selects an ESSD cloud disk to persist the jenkins_home directory.Yes
    persistence.sizeSize of the persistent volume. Elastic Compute Service (ECS) cloud disks require a minimum of 20 GiB.Yes
    controller.serviceTypeKubernetes Service type for the Jenkins controller. Default: ClusterIP. Set to LoadBalancer to expose Jenkins externally.No
    controller.admin.passwordAdministrator password. Default: randomly generated.No
       helm -n cicd install jenkins jenkins/jenkins \
         --set persistence.storageClass="alicloud-disk-essd" \
         --set persistence.size="20Gi" \
         --set controller.serviceType="LoadBalancer"   \
         --set controller.admin.password="admin"
  3. Wait for the Jenkins pod to reach Running status: Expected output:

       kubectl -n cicd get po
       NAME        READY   STATUS    RESTARTS   AGE
       jenkins-0   2/2     Running   0          3m3s

Step 3: Access Jenkins

If you set controller.serviceType="LoadBalancer" during installation, the Jenkins Service already has an external IP. Skip to step 2.

If you used the default ClusterIP Service type, patch the Service to type LoadBalancer:

  1. Change the Service type:

       kubectl -n cicd patch svc jenkins -p '{"spec": {"type": "LoadBalancer"}}'
  2. Get the external IP address of the Jenkins Service: Expected output:

       kubectl get -n cicd service
       NAME            TYPE           CLUSTER-IP        EXTERNAL-IP     PORT(S)          AGE
       jenkins         LoadBalancer   192.168.***.***   8.222.***.***   8080:30949/TCP   2d17h
       jenkins-agent   ClusterIP      192.168.***.*     <none>          50000/TCP        2d17h
  3. Open http://<EXTERNAL-IP>:8080 in a browser and log in with your administrator credentials.

Note

If you did not set a password during installation, retrieve the auto-generated password:

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

(Optional) Create a Pipeline job

When a build runs, Jenkins dynamically launches an agent pod in the ACK cluster. The agent pod is released after the build finishes. For more information about Jenkins configuration, see Jenkins documentation.

The following steps create a sample Pipeline job named first-pipeline:

  1. In the left navigation pane, click New Item.

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

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

    Pipeline configuration

  4. In the left navigation pane, click Build Now.

  5. Under Build History, click #1 to open the build details, and then click Console Output to view the build log.