---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: minio
    app.kubernetes.io/name: minio
  name: minio
  namespace: infra
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: minio
      app.kubernetes.io/name: minio
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: minio
        app.kubernetes.io/name: minio
    spec:
      containers:
        - name: minio
          args:
            - "gateway"
            - "nas"
            - "/data"
            - "-S"
            - "/etc/minio/certs/"
            - "--console-address"
            - ":9001"
          env:
            - name: MINIO_PROMETHEUS_AUTH_TYPE
              value: "public"
            - name: MINIO_UPDATE
              value: "off"
            - name: TZ
              value: America/New_York
            - name: MINIO_BROWSER_REDIRECT_URL
              value: https://minio.${INT_DOMAIN}
          envFrom:
            - secretRef:
                name: minio
          image: "quay.io/minio/minio:RELEASE.2022-05-08T23-50-31Z"
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 3
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9001
            timeoutSeconds: 1
          ports:
            - containerPort: 9000
              name: api
              protocol: TCP
            - containerPort: 9001
              name: http
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 9001
            timeoutSeconds: 1
          resources:
            limits:
              memory: 750Mi
            requests:
              cpu: 100m
              memory: 100Mi
          startupProbe:
            failureThreshold: 30
            periodSeconds: 5
            successThreshold: 1
            tcpSocket:
              port: 9001
            timeoutSeconds: 1
          volumeMounts:
            - mountPath: /data
              name: data
      nodeSelector:
        kubernetes.io/arch: amd64
      volumes:
        - name: data
          nfs:
            path: /tank/minio
            server: ${NAS_1_ADDRESS}
