minio 部署minio

minio 部署minio

docker-compose部署minio

需要提前部署docker-compose

version: '3.9'

networks:
  basenetwork:
    driver: bridge
    ipam:
      config:
        - subnet: 10.201.1.0/24

services:
  base-minio:
    image: minio/minio:latest
    container_name: base-minio
    volumes:
      - "/home/minio/minio_data01:/minio_data01"
      - "/home/minio/minio_data02:/minio_data02"
      - "/home/minio/minio_data03:/minio_data03"
      - "/home/minio/minio_data04:/minio_data04"
    env_file:
      - '/home/minio/minio.config'
    command: server /minio_data0{1...4} --address ":19000"  --console-address ":19001"
    networks:
      basenetwork:
        aliases:
          - base-minio
    ports:
      - 19000:19000
      - 19001:19001
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:19000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3

k8s 部署minio

部署NFS

mkdir /nfs_data/minio_data
chmod -R 777 /nfs_data/minio_data

创建命名空间minio

kubectl create ns minio

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  namespace: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio:latest
        imagePullPolicy: IfNotPresent
        command:
          - /bin/sh
          - -c
          - minio server /data --console-address ":5000"
        ports:
        - name: data
          containerPort: 9000
          protocol: "TCP"
        - name: console
          containerPort: 5000
          protocol: "TCP"
        resources:
          requests:
            memory: 128Mi
            cpu: 50m
          limits:
            memory: 128Mi
            cpu: 100m
        volumeMounts:
          - mountPath: /data
            name: data
      volumes:
      - nfs:
          server: 192.168.1.3
          path: /nfs_data/minio_data
        name: data

service暴露端口

apiVersion: v1
kind: Service
metadata:
  name: minio
  namespace: minio
spec:
  type: NodePort
  ports:
  - name: data
    port: 9000
    targetPort: 9000
    protocol: TCP
    nodePort: 29000
  - name: console
    port: 5000
    targetPort: 5000
    protocol: TCP
    nodePort: 29001
  selector:
    app: minio

访问minio

http://192.168.1.4:29001/
默认账号/密码:minioadmin/minioadmin

image

image

参考文档

k8s部署minio单机

posted @ 2022-10-11 00:31  liwenchao1995  阅读(779)  评论(4编辑  收藏  举报