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/