mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
Minio Chart (#280)
* Basic Minio Chart - Single export with a default Access Key and Secret * Fix keywords * Fixed incorrect secret name * Added namespace to portforwarding in NOTES.txt
This commit is contained in:
committed by
Lachlan Evenson
parent
b5f8eed78a
commit
bb72a124eb
@@ -0,0 +1,21 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
description: A Minio Helm chart for Kubernetes
|
||||
name: minio
|
||||
version: 0.0.1
|
||||
keywords:
|
||||
- storage
|
||||
- object-storage
|
||||
- S3
|
||||
home: https://minio.io
|
||||
sources:
|
||||
- https://github.com/minio/minio
|
||||
maintainers:
|
||||
- name: Acaleph
|
||||
email: hello@acale.ph
|
||||
@@ -0,0 +1,94 @@
|
||||
Minio
|
||||
=====
|
||||
|
||||
[Minio](https://minio.io) is a distributed S3-compatible object storage server built for cloud applications and devops.
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This chart bootstraps a single node Minio deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
- Kubernetes 1.4+ with Beta APIs enabled
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
Installing the Chart
|
||||
--------------------
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```bash
|
||||
$ helm install --name my-release stable/minio
|
||||
```
|
||||
|
||||
The command deploys Minio on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
|
||||
|
||||
By default a pre-generated Access Key and Secret will be used. If you'd like to set your own password change the AccessKey and SecretKey in the values.yaml.
|
||||
|
||||
Uninstalling the Chart
|
||||
----------------------
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```bash
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
The following tables lists the configurable parameters of the Minio chart and their default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|----------------------------|-------------------------------------|---------------------------------------------------------|
|
||||
| `image` | `minio` image. | `minio/minio` The official release on Docker Hub |
|
||||
| `imageTag` | `minio` image tag. | The latest release |
|
||||
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
|
||||
| `ServiceType` | Kubernetes Service Type | `ClusterIP` |
|
||||
| `ServicePort` | Kuberntes Service Port | `9000` |
|
||||
| `AccessKey` | Default Access Key | `AKIAIOSFODNN7EXAMPLE` |
|
||||
| `SecretKey` | Default Secret Key | `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` |
|
||||
| `persistence.enabled` | Create a volume to store data | true |
|
||||
| `persistence.size` | Size of persistent volume claim | 8Gi RW |
|
||||
| `persistence.storageClass` | Type of persistent volume claim | generic |
|
||||
| `persistence.accessMode` | ReadWriteOnce or ReadOnly | ReadWriteOnce |
|
||||
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
|
||||
|
||||
Some of the parameters above map to the env variables defined in the [Minio DockerHub image](https://hub.docker.com/r/minio/minio/).
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```bash
|
||||
$ helm install --name my-release \
|
||||
--set AccessKey=myaccesskey,SecretKey=mysecretkey \
|
||||
stable/minio
|
||||
```
|
||||
|
||||
The above command sets the Minio Access Key to `myaccesskey` and Secret Key to `mysecretkey`.
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```bash
|
||||
$ helm install --name my-release -f values.yaml stable/minio
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
Persistence
|
||||
-----------
|
||||
|
||||
The [Minio](https://hub.docker.com/r/minio/minio/) image stores the Minio data at the `/export` path of the container.
|
||||
|
||||
By default a PersistentVolumeClaim is created and mounted into that directory. In order to disable this functionality you can change the values.yaml to disable persistence and use an emptyDir instead.
|
||||
|
||||
> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*
|
||||
|
||||
TODO:
|
||||
-----
|
||||
|
||||
- Erasure encoding and distributed server
|
||||
- Configmap for the Minio config
|
||||
@@ -0,0 +1,14 @@
|
||||
Minio can be accessed via port {{ .Values.ServicePort }} on the following DNS name from within your cluster:
|
||||
{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
To connect to minio:
|
||||
|
||||
1. Download the Minio mc client - https://docs.minio.io/docs/minio-client-quickstart-guide
|
||||
|
||||
2. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
|
||||
3. kubectl port-forward $POD_NAME 9000 --namespace {{ .Release.Namespace }}
|
||||
|
||||
4. mc config host add {{ template "fullname" . }}-local http://localhost:9000 {{ .Values.AccessKey }} {{ .Values.SecretKey }} S3v4
|
||||
|
||||
5. mc ls {{ template "fullname" . }}-local
|
||||
@@ -0,0 +1,16 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "fullname" -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
|
||||
{{- end -}}s
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "fullname" . }}
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
volumes:
|
||||
- name: export
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ template "fullname" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: minio-user
|
||||
secret:
|
||||
secretName: {{ template "fullname" . }}-user
|
||||
containers:
|
||||
- name: minio
|
||||
image: {{ .Values.Image }}:{{ .Values.ImageTag }}
|
||||
imagePullPolicy: {{ .Values.ImagePullPolicy }}
|
||||
args:
|
||||
- server
|
||||
- /export
|
||||
volumeMounts:
|
||||
- name: export
|
||||
mountPath: /export
|
||||
ports:
|
||||
- name: service
|
||||
containerPort: 9000
|
||||
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
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: 9000
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 12 }}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if .Values.persistence.enabled }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}
|
||||
annotations:
|
||||
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}-user
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
type: Opaque
|
||||
data:
|
||||
accesskey: {{ .Values.AccessKey | b64enc }}
|
||||
secretkey: {{ .Values.SecretKey | b64enc }}
|
||||
@@ -0,0 +1,16 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
selector:
|
||||
app: {{ template "fullname" . }}
|
||||
ports:
|
||||
- name: service
|
||||
port: 9000
|
||||
targetPort: {{ .Values.ServicePort }}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
Image: "minio/minio"
|
||||
ImageTag: "latest"
|
||||
ImagePullPolicy: "Always"
|
||||
|
||||
ServiceType: ClusterIP
|
||||
ServicePort: 9000
|
||||
|
||||
## Set default access key and secret
|
||||
AccessKey: "AKIAIOSFODNN7EXAMPLE"
|
||||
SecretKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
|
||||
|
||||
## Enable persistence using Persistent Volume Claims
|
||||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: generic
|
||||
accessMode: ReadWriteOnce
|
||||
size: 8Gi
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
Reference in New Issue
Block a user