Deploy Jenkins on Kubernetes with Helm: A Step‑by‑Step Guide
This tutorial walks you through using Helm to download the Jenkins chart, pull and retag required Docker images, configure a custom values file, install Jenkins on a Kubernetes cluster, verify the deployment, and understand the benefits of Helm for streamlined CI/CD automation.
Download Jenkins Chart
Add the official Jenkins Helm repo, pull the chart version 5.8.37 and push it to a private OCI registry.
<code>$ helm repo add jenkinsci https://charts.jenkins.io --force-update
$ helm pull jenkinsci/jenkins --version 5.8.37
$ helm push jenkins-5.8.37.tgz oci://core.jiaxzeng.com/plugins</code>Pull Official Images
Retrieve required Docker images, retag them to the private registry, and push.
<code>sudo docker pull jenkins/inbound-agent:3307.v632ed11b_3a_c7-2
sudo docker tag jenkins/inbound-agent:3307.v632ed11b_3a_c7-2 core.jiaxzeng.com/library/jenkins/inbound-agent:3307.v632ed11b_3a_c7-2
sudo docker push core.jiaxzeng.com/library/jenkins/inbound-agent:3307.v632ed11b_3a_c7-2
sudo docker pull docker.io/kiwigrid/k8s-sidecar:1.30.3
sudo docker tag docker.io/kiwigrid/k8s-sidecar:1.30.3 core.jiaxzeng.com/library/jenkins/k8s-sidecar:1.30.3
sudo docker push core.jiaxzeng.com/library/jenkins/k8s-sidecar:1.30.3
sudo docker pull docker.io/jenkins/jenkins:2.492.3-jdk21
sudo docker tag docker.io/jenkins/jenkins:2.492.3-jdk21 core.jiaxzeng.com/library/jenkins/jenkins:2.492.3-jdk21
sudo docker push core.jiaxzeng.com/library/jenkins/jenkins:2.492.3-jdk21
sudo docker pull docker.io/bats/bats:1.11.1
sudo docker tag docker.io/bats/bats:1.11.1 core.jiaxzeng.com/library/jenkins/bats:1.11.1
sudo docker push core.jiaxzeng.com/library/jenkins/bats:1.11.1</code>Configure Jenkins Values
Create a
jenkins-values.yamlfile with overrides, controller image registry, sidecar settings, plugins, ingress, persistence, and Java options as shown.
<code>fullnameOverride: jenkins
controller:
image:
registry: core.jiaxzeng.com
repository: library/jenkins/jenkins
sidecars:
configAutoReload:
enabled: true
image:
registry: core.jiaxzeng.com
repository: library/jenkins/k8s-sidecar
installPlugins:
installLatestPlugins: false
ingress:
enabled: true
apiVersion: networking.k8s.io/v1
annotations:
cert-manager.io/cluster-issuer: ca-cluster-issuer
ingressClassName: nginx
hostName: jenkins.jiaxzeng.com
tls:
- secretName: jenkins.jiaxzeng.com-tls
hosts:
- jenkins.jiaxzeng.com
javaOpts: "-Djava.awt.headless=true -Dhudson.model.DownloadService.noSignatureCheck=true"
persistence:
enabled: true
storageClass: ceph-fs-storage
accessMode: ReadWriteMany
size: 8Gi</code>Deploy Jenkins
Install the chart in the
jenkinsnamespace using the prepared values file.
<code>$ helm -n jenkins install jenkins --create-namespace -f /etc/kubernetes/addons/jenkins-values.yaml /etc/kubernetes/addons/jenkins</code>After deployment, retrieve the admin password and access the UI at
https://jenkins.jiaxzeng.com.
Verification
Check resources with
kubectl -n jenkins get sts,pod,service,pvc,ingressand confirm the Jenkins UI loads correctly.
Conclusion
The guide demonstrates how Helm simplifies Jenkins deployment on Kubernetes, improving efficiency and easing future upgrades.
Linux Ops Smart Journey
The operations journey never stops—pursuing excellence endlessly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.