---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: synapse-pv
spec:
  capacity:
    storage: 50Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain # Keep 4eva
  storageClassName: default
  mountOptions:
    - hard
    - nfsvers=3
  nfs:
    path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/synapse-pv
    server: 10.42.42.10
  claimRef:
    name: synapse-pv
    namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: synapse-pv
  annotations:
    nfs.io/storage-path: "synapse-pv"
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: synapse
spec:
  selector:
    matchLabels:
      app: synapse
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: synapse
    spec:
      containers:
      - image: matrixdotorg/synapse:v1.36.0
        name: synapse
#        args: ["generate"]
#        env:
#        - name: SYNAPSE_SERVER_NAME
#          value: "monkeybox.org"
#        - name: SYNAPSE_REPORT_STATS
#          value: "yes"
        volumeMounts:
        - name: data
          mountPath: /data
        ports:
          - containerPort: 8008
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: synapse-pv
