From 1ab586c137106353ce5b5cbdbfdc70f3f610bd77 Mon Sep 17 00:00:00 2001 From: vtuson Date: Thu, 26 Apr 2018 16:30:03 +0200 Subject: [PATCH] support for an existing PVC (#5265) --- stable/wordpress/Chart.yaml | 2 +- stable/wordpress/README.md | 1 + stable/wordpress/templates/deployment.yaml | 2 +- stable/wordpress/templates/pvc.yaml | 2 +- stable/wordpress/values.yaml | 4 ++++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stable/wordpress/Chart.yaml b/stable/wordpress/Chart.yaml index 79e886a4fa..283e37e877 100644 --- a/stable/wordpress/Chart.yaml +++ b/stable/wordpress/Chart.yaml @@ -1,5 +1,5 @@ name: wordpress -version: 1.0.4 +version: 1.0.5 appVersion: 4.9.5 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/stable/wordpress/README.md b/stable/wordpress/README.md index 7d37f1eb81..395f9b3880 100644 --- a/stable/wordpress/README.md +++ b/stable/wordpress/README.md @@ -90,6 +90,7 @@ The following table lists the configurable parameters of the WordPress chart and | `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | | `ingress.secrets[0].key` | TLS Secret Key | `nil` | | `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.existingClaim` | Enable persistence using an existing PVC | `nil` | | `persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` | | `persistence.size` | PVC Storage Request | `10Gi` | diff --git a/stable/wordpress/templates/deployment.yaml b/stable/wordpress/templates/deployment.yaml index 7e376b3a62..39ae20db6c 100644 --- a/stable/wordpress/templates/deployment.yaml +++ b/stable/wordpress/templates/deployment.yaml @@ -138,7 +138,7 @@ spec: - name: wordpress-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }} + claimName: {{ .Values.persistence.existingClaim | default (include "fullname" .) }} {{- else }} emptyDir: {} {{ end }} diff --git a/stable/wordpress/templates/pvc.yaml b/stable/wordpress/templates/pvc.yaml index 99c8268119..b3f9124805 100644 --- a/stable/wordpress/templates/pvc.yaml +++ b/stable/wordpress/templates/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/wordpress/values.yaml b/stable/wordpress/values.yaml index 9ef9cfc097..1df8164528 100644 --- a/stable/wordpress/values.yaml +++ b/stable/wordpress/values.yaml @@ -222,6 +222,10 @@ persistence: ## GKE, AWS & OpenStack) ## # storageClass: "-" + ## + ## If you want to reuse an existing claim, you can pass the name of the PVC using + ## the existingClaim variable + # existingClaim: your-claim accessMode: ReadWriteOnce size: 10Gi