apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  labels:
    app: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - name: minio
        image: minio/minio
        env:
        - name: MINIO_ACCESS_KEY
          value: "minio"
        - name: MINIO_SECRET_KEY
          value: "minio123"
        ports:
        - containerPort: 9000
        volumeMounts:
        - name: minio-data
          mountPath: /data
        args: ["server", "/data"]
      volumes:
      - name: minio-data
        persistentVolumeClaim:
          claimName: minio-data
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: minio-data
  labels:
    k8s-app: minio
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
  name: minio
spec:
  selector:
    app: minio
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9000
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: minio
  annotations:
    kubernetes.io/ingress.class: "traefik"
    traefik.frontend.rule.type: "PathPrefix"
spec:
  rules:
  - http:
      paths:
      - path: /minio
        backend:
          serviceName: minio
          servicePort: 80