Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
add support to minio bootstrap (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
yagonobre authored and Vic Iglesias committed Sep 19, 2017
1 parent 7b169a9 commit 770e28c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 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: Distributed object storage server built for cloud applications and devops.
name: minio
version: 0.2.1
version: 0.3.0
keywords:
- storage
- object-storage
Expand Down
4 changes: 4 additions & 0 deletions stable/minio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ The following tables lists the configurable parameters of the Minio chart and th
| `persistence.storageClass` | Type of persistent volume claim | `generic` |
| `persistence.accessMode` | ReadWriteOnce or ReadOnly | `ReadWriteOnce` |
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
| `defaultBucket.enabled` | If true, a bucket will be created after minio
install | `false` |
| `defaultBucket.name` | Bucket name | `nil` |
| `defaultBucket.policy` | Bucket policy | `download` |

Some of the parameters above map to the env variables defined in the [Minio DockerHub image](https://hub.docker.com/r/minio/minio/).

Expand Down
36 changes: 36 additions & 0 deletions stable/minio/templates/post-install-create-bucket-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.defaultBucket.enabled }}
apiVersion: v1
kind: Pod
metadata:
name: {{ template "fullname" . }}-create-bucket
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
"helm.sh/hook": post-install
spec:
restartPolicy: OnFailure
containers:
- name: minio-mc
image: minio/mc
command: ["/bin/sh", "-c",
"/usr/bin/mc config host add myminio http://$MINIO_ENDPOINT:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY;
/usr/bin/mc rm -r --force myminio/{{ .Values.defaultBucket.name }};
/usr/bin/mc mb myminio/{{ .Values.defaultBucket.name }};
/usr/bin/mc policy {{ .Values.defaultBucket.policy }} myminio/{{ .Values.defaultBucket.name }};"]
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
key: accesskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
key: secretkey
- name: MINIO_ENDPOINT
value: {{ template "fullname" . }}-svc
{{- end }}
11 changes: 10 additions & 1 deletion stable/minio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ resources:
memory: 256Mi
cpu: 250m

## Below settings can be used to setup event notifications as explained here.

## Create a bucket after minio install
##
defaultBucket:
enabled: false
## If enabled, must be a string with length > 0
# name: example
## Can be one of none|download|upload|public
# policy: download

## https://docs.minio.io/docs/minio-bucket-notification-guide
##
minioConfig:
Expand Down

0 comments on commit 770e28c

Please sign in to comment.