diff --git a/charts/jenkins/CHANGELOG.md b/charts/jenkins/CHANGELOG.md index 05357d370..1faae3698 100644 --- a/charts/jenkins/CHANGELOG.md +++ b/charts/jenkins/CHANGELOG.md @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0. The changelog until v1.5.7 was auto-generated based on git commits. Those entries include a reference to the git commit to be able to get more details. +## 4.5.0 + +Added `.Values.persistence.dataSource` to allow cloning home PVC from existing dataSource. + ## 4.4.2 Update Jenkins image and appVersion to jenkins lts release version 2.401.3 diff --git a/charts/jenkins/Chart.yaml b/charts/jenkins/Chart.yaml index f53aa4616..1ef6211f1 100644 --- a/charts/jenkins/Chart.yaml +++ b/charts/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: jenkins home: https://jenkins.io/ -version: 4.4.2 +version: 4.5.0 appVersion: 2.401.3 description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. sources: diff --git a/charts/jenkins/VALUES_SUMMARY.md b/charts/jenkins/VALUES_SUMMARY.md index 31b900cb3..f11b13ae8 100644 --- a/charts/jenkins/VALUES_SUMMARY.md +++ b/charts/jenkins/VALUES_SUMMARY.md @@ -358,18 +358,19 @@ The following tables list the configurable parameters of the Jenkins chart and t ### Persistence -| Parameter | Description | Default | -| --------------------------- | ------------------------------- | --------------- | -| `persistence.enabled` | Enable the use of a Jenkins PVC | `true` | -| `persistence.existingClaim` | Provide the name of a PVC | `nil` | -| `persistence.storageClass` | Storage class for the PVC | `nil` | -| `persistence.annotations` | Annotations for the PVC | `{}` | -| `persistence.labels` | Labels for the PVC | `{}` | -| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` | -| `persistence.size` | The size of the PVC | `8Gi` | -| `persistence.subPath` | SubPath for jenkins-home mount | `nil` | -| `persistence.volumes` | Additional volumes | `nil` | -| `persistence.mounts` | Additional mounts | `nil` | +| Parameter | Description | Default | +| --------------------------- | -------------------------------------- | --------------- | +| `persistence.enabled` | Enable the use of a Jenkins PVC | `true` | +| `persistence.existingClaim` | Provide the name of a PVC | `nil` | +| `persistence.storageClass` | Storage class for the PVC | `nil` | +| `persistence.annotations` | Annotations for the PVC | `{}` | +| `persistence.labels` | Labels for the PVC | `{}` | +| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` | +| `persistence.size` | The size of the PVC | `8Gi` | +| `persistence.dataSource` | Existing data source to clone PVC from | `nil` | +| `persistence.subPath` | SubPath for jenkins-home mount | `nil` | +| `persistence.volumes` | Additional volumes | `nil` | +| `persistence.mounts` | Additional mounts | `nil` | ### Backup diff --git a/charts/jenkins/templates/home-pvc.yaml b/charts/jenkins/templates/home-pvc.yaml index af17f7c17..f417d23ad 100644 --- a/charts/jenkins/templates/home-pvc.yaml +++ b/charts/jenkins/templates/home-pvc.yaml @@ -21,6 +21,10 @@ metadata: {{ toYaml .Values.persistence.labels | indent 4 }} {{- end }} spec: +{{- if .Values.persistence.dataSource }} + dataSource: +{{ toYaml .Values.persistence.dataSource | indent 4 }} +{{- end }} accessModes: - {{ .Values.persistence.accessMode | quote }} resources: diff --git a/charts/jenkins/unittests/home-pvc-test.yaml b/charts/jenkins/unittests/home-pvc-test.yaml index 1ad52e566..144552436 100644 --- a/charts/jenkins/unittests/home-pvc-test.yaml +++ b/charts/jenkins/unittests/home-pvc-test.yaml @@ -30,6 +30,8 @@ tests: path: spec.resources.requests value: storage: 8Gi + - isNull: + path: spec.dataSource - isNull: path: spec.storageClassName @@ -92,3 +94,18 @@ tests: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: jenkins test-label: test-value + + - it: clone from dataSource + set: + persistence: + dataSource: + name: PVC-NAME + kind: PersistentVolumeClaim + asserts: + - equal: + path: spec.dataSource.name + value: PVC-NAME + - equal: + path: spec.dataSource.kind + value: PersistentVolumeClaim + diff --git a/charts/jenkins/values.yaml b/charts/jenkins/values.yaml index d6b72efb1..01ae146d7 100644 --- a/charts/jenkins/values.yaml +++ b/charts/jenkins/values.yaml @@ -850,6 +850,11 @@ persistence: labels: {} accessMode: "ReadWriteOnce" size: "8Gi" + # Existing data source to clone PVC from + # ref: https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/ + dataSource: + # name: PVC-NAME + # kind: PersistentVolumeClaim volumes: # - name: nothing # emptyDir: {}