首页 > 其他分享 >k8s 部署minio

k8s 部署minio

时间:2022-10-11 00:44:24浏览次数:82  
标签:protocol minio 部署 TCP k8s data name

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单机

标签:protocol,minio,部署,TCP,k8s,data,name
From: https://www.cnblogs.com/liwenchao1995/p/16777915.html

相关文章