From a7e736febe35f753c8fd3a01b0d1f49b369f0570 Mon Sep 17 00:00:00 2001 From: Rio Kierkels Date: Fri, 1 Dec 2017 22:50:54 +0100 Subject: [PATCH] [stable/minio] Add subpath for /export volume (#2534) * feat(stable/minio): add subpath for /export volume Conditionally adds the subPath for the /export volume mount. Works only if `persistence.enabled` is true and `persistence.subPath` is not empty string. This is handy in cases where the volume plugin doesn't support sub folder mounting. GlusterFS plugin, for example doesn't support it whereas NFS actually does. * docs(stable/minio): add subPath to Configuration table * chore(stable/minio): version bump * chore(stable/minio): another version bump to keep ahead of master --- stable/minio/README.md | 1 + stable/minio/templates/minio_deployment.yaml | 3 +++ stable/minio/templates/minio_statefulset.yaml | 3 +++ stable/minio/values.yaml | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/stable/minio/README.md b/stable/minio/README.md index 7169367bbc..92b84a6251 100644 --- a/stable/minio/README.md +++ b/stable/minio/README.md @@ -89,6 +89,7 @@ The following tables lists the configurable parameters of the Minio chart and th | `persistence.size` | Size of persistent volume claim | `10Gi` | | `persistence.storageClass` | Type of persistent volume claim | `generic` | | `persistence.accessMode` | ReadWriteOnce or ReadOnly | `ReadWriteOnce` | +| `persistence.subPath` | Mount a sub directory of the persistent volume if set | `""` | | `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` | | `nodeSelector` | Node labels for pod assignment | `{}` | | `defaultBucket.enabled` | If true, a bucket will be created after minio diff --git a/stable/minio/templates/minio_deployment.yaml b/stable/minio/templates/minio_deployment.yaml index 0e5dcc0ead..d341be3665 100644 --- a/stable/minio/templates/minio_deployment.yaml +++ b/stable/minio/templates/minio_deployment.yaml @@ -60,6 +60,9 @@ spec: volumeMounts: - name: export mountPath: {{ .Values.mountPath }} + {{- if and .Values.persistence.enabled .Values.persistence.subPath }} + subPath: "{{ .Values.persistence.subPath }}" + {{- end }} - name: minio-server-config mountPath: {{ default "/root/.minio/" .Values.configPath | quote }} - name: podinfo diff --git a/stable/minio/templates/minio_statefulset.yaml b/stable/minio/templates/minio_statefulset.yaml index 8678aee7e0..c7cd39caf6 100644 --- a/stable/minio/templates/minio_statefulset.yaml +++ b/stable/minio/templates/minio_statefulset.yaml @@ -77,6 +77,9 @@ spec: volumeMounts: - name: export mountPath: {{ .Values.mountPath }} + {{- if and .Values.persistence.enabled .Values.persistence.subPath }} + subPath: "{{ .Values.persistence.subPath }}" + {{- end }} - name: minio-server-config mountPath: {{ default "/root/.minio/" .Values.configPath | quote }} - name: podinfo diff --git a/stable/minio/values.yaml b/stable/minio/values.yaml index cffd8c5b8e..08266a3309 100644 --- a/stable/minio/values.yaml +++ b/stable/minio/values.yaml @@ -39,6 +39,11 @@ persistence: accessMode: ReadWriteOnce size: 10Gi + ## If subPath is set mount a sub folder of a volume instead of the root of the volume. + ## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs). + ## + subPath: "" + ## Expose the Minio service to be accessed from outside the cluster (LoadBalancer service). ## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it. ## ref: http://kubernetes.io/docs/user-guide/services/