kubernetes部署minio

vim minio-deployment.yml

apiVersion: v1
kind: Namespace
metadata:
  name: minio
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  namespace: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      name: minio
  template:
    metadata:
      name: minio
      labels:
        name: minio
    spec:
      containers:
      - name: minio
        image: minio/minio
        args:
        - server
        - /data
        - --console-address
        - ":9001"
        env:
        - name: MINIO_ROOT_USER
          value: admin
        - name: MINIO_ROOT_PASSWORD
          value: admin@20220331
        ports:
        - containerPort: 9000
        - containerPort: 9001
        volumeMounts:
        - name: minio-data
          mountPath: /data
      volumes:
      - name: minio-data
        hostPath:
          path: /data/minio-data
          type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
  name: minio
  namespace: minio
spec:
  type: NodePort
  ports:
  - port: 9000
    targetPort: 9000
    nodePort: 30090
    name: minio-9000
  - port: 9001
    targetPort: 9001
    nodePort: 30091
    name: minio-9001
  selector:
    name: minio

部署minio

kubectl apply -f minio-deployment.yml

查看minio

kubectl get all -n minio

NAME                         READY   STATUS    RESTARTS   AGE
pod/minio-869999667b-nxksh   1/1     Running   0          12m

NAME            TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                         AGE
service/minio   NodePort   10.97.140.159           9000:30090/TCP,9001:30091/TCP   11m

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/minio   1/1     1            1           12m

NAME                               DESIRED   CURRENT   READY   AGE
replicaset.apps/minio-869999667b   1         1         1       12m

访问minio控制台

http://IP:30091

你可能感兴趣的:(kubernetes,kubernetes,minio/minio)