openshift上部署filecoin lotus远程work节点

1. 准备工作

  • 最好跑在单独的节点(利用污点和亲和性),密封数据cpu经常100%,以免影响集群其他应用
  • 节点配置推荐16c128G
  • 有可ReadWriteMany存储

2. 创建项目

oc new-project lotus-test

3. 创建复制证明参数数据目录pvc

60G大小,如果已下载,可提前拷贝进去,否则默认会从ipfs.io下载会耗时很久

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: filecoin-proof-parameters-v20
  namespace: lotus-test
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 100Gi

4. 创建密封数据目录pvc

存放cache sealed staging unsealed数据

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: data
  namespace: lotus-test
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 2000Gi

5. 创建DeploymentConfig

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  labels:
    app: lotus-test
  name: lotus-test
  namespace: lotus-test
spec:
  replicas: 1
  selector:
    app: lotus-test
    deploymentconfig: lotus-test
  template:
    metadata:
      labels:
        app: lotus-test
        deploymentconfig: lotus-test
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: blockchain
                    operator: In
                    values:
                      - dev
      containers:
        - env:
            - name: STORAGE_API_INFO
              value: >-
                eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.gyhqIDRToC29zhIQZDbuqht-GcGJ6HwsKQM7Hu_6HhF:/ip4/xx.xx.xx.xx/tcp/2345/http
            - name: WORKER_PATH
              value: /data
          image: >-
            lotus-test:v0.28-work
          imagePullPolicy: Always
          name: lotus-test
          ports:
            - containerPort: 1234
              protocol: TCP
          resources: {}
          volumeMounts:
            - mountPath: /data
              name: data-pvc
            - mountPath: /var/tmp/filecoin-proof-parameters
              name: filecoin-proof-parameters-v20-pvc
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      tolerations:
        - effect: NoExecute
          key: blockchain
          operator: Equal
          value: dev
      volumes:
        - name: data-pvc
          persistentVolumeClaim:
            claimName: data
        - name: filecoin-proof-parameters-v20-pvc
          persistentVolumeClaim:
            claimName: filecoin-proof-parameters-v20

需要指定WORK_PATH和STORAGE_API_INFO环境变量

  • WORK_PATH如果不指定默认为~/.lotuswork
  • STORAGE_API_INFO格式参考官方
  • image参考:利用docker跑filecoin lotus远程节点
  • 如果没有设置污点、亲和性,去掉affinity、tolerations

引用

镜像制作参考

发布了14 篇原创文章 · 获赞 0 · 访问量 159

猜你喜欢

转载自blog.csdn.net/kk3909/article/details/104813940
今日推荐