From e21808e017cb7cc15e7ba05f9f5c03a3eb43d914 Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Thu, 1 Mar 2018 00:41:55 -0500 Subject: [PATCH] [stable/traefik] allow use of existing pvc (#3930) --- stable/traefik/Chart.yaml | 2 +- stable/traefik/README.md | 1 + stable/traefik/templates/acme-pvc.yaml | 2 +- stable/traefik/templates/deployment.yaml | 2 +- stable/traefik/values.yaml | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stable/traefik/Chart.yaml b/stable/traefik/Chart.yaml index e7cb7c4d8c..0101581279 100755 --- a/stable/traefik/Chart.yaml +++ b/stable/traefik/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: traefik -version: 1.23.0 +version: 1.24.0 appVersion: 1.5.2 description: A Traefik based Kubernetes ingress controller with Let's Encrypt support keywords: diff --git a/stable/traefik/README.md b/stable/traefik/README.md index 1268d05703..e52cb5f557 100644 --- a/stable/traefik/README.md +++ b/stable/traefik/README.md @@ -117,6 +117,7 @@ The following tables lists the configurable parameters of the Traefik chart and | `acme.persistence.enabled` | Create a volume to store ACME certs (if ACME is enabled) | `true` | | `acme.persistence.storageClass` | Type of `StorageClass` to request-- will be cluster-specific | `nil` (uses alpha storage class annotation) | | `acme.persistence.accessMode` | `ReadWriteOnce` or `ReadOnly` | `ReadWriteOnce` | +| `acme.persistence.existingClaim`| An Existing PVC name | `nil` | | `acme.persistence.size` | Minimum size of the volume requested | `1Gi` | | `dashboard.enabled` | Whether to enable the Traefik dashboard | `false` | | `dashboard.domain` | Domain for the Traefik dashboard | `traefik.example.com` | diff --git a/stable/traefik/templates/acme-pvc.yaml b/stable/traefik/templates/acme-pvc.yaml index 4f128bb6c9..065447471d 100644 --- a/stable/traefik/templates/acme-pvc.yaml +++ b/stable/traefik/templates/acme-pvc.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.acme.enabled .Values.acme.persistence.enabled }} +{{- if and .Values.acme.enabled .Values.acme.persistence.enabled (not .Values.acme.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/stable/traefik/templates/deployment.yaml b/stable/traefik/templates/deployment.yaml index 74f6060896..a458187844 100644 --- a/stable/traefik/templates/deployment.yaml +++ b/stable/traefik/templates/deployment.yaml @@ -129,7 +129,7 @@ spec: - name: acme {{- if .Values.acme.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "traefik.fullname" . }}-acme + claimName: {{ .Values.acme.persistence.existingClaim | default (printf "%s-acme" (include "traefik.fullname" .)) }} {{- else }} emptyDir: {} {{- end }} diff --git a/stable/traefik/values.yaml b/stable/traefik/values.yaml index bc25bcf2a2..66f1d336c2 100644 --- a/stable/traefik/values.yaml +++ b/stable/traefik/values.yaml @@ -136,6 +136,11 @@ acme: # storageClass: "-" accessMode: ReadWriteOnce size: 1Gi + ## A manually managed Persistent Volume Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + ## + # existingClaim: dashboard: enabled: false domain: traefik.example.com