Skip to content

Jenkins persistent volume configuration

By default, the Jenkins Helm chart persists data stored under the /var/jenkins_home directory within the container.^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md]

Configuration

The chart uses a dynamically managed Persistent Volume Claim (PVC) to retain data across deployments^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md]. This default configuration is compatible with cloud providers like GCE and AWS, as well as local environments like minikube^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].

Using an Existing Claim

To attach a pre-existing Persistent Volume Claim, set persistence.existingClaim to the name of your PVC during installation^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].

Storage Class

The storage class can be customized by setting persistence.storageClass^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].

  • Custom Class: Set the value to the specific storage class name (e.g., [customStorageClass])^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].
  • Dynamic Provisioning: Set to - (dash) to disable dynamic provisioning^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].
  • Default: If set to null or left undefined, the cluster's default provisioner is used (e.g., gp2 on AWS, standard on GKE)^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].

Troubleshooting

Volume Mount Performance

Certain volume types and filesystem formats may experience long attach or mount times (10+ minutes) due to fsGroup usage^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md]. This issue can manifest as FailedMount warnings in the Pod event history^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md].

To resolve this, you can replace fsGroup with supplementalGroups by overriding the Pod's security context^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md]. Set the controller.podSecurityContextOverride value as follows^[400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md]:

controller:
  podSecurityContextOverride:
    runAsNonRoot: true
    runAsUser: 1000
    supplementalGroups: [1000]

Sources

  • 400-devops__06-Kubernetes__devops-helm__helm-jenkins__README.md