---
kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: minio
  name: minio
  labels:
    app: minio

spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: disktype
                    operator: In
                    values:
                      - hdd
      containers:
        - name: minio
          image: minio/minio:RELEASE.2021-10-27T16-29-42Z
          args: ['server', '/data', '--console-address', ':9001']
          ports:
            - name: minio
              containerPort: 9000
          volumeMounts:
            - name: s3-pv-storage
              mountPath: /data
          env:
            - name: MINIO_SERVER_URL
              value: https://minio.example.com
            - name: MINIO_BROWSER_REDIRECT_URL
              value: https://console.minio.example.com
            - name: MINIO_IDENTITY_OPENID_CONFIG_URL
              value: https://keycloak.example.com/auth/realms/home/.well-known/openid-configuration
            - name: MINIO_IDENTITY_OPENID_CLIENT_ID
              value: minio
            - name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
              value: cad5f999-81e6-4791-afef-86ddd18ae3df
            - name: MINIO_ROOT_USER
              valueFrom:
                secretKeyRef:
                  name: minio
                  key: MINIO_ROOT_USER
            - name: MINIO_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: minio
                  key: MINIO_ROOT_PASSWORD
      volumes:
        - name: s3-pv-storage
          persistentVolumeClaim:
            claimName: s3-pvc
