The offline k8s containerized deployment of the distributed storage solution MinIO is super simple!!!

I. Introduction

Distributed file storage system, as a code farmer, you will more or less hear about the famous hadoop file systems HDFS and FastDFS. These two have their own advantages and disadvantages in file storage, but for the popular k8s containerized deployment, these two deployments are too troublesome, and the official website does not clearly propose a deployment method.

Let’s talk about our protagonist

Provide official website http://www.minio.org.cn/

Two, Minio

When it comes to minio, we are most concerned about the two points, one is whether it is open source, and the second is whether it is easy to use.

Seen from the official website, it is absolutely open source. There are also a wide range of users.

Three, k8s containerized deployment

The official website provides two ways

  1. MinIO Helm Chart can provide customized and simple MinIO deployment with a simple command. For more information about MinIO Helm deployment, please visit here.

  2. You can also browse the Kubernetes MinIO example and deploy MinIO through the .yaml file.

Helm needs to be connected to the Internet, which is really bad news for servers without a network.

Therefore, we are ready to deploy in the most traditional yaml way

Reference official website:

Download —> kubernetes —> kubernetes CLI

Insert picture description here
Note: The
account and password root123/adminadmin
cluster deployment The
minimum node is: 4
storage nodes are 50 GB

Complete yml

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
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        env:
        - name: MINIO_ACCESS_KEY
          value: "root123"
        - name: MINIO_SECRET_KEY
          value: "adminadmin"
        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: 50Gi
      # 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: LoadBalancer
  ports:
    - port: 9000
      targetPort: 9000
      protocol: TCP
  selector:
    app: minio

The above image is minio/minio, you
need to set the name of the storage volume storageClassName

With a complete yaml, deployment is simple

If you can't deploy after reading the above yml, you can leave a message and reply within one day! ! ! !

Guess you like

Origin blog.csdn.net/qq_34168515/article/details/109500762