Skip to content

Commit

Permalink
[stable/minio] Decouple directory root from the mountPath
Browse files Browse the repository at this point in the history
Introduce a new variable named `.Values.bucketRoot` which defaults to
`.Values.mountPath` if unset.

This allows the Helm chart to serve only a subset of the mounted drive,
which can be useful if the mounted data contains symlinks to locations
that should not be accessible directly through minio.

Addresses helm#19939

Signed-off-by: gzur <gzur@gzur.org>
  • Loading branch information
gzur committed Jan 8, 2020
1 parent 492aed9 commit b18b8fe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/minio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: MinIO is a high performance data infrastructure for machine learning, analytics and application data workloads.
name: minio
version: 5.0.2
version: 5.0.3
appVersion: master
keywords:
- storage
Expand Down
1 change: 1 addition & 0 deletions stable/minio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ The following table lists the configurable parameters of the MinIO chart and the
| `certsPath` | Default certs path location | `/etc/minio/certs` |
| `configPathmc` | Default config file location for MinIO client - mc | `/etc/minio/mc` |
| `mountPath` | Default mount location for persistent drive | `/export` |
| `bucketRoot` | Directory from where minio should serve buckets. | Value of `.mountPath` |
| `clusterDomain` | domain name of kubernetes cluster where pod is running. | `cluster.local` |
| `service.type` | Kubernetes service type | `ClusterIP` |
| `service.port` | Kubernetes port where service is exposed | `9000` |
Expand Down
5 changes: 3 additions & 2 deletions stable/minio/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if eq .Values.mode "standalone" }}
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
apiVersion: {{ template "minio.deployment.apiVersion" . }}
kind: Deployment
metadata:
Expand Down Expand Up @@ -91,7 +92,7 @@ spec:
{{- if .Values.nasgateway.enabled }}
command: [ "/bin/sh",
"-ce",
"/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} gateway nas {{ .Values.mountPath }}" ]
"/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} gateway nas {{ $bucketRoot }}" ]
{{- else }}
{{- if .Values.b2gateway.enabled }}
command: [ "/bin/sh",
Expand All @@ -100,7 +101,7 @@ spec:
{{- else }}
command: [ "/bin/sh",
"-ce",
"/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} server {{ .Values.mountPath }}" ]
"/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} server {{ $bucketRoot }}" ]
{{- end }}
{{- end }}
{{- end }}
Expand Down
3 changes: 2 additions & 1 deletion stable/minio/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{{ $scheme := "https" }}
{{ end }}
{{ $mountPath := .Values.mountPath }}
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
{{ $subPath := .Values.persistence.subPath }}
{{ $penabled := .Values.persistence.enabled }}
{{ $accessMode := .Values.persistence.accessMode }}
Expand Down Expand Up @@ -81,7 +82,7 @@ spec:
- name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [ "/bin/sh", "-ce", "/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} server {{- range $i := until $zoneCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $.Values.mountPath }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{else}}{{ $.Values.mountPath }}{{end}}{{- end}}" ]
command: [ "/bin/sh", "-ce", "/usr/bin/docker-entrypoint.sh minio -S {{ .Values.certsPath }} server {{- range $i := until $zoneCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{else}}{{ $bucketRoot }}{{end}}{{- end}}" ]
{{- if .Values.extraArgs }}
args:
{{ toYaml .Values.extraArgs | indent 12 }}
Expand Down
5 changes: 5 additions & 0 deletions stable/minio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ certsPath: "/etc/minio/certs/"
configPathmc: "/etc/minio/mc/"
mountPath: "/export"

## Override the root directory which the minio server should serve from.
## If left empty, it defaults to the value of {{ .Values.mountPath }}
## If defined, it must be a sub-directory of the path specified in {{ .Values.mountPath }}
bucketRoot: ""

# Number of drives attached to a node
drivesPerNode: 1
# Number of MinIO containers running
Expand Down

0 comments on commit b18b8fe

Please sign in to comment.