minio的k8s的单机部署

apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  namespace: itshare
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio:RELEASE.2022-10-15T19-57-03Z
        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: 512Mi
            cpu: 50m
          limits:
            memory: 512Mi
            cpu: 100m
        volumeMounts:
          - mountPath: /data
            name: data
      volumes:
        - name: data
          hostPath:
            path: /opt/itshare/minio/mydata
            type: Directory

---

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

有挂载的主机目录

nacos中的配置

 

前端访问的是30011对应的是5000端口

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐