说明
minio(AIStor)社区闭源版。单节点,每节点双驱动器。注意,社区版,最新免费版本,最高配置仅支持单节点,每节点双驱动器。其他功能都是付费版才能使用。
综合来说,若是商用,推荐选付费版。若是开发测试,推荐旧版。完全没必要用阉割的新版做完整测试。
申请license
访问https://www.min.io/pricing申请免费license。
配置namesapce
kubectl create namespace aistor配置license
kubectl-naistor create secret generic aistor-minio-license --from-file=minio.license=./minio.license修改配置文件
---# ==============================================# 2. Secret: 管理员账号密码(替代明文环境变量)# 生成命令示例:# echo -n "你的管理员账号" | base64# echo -n "你的强密码" | base64# 注意:必须加 -n 避免换行符导致密码错误# ==============================================apiVersion: v1 kind: Secret metadata: name: aistor-minio-credentials namespace: aistor type: Opaque data:# 替换为 base64 编码后的账号,默认示例为 minioadminroot-user:"bWluaW9hZG1pbg=="# 替换为 base64 编码后的密码,默认示例为 minioadminroot-password:"bWluaW9hZG1pbg=="---# ==============================================# 2. ConfigMap: 存储证书目录内容(可选)# 若证书含私钥,建议合并到上方Secret中# ==============================================apiVersion: v1 kind: ConfigMap metadata: name: aistor-minio-certs namespace: aistor data:{}# 示例证书格式:# public.crt: |# -----BEGIN CERTIFICATE-----# ...# -----END CERTIFICATE-----# private.key: |# -----BEGIN PRIVATE KEY-----# ...# -----END PRIVATE KEY--------# ==============================================# 3. Headless Service: StatefulSet 内部 DNS 发现# 用于 MinIO 分布式节点间互相通信# ==============================================apiVersion: v1 kind: Service metadata: name: aistor-minio-hl namespace: aistor labels: app: aistor-minio spec: clusterIP: None selector: app: aistor-minio ports: - name: api port:9000targetPort:9000- name: console port:9001targetPort:9001---# ==============================================# 4. NodePort Service: 对外暴露服务# ==============================================apiVersion: v1 kind: Service metadata: name: aistor-minio-nodeport namespace: aistor labels: app: aistor-minio spec: type: NodePort selector: app: aistor-minio ports: - name: api port:9000targetPort:9000# nodePort: 30000 # API 对外端口,范围 30000-32767- name: console port:9001targetPort:9001# nodePort: 30001 # 控制台对外端口,范围 30000-32767---# ==============================================# 5. StatefulSet: 免费版最高配置只能选单节点双驱动器# ==============================================apiVersion: apps/v1 kind: StatefulSet metadata: name: aistor-minio namespace: aistor labels: app: aistor-minio spec: serviceName: aistor-minio-hl# 关键:免费license仅支持单节点,副本数固定为1replicas:1selector: matchLabels: app: aistor-minio template: metadata: labels: app: aistor-minio spec: terminationGracePeriodSeconds:60containers: - name: minio image: quay.io/minio/aistor/minio:latest# 单节点多驱动器模式:直接列出本地数据目录,不使用分布式http地址command: - minio - server - /mnt/data-0 - /mnt/data-1 - --console-address -":9001"---license- /minio.license ports: - name: api containerPort:9000- name: console containerPort:9001env: - name: MINIO_ROOT_USER valueFrom: secretKeyRef: name: aistor-minio-credentials key: root-user - name: MINIO_ROOT_PASSWORD valueFrom: secretKeyRef: name: aistor-minio-credentials key: root-password livenessProbe: httpGet: path: /minio/health/live port:9000initialDelaySeconds:5periodSeconds:30timeoutSeconds:10failureThreshold:3readinessProbe: httpGet: path: /minio/health/ready port:9000initialDelaySeconds:5periodSeconds:15timeoutSeconds:5resources: limits: cpu:"2"memory:"4Gi"requests: cpu:"500m"memory:"1Gi"volumeMounts: - name:># 双持久化卷:单节点下对应两块独立数据盘volumeClaimTemplates: - metadata: name:>["ReadWriteOnce"]# storageClassName: "openebs-hostpath"resources: requests: storage: 100Gi - metadata: name:>["ReadWriteOnce"]# storageClassName: "openebs-hostpath"resources: requests: storage: 100Gi部署
kubectl apply-faistor.yaml