From c02becfca058c5410fecdae40248292ecf67ac23 Mon Sep 17 00:00:00 2001 From: Matt McNaughton Date: Fri, 25 May 2018 07:02:32 -0400 Subject: [PATCH] [stable/minio] Fix minio cannot create bucket (#5658) Running `helm install --set "accessKey=$minioaccesskey,secretKey=$miniosecretaccesskey,defaultBucket.enabled=true,defaultBucket.name=$minio_bucket_name,defaultBucket.purge=true" ./minio` was failing with a `can't open '/config/initialize'` error message. The `/config/initialize` script is the entrypoint for the `post-install-create-bucket-job`. The `initialize` script comes from the `minio` configmap. This `configmap` was deleted in https://github.com/kubernetes/charts/pull/4277, because it also included the `config.json`. Mounting the `config.json` was causing issues with `minio` because Kubernetes switched to having all `ConfigMap` mounts be readonly. However, there is no issue with the `/config/initialize` script being read only, so I added back the `configmap` with just the `initialize` data. I verified that the above `helm install` command works does not result in a crash loop. --- stable/minio/Chart.yaml | 2 +- stable/minio/templates/configmap.yaml | 12 ++++++++++++ .../templates/post-install-create-bucket-job.yaml | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 stable/minio/templates/configmap.yaml diff --git a/stable/minio/Chart.yaml b/stable/minio/Chart.yaml index 1e5de9fc3f..d51eb68526 100755 --- a/stable/minio/Chart.yaml +++ b/stable/minio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Distributed object storage server built for cloud applications and devops. name: minio -version: 1.3.2 +version: 1.3.3 appVersion: RELEASE.2018-04-27T23-33-52Z keywords: - storage diff --git a/stable/minio/templates/configmap.yaml b/stable/minio/templates/configmap.yaml new file mode 100644 index 0000000000..cb11fcd7dd --- /dev/null +++ b/stable/minio/templates/configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "minio.fullname" . }} + labels: + app: {{ template "minio.name" . }} + chart: {{ template "minio.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + initialize: |- +{{ include (print $.Template.BasePath "/_helper_create_bucket.txt") . | indent 4 }} diff --git a/stable/minio/templates/post-install-create-bucket-job.yaml b/stable/minio/templates/post-install-create-bucket-job.yaml index 61d0980830..b0b9cd3785 100644 --- a/stable/minio/templates/post-install-create-bucket-job.yaml +++ b/stable/minio/templates/post-install-create-bucket-job.yaml @@ -27,6 +27,8 @@ spec: - name: minio-configuration projected: sources: + - configMap: + name: {{ template "minio.fullname" . }} - secret: name: {{ template "minio.fullname" . }} containers: