MinIO 是全球领先的对象存储先锋,以 Apache License v2.0 发布的对象存储服务器,是为云应用和虚拟机而设计的分布式对象存储服务器。在标准硬件上,读/写速度上高达183GB/s和171GB/s。它与 Amazon S3 云存储服务兼容。 它最适用于存储非结构化数据,如照片、视频、日志文件、备份和容器/虚拟机映像。 对象的大小可以从几KB 到最大5TB。
- 对象存储,兼容Amazon S3协议
- 安装运维相对简单,开箱即用
- 后端除了本地文件系统,还支持多种存储系统,目前已经包括 OSS
- 原生支持bucket事件通知机制
- 可通过多节点集群方式,支持一定的高可用和数据容灾
- 有WEB管理界面和CLI,可以用于测试或者管理
- 公开bucket中的数据可以直接通过HTTP获取
MinIO是一个非常轻量的服务,可以很简单的和其他应用的结合,类似 NodeJS, Redis 或者 MySQL。
MinIO支持多种灵活的部署方式,支持Docker Compose、Docker Swam、Kubernetes等,详见官网:https://docs.min.io/docs/minio-deployment-quickstart-guide.html或者https://min.io/download#/linux
standalone模式
apiVersion: v1kind: PersistentVolumemetadata:labels:app: miniorelease: minioname: minionamespace: defaultspec:accessModes:- ReadWriteOncecapacity:storage: 10GivolumeMode: FilesystemhostPath:path: /mnt/minio---apiVersion: v1kind: PersistentVolumeClaimmetadata:# This name uniquely identifies the PVC. Will be used in deployment below.name: minio-pv-claimlabels:app: minio-storage-claimspec:# Read more about access modes here: https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modesaccessModes:- ReadWriteOnceresources:# This is the request for storage. Should be available in the cluster.requests:storage: 10Gi# Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1#storageClassName:---apiVersion: apps/v1kind: Deploymentmetadata:# This name uniquely identifies the Deploymentname: minio-deploymentspec:strategy:type: Recreateselector:matchLabels:app: miniotemplate:metadata:labels:# Label is used as selector in the service.app: miniospec:# Refer to the PVC created earliervolumes:- name: storagepersistentVolumeClaim:# Name of the PVC created earlierclaimName: minio-pv-claimcontainers:- name: minio# Pulls the default MinIO image from Docker Hubimage: minio/minioargs:- server- /storageenv:# MinIO access key and secret key- name: MINIO_ACCESS_KEYvalue: "admin123"- name: MINIO_SECRET_KEYvalue: "admin123"ports:- containerPort: 9000# Mount the volume into the podvolumeMounts:- name: storage # must match the volume name, abovemountPath: "/storage"---apiVersion: v1kind: Servicemetadata:name: minio-servicespec:type: NodePortports:- port: 9000targetPort: 9000protocol: TCPselector:app: minio

由于service采用NodePort类型,通过主机IP:32593访问web
distributed模式
apiVersion: v1
kind: Service
metadata:
name: minio
labels:
app: minio
spec:
clusterIP: None
ports:
- port: 9000
name: minio
selector:
app: minio
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: minio
spec:
serviceName: minio
replicas: 4
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio
env:
- name: MINIO_ACCESS_KEY
value: "admin123"
- name: MINIO_SECRET_KEY
value: "admin123"
image: minio/minio
args:
- server
- http://minio-{0...3}.minio.default.svc.cluster.local/data
ports:
- containerPort: 9000
# These volume mounts are persistent. Each pod in the PetSet
# gets a volume mounted based on this field.
volumeMounts:
- name: data
mountPath: /data
# These are converted to volume claims by the controller
# and mounted at the paths mentioned above.
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
#storageClassName:
---
apiVersion: v1
kind: Service
metadata:
name: minio-service
spec:
type: NodePort
ports:
- port: 9000
targetPort: 9000
protocol: TCP
selector:
app: minio
分布式部署,实例数至少4个,所以需要另外创建4个pv
