Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Add health probe for minio (#361)
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Zeng <[email protected]>

Signed-off-by: Edward Zeng <[email protected]>
  • Loading branch information
LoveEachDay authored Aug 26, 2022
1 parent ff30f46 commit 04712f9
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 6 deletions.
6 changes: 3 additions & 3 deletions charts/minio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: High Performance, Kubernetes Native Object Storage
name: minio
version: 8.0.13
version: 8.0.14
appVersion: master
keywords:
- storage
Expand All @@ -12,5 +12,5 @@ icon: https://min.io/resources/img/logo/MINIO_wordmark.png
sources:
- https://github.com/minio/minio
maintainers:
- name: jeffoverflow
email: dev@minio.io
- name: contact
email: contact@milvus.io
6 changes: 3 additions & 3 deletions charts/minio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ The following table lists the configurable parameters of the MinIO chart and the
| `gcsgateway.enabled` | Use MinIO as a Google Cloud Storage gateway | `false` |
| `gcsgateway.gcsKeyJson` | credential json file of service account key | `""` |
| `gcsgateway.projectId` | Google cloud project id | `""` |
| `nasgateway.enabled` | Use MinIO as a [NAS gateway](https://docs.MinIO.io/docs/minio-gateway-for-nas) | `false` |
| `nasgateway.enabled` | Use MinIO as a NAS gateway | `false`
| `nasgateway.replicas` | Number of NAS gateway instances to be run in parallel on a PV | `4` |
| `environment` | Set MinIO server relevant environment variables in `values.yaml` file. MinIO containers will be passed these variables when they start. | `MINIO_STORAGE_CLASS_STANDARD: EC:4"` |
| `metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` |
Expand Down Expand Up @@ -290,12 +290,12 @@ NAS Gateway

### Prerequisites

MinIO in [NAS gateway mode](https://docs.minio.io/docs/minio-gateway-for-nas) can be used to create multiple MinIO instances backed by single PV in `ReadWriteMany` mode. Currently few [Kubernetes volume plugins](https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes) support `ReadWriteMany` mode. To deploy MinIO NAS gateway with Helm chart you'll need to have a Persistent Volume running with one of the supported volume plugins. [This document](https://kubernetes.io/docs/user-guide/volumes/#nfs)
MinIO in NAS gateway mode can be used to create multiple MinIO instances backed by single PV in `ReadWriteMany` mode. Currently few [Kubernetes volume plugins](https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes) support `ReadWriteMany` mode. To deploy MinIO NAS gateway with Helm chart you'll need to have a Persistent Volume running with one of the supported volume plugins. [This document](https://kubernetes.io/docs/user-guide/volumes/#nfs)
outlines steps to create a NFS PV in Kubernetes cluster.

### Provision NAS Gateway MinIO instances

To provision MinIO servers in [NAS gateway mode](https://docs.minio.io/docs/minio-gateway-for-nas), set the `nasgateway.enabled` field to `true`,
To provision MinIO servers in NAS gateway mode, set the `nasgateway.enabled` field to `true`,

```bash
$ helm install --set nasgateway.enabled=true minio/minio
Expand Down
32 changes: 32 additions & 0 deletions charts/minio/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,38 @@ spec:
ports:
- name: {{ $scheme }}
containerPort: 9000
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /minio/health/live
port: {{ $scheme }}
scheme: {{ $scheme | upper }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
tcpSocket:
port: {{ $scheme }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
tcpSocket:
port: {{ $scheme }}
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
{{- end }}
env:
- name: MINIO_ACCESS_KEY
valueFrom:
Expand Down
32 changes: 32 additions & 0 deletions charts/minio/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,38 @@ spec:
ports:
- name: {{ $scheme }}
containerPort: 9000
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /minio/health/live
port: {{ $scheme }}
scheme: {{ $scheme | upper }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
tcpSocket:
port: {{ $scheme }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
tcpSocket:
port: {{ $scheme }}
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
{{- end }}
env:
- name: MINIO_ACCESS_KEY
valueFrom:
Expand Down
25 changes: 25 additions & 0 deletions charts/minio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,28 @@ etcd:
corednsPathPrefix: ""
clientCert: ""
clientCertKey: ""

## Configure extra options for liveness probe
livenessProbe:
enabled: true
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
## Configure extra options for readiness probe
readinessProbe:
enabled: true
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 5
## Configure extra options for startupProbe probe
startupProbe:
enabled: true
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 60

0 comments on commit 04712f9

Please sign in to comment.