apiVersion: v1
kind: PersistentVolume
metadata:
  name: discord-downloader-go-data
spec:
  capacity:
    storage: 10Ti
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain # Keep 4eva
  storageClassName: default
  mountOptions:
    - hard
    - nfsvers=3
  nfs:
    path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/discord-downloader-go-data
    server: 10.42.42.10
  claimRef:
    name: discord-downloader-go-data
    namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: discord-downloader-go-data
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Ti
status: {}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: discord-downloader-go-dest
spec:
  capacity:
    storage: 10Ti
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain # Keep 4eva
  storageClassName: default
  mountOptions:
    - hard
    - nfsvers=3
  nfs:
    path: /mnt/DroboFS/Shares/Public/midjourney
    server: 10.42.42.10
  claimRef:
    name: discord-downloader-go-dest
    namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: discord-downloader-go-dest
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Ti
status: {}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: discord-downloader-go-config
spec:
  capacity:
    storage: 5Mi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain # Keep 4eva
  storageClassName: default
  mountOptions:
    - hard
    - nfsvers=3
  nfs:
    path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/discord-downloader-go-config
    server: 10.42.42.10
  claimRef:
    name: discord-downloader-go-config
    namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: discord-downloader-go-config
  annotations:
    nfs.io/storage-path: "discord-downloader-go-config"
spec:
  storageClassName: default
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 5Mi
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: discord-downloader-go
spec:
  replicas: 1
  selector:
    matchLabels:
      run: discord-downloader-go
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        run: discord-downloader-go
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        #- image: fdamstra/discord-downloader-go:latest
        - image: getgot/discord-downloader-go:latest
          imagePullPolicy: "Always"
          name: discord-downloader-go
          env:
            - name: TZ
              value: US/Michigan
          volumeMounts:
            - mountPath: /root/settings.json
              name: discord-downloader-go-config
              subPath: settings.json
            - mountPath: /dest
              name: discord-downloader-go-dest
            - mountPath: /root/database
              name: discord-downloader-go-data
      restartPolicy: Always
      volumes:
        - name: discord-downloader-go-config
          persistentVolumeClaim:
            claimName: discord-downloader-go-config
        - name: discord-downloader-go-data
          persistentVolumeClaim:
            claimName: discord-downloader-go-data
        - name: discord-downloader-go-dest
          persistentVolumeClaim:
            claimName: discord-downloader-go-dest
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 10.42.42.239
          - 10.42.42.1
        searches:
          - default.svc.cluster.local
          - svc.cluster.local 
          - cluster.local
        options:
          - name: ndots
            value: "2"
          - name: edns0
          - name: trust-ad
status: {}
