diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index 4ea0227d6a..3fa688b57d 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,6 +1,6 @@ name: jenkins home: https://jenkins.io/ -version: 0.1.15 +version: 0.2.0 description: Open source continuous integration server. It supports multiple SCM tools including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based projects as well as arbitrary scripts. sources: - https://github.com/jenkinsci/jenkins diff --git a/stable/jenkins/README.md b/stable/jenkins/README.md index 6ca15d9a8a..0db9c19afa 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -67,11 +67,33 @@ $ helm install --name my-release -f values.yaml stable/jenkins ## Persistence -The Jenkins image stores persistence under `/var/jenkins_home` path of the container. A Persistent Volume -Claim is used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +The Jenkins image stores persistence under `/var/jenkins_home` path of the container. A dynamically managed Persistent Volume +Claim is used to keep the data across deployments, by default. This is known to work in GCE, AWS, and minikube. Alternatively, +a previously configured Persistent Volume Claim can be used. It is possible to mount several volumes using `Persistence.volumes` and `Persistence.mounts` parameters. +### Persistence Values + +| Parameter | Description | Default | +| --------- | ----------- | ------- | +| `Persistence.Enabled` | Enable the use of a Jenkins PVC | `true` | +| `Persistence.ExistingClaim` | Provide the name of a PVC | `nil` | +| `Persistence.AccessMode` | The PVC access mode | `ReadWriteOnce` | +| `Persistence.Size` | The size of the PVC | `8Gi` | +| `Persistence.volumes` | Additional volumes | `nil` | +| `Persistence.mounts` | Additional mounts | `nil` | + + +#### Existing PersistentVolumeClaim + +1. Create the PersistentVolume +1. Create the PersistentVolumeClaim +1. Install the chart +```bash +$ helm install --name my-release --set Persistence.ExistingClaim=PVC_NAME stable/jenkins +``` + ## Custom ConfigMap When creating a new chart with this chart as a dependency, CustomConfigMap can be used to override the default config.xml provided. diff --git a/stable/jenkins/templates/home-pvc.yaml b/stable/jenkins/templates/home-pvc.yaml index 15cbaec0fe..5ffb9bdcf5 100644 --- a/stable/jenkins/templates/home-pvc.yaml +++ b/stable/jenkins/templates/home-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.Persistence.Enabled }} +{{- if and .Values.Persistence.Enabled (not .Values.Persistence.ExistingClaim) -}} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/stable/jenkins/templates/jenkins-master-deployment.yaml b/stable/jenkins/templates/jenkins-master-deployment.yaml index 8e0af3e94d..51832a3b5e 100644 --- a/stable/jenkins/templates/jenkins-master-deployment.yaml +++ b/stable/jenkins/templates/jenkins-master-deployment.yaml @@ -96,7 +96,7 @@ spec: - name: jenkins-home {{- if .Values.Persistence.Enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }} + claimName: {{ .Values.Persistence.ExistingClaim | default (include "fullname" .) }} {{- else }} emptyDir: {} {{- end -}} diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index a5d8966444..d611f5f5ce 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -47,6 +47,11 @@ Agent: Persistence: Enabled: true + ## A manually managed Persistent Volume and Claim + ## Requires Persistence.Enabled: true + ## If defined, PVC must be created manually before volume will be bound + # ExistingClaim: + ## If defined, volume.beta.kubernetes.io/storage-class: ## Default: volume.alpha.kubernetes.io/storage-class: default ##