• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Reposoft/kubernetes-ipfs: IPFS example, as a locally redundant blob/object store ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Reposoft/kubernetes-ipfs

开源软件地址:

https://github.com/Reposoft/kubernetes-ipfs

开源编程语言:


开源软件介绍:

IPFS cluster in Kubernetes

Configures a small cluster-local ipfs swarm, with focus on http API access.

A useful introduction, though with command line focus: https://medium.com/@ConsenSys/an-introduction-to-ipfs-9bba4860abd0.

Howto

First create a key for your private swarm and upload using:

kubectl apply -f ./00namespace.yml
kubectl -n ipfs create secret generic ipfs --from-file=./swarm.key

Optionally configure service type in the 3* yml:s, then do:

kubectl apply -f .`.

The logs can confirm that your swarm is private:

kubectl logs ipfs-0 | grep private
# "Swarm is limited to private network of peers with the swarm key"

Check status of your swarm

Peers (i.e. pods) find each other automagically.

kubectl -n ipfs get pods -o wide
# Should include "/ip4/..." entries for the peers:
kubectl -n ipfs exec ipfs-0 -- ipfs swarm peers

Ongoing investigation

Remains to investigate this log output which repeats itself endlessly:

DEBUG       mdns: starting mdns query mdns.go:125
DEBUG       mdns: Handling MDNS entry: 172.17.0.13:4001 QmTgXq7EM2jyArCPAPKsBwdjCmbVqnypXouCxSWQNzPTrP mdns.go:147
WARNI       core: trying peer info: {<peer.ID TgXq7E> [/ip4/172.17.0.13/tcp/4001]} core.go:390
DEBUG       mdns: Handling MDNS entry: 172.17.0.14:4001 QmXuE8WGu4pGNuUyz1bsMpwpZrShVDGpokSyWvCMuYCqNA mdns.go:147
WARNI       core: trying peer info: {<peer.ID XuE8WG> [/ip4/172.17.0.14/tcp/4001]} core.go:390
DEBUG       core: <peer.ID aoBGog> no more bootstrap peers to create 1 connections bootstrap.go:141
DEBUG       core: <peer.ID aoBGog> bootstrap error: not enough bootstrap peers to bootstrap bootstrap.go:87
DEBUG       mdns: Handling MDNS entry: 172.17.0.12:4001 QmUKJ7Fze9kWaxgZR7vUzZzWFgcrAi6AQ3ciX7iCMKw4fn mdns.go:147
DEBUG       mdns: Handling MDNS entry: 172.17.0.10:4001 QmaoBGogYpHNBhnmpg5e6Hoerc45kdiwvgDEAk1wTrC1H2 mdns.go:147
DEBUG       mdns: got our own mdns entry, skipping mdns.go:155
WARNI       core: trying peer info: {<peer.ID UKJ7Fz> [/ip4/172.17.0.12/tcp/4001]} core.go:390
DEBUG       mdns: mdns query complete mdns.go:138

Persistence

Note that ipfs has no ambition to replicate all content across all nodes, as that would be very impractical for next generation internet :)

TODO is distributed pin, like in ipfs-cluster (which reinvents too much of Kubernetes for our taste).

Testing

IP and port depends on your setup and the type you chose for services. Example with minikube NodePort and the random ports from kubectl create -f 3[service].yml:

ipfs_api=$(minikube service -n ipfs --url api)
ipfs_ro=$(minikube service -n ipfs --url readonly)
echo '{"test":1}' > test1
curl -F "data=@./test1" $ipfs_api/api/v0/add
# {"Name":"test1","Hash":"QmSUFD7V8MfmLYEHWw9phnGEFhrjuYxGTgzEtMJuNoB6Jq"}
curl $ipfs_ro/ipfs/QmSUFD7V8MfmLYEHWw9phnGEFhrjuYxGTgzEtMJuNoB6Jq
# {"test":1}



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap