From 1bd7eb979c79359129661e051d0c46d661836ada Mon Sep 17 00:00:00 2001 From: Elson Rodriguez Date: Fri, 27 Apr 2018 08:28:23 -0700 Subject: [PATCH] Add example on how to deploy minio without a backing store. (#5810) Many on-premise clusters do not have a PV abstraction, this example shows a way to deploy minio effectively in such environments. --- docs/orchestration/kubernetes-yaml/README.md | 32 ++++++++++++- .../minio-distributed-daemonset.yaml | 45 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 docs/orchestration/kubernetes-yaml/minio-distributed-daemonset.yaml diff --git a/docs/orchestration/kubernetes-yaml/README.md b/docs/orchestration/kubernetes-yaml/README.md index 270483042..b287c1c74 100644 --- a/docs/orchestration/kubernetes-yaml/README.md +++ b/docs/orchestration/kubernetes-yaml/README.md @@ -17,6 +17,7 @@ - [Create Minio Statefulset](#create-minio-statefulset) - [Create LoadBalancer Service](#create-minio-service) - [Update existing Minio StatefulSet](#update-existing-minio-statefulset) + - [Deploying on cluster nodes with local host path](#deploying-on-cluster-nodes-with-local-host-path) - [Resource cleanup](#distributed-resource-cleanup) - [Minio GCS Gateway Deployment](#minio-gcs-gateway-deployment) @@ -408,6 +409,35 @@ kubectl delete statefulset minio \ && kubectl delete svc minio-service ``` +### Deploying on cluster nodes with local host path + +If your cluster does not have a storage solution or PV abstraction, you must explicitly define what nodes you wish to run Minio on, and define a homogeneous path to a local fast block device available on every host. + +This must be changed in the example daemonset: [minio-distributed-daemonset.yaml](minio-distributed-daemonset.yaml) + +Specifically the hostpath: +```yaml + hostPath: + path: /data/minio/ +``` + +And the list of hosts: +```yaml + - http://hostname1:9000/data/minio + - http://hostname2:9000/data/minio + - http://hostname3:9000/data/minio + - http://hostname4:9000/data/minio +``` + +Once deployed, tag the defined host with the `minio-server=true` label: + +```bash +kubectl label node hostname1 -l minio-server=true +kubectl label node hostname2 -l minio-server=true +kubectl label node hostname3 -l minio-server=true +kubectl label node hostname4 -l minio-server=true +``` + ## Minio GCS Gateway Deployment The following section describes the process to deploy [Minio](https://minio.io/) GCS Gateway on Kubernetes. The deployment uses the [official Minio Docker image](https://hub.docker.com/r/minio/minio/~/dockerfile/) from Docker Hub. @@ -570,4 +600,4 @@ You can cleanup the cluster using ```sh kubectl delete deployment minio-deployment \ && kubectl delete secret gcs-credentials -``` \ No newline at end of file +``` diff --git a/docs/orchestration/kubernetes-yaml/minio-distributed-daemonset.yaml b/docs/orchestration/kubernetes-yaml/minio-distributed-daemonset.yaml new file mode 100644 index 000000000..268cb5dab --- /dev/null +++ b/docs/orchestration/kubernetes-yaml/minio-distributed-daemonset.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: minio + labels: + app: minio +spec: + selector: + matchLabels: + app: minio + template: + metadata: + labels: + app: minio + spec: + # We only deploy minio to the specified nodes. select your nodes by using `kubectl label node hostname1 -l minio-server=true` + nodeSelector: + minio-server: "true" + # This is to maximize network performance, the headless service can be used to connect to a random host. + hostNetwork: true + # We're just using a hostpath. This path must be the same on all servers, and should be the largest, fastest block device you can fit. + volumes: + - name: storage + hostPath: + path: /data/minio/ + containers: + - name: minio + env: + - name: MINIO_ACCESS_KEY + value: "minio" + - name: MINIO_SECRET_KEY + value: "minio123" + image: minio/minio:RELEASE.2018-04-04T05-20-54Z + # Unfortunately you must manually define each server. Perhaps autodiscovery via DNS can be implemented in the future. + args: + - server + - http://hostname1:9000/data/minio + - http://hostname2:9000/data/minio + - http://hostname3:9000/data/minio + - http://hostname4:9000/data/minio + ports: + - containerPort: 9000 + volumeMounts: + - name: storage + mountPath: /data/minio/