---
#DaemonSet
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: lotus-worker
spec:
  selector:
    matchLabels:
      app: lotus
  template:
    metadata:
      name: lotus-worker
      labels:
        app: lotus
    spec:
      nodeSelector:
        app: worker
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: lotus-miner-pvc
      - name: paramcache
        persistentVolumeClaim:
          claimName: lotus-param-pvc
      containers:
      - name: lotus-seal-worker
        image: harbor.vimmer.top/library/lotus:uat
        imagePullPolicy: Always
        command: ["sh", "-c", "trap : TERM INT; (while true; do lotus-seal-worker run; done) & wait"]
        env:
          - name: LOTUS_PATH
            value: /home/file/final/lotus
          - name: WORKER_PATH
            value: /home/file/final/lotusworker
          - name: LOTUS_STORAGE_PATH
            value: /home/file/final/lotusstorage
          - name: FULLNODE_LISTEN_ADDR
            value: /ip4/0.0.0.0/tcp/1234/http
          - name: IPFS_GATEWAY
            value: https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
          - name: TMPDIR
            value: /home/file/final/tmp  
          - name: FIL_PROOFS_PARAMETER_CACHE
            value: /var/tmp/filecoin-proof-parameters  
          - name: STORAGE_API_INFO
            value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.EwJXsHvYMw-z1kT3ROfjtgMAKl1Upc_MQ6znNeXsH_0:/ip4/miner-svc/tcp/2345/http"
        volumeMounts:
        - name: data
          mountPath: /home/file/final
        - name: paramcache
          mountPath: /var/tmp/filecoin-proof-parameters

