还在篮子里

IPFS 上 Kubernetes · 语雀

IPFS 上 Kubernetes

本文指导如何在 Kubernetes 上起一个单机 IPFS(不是 Cluster)

预先准备

  • Rancher
  • Kubertes
  • Kubectl
  • Helm
  • kubernetes 上需要存在存储类或者其他可持久化存储的 PV(

安装

ipfs 图表位置:https://hub.helm.sh/charts/stable/ipfs

由于 IPFS 的 Helm Chart apiversion 出错我们需要下下来改一下。

$ helm fetch stable/ipfs

解压之后打开 statefulset.yaml 把 apiVersion: apps/v1beta1改为 apiVersion: apps/v1beta1

从本地 chart 构建

$ helm install --name ipfs --set persistence.size="20Gi"  ./ipfs
NAME:   ipfs
LAST DEPLOYED: Tue Nov 12 17:31:43 2019
NAMESPACE: store
STATUS: DEPLOYED

RESOURCES:
==> v1/Pod(related)
NAME         AGE
ipfs-ipfs-0  0s

==> v1/Service
NAME       AGE
ipfs-ipfs  <invalid>

==> v1/StatefulSet
NAME       AGE
ipfs-ipfs  <invalid>


NOTES:
You have successfully installed IPFS in your kubernetes cluster!

You can access the IPFS API from inside your cluster by connecting to port 5001 on
    ipfs-ipfs.store

You can also connect to port 8080 on the same hostname for talking to the IPFS Gateway.


If you want to connect to it from your local computer, you can find a URL to connect with the
following (for the gateway service):
  export POD_NAME=$(kubectl get pods --namespace store -l "app=ipfs,release=ipfs"  -o jsonpath="{.items[0].metadata.name}")
  echo "Use the API Gateway by accessing http://localhost:8080/ipfs/<IPFS-HASH>"
  kubectl --namespace store port-forward $POD_NAME 8080:8080

出错时卸载

$ helm del --purge ipfs

来源: IPFS 上 Kubernetes · 语雀

发表评论

电子邮件地址不会被公开。 必填项已用*标注