Create IPFS Peer

Using Peer resource, you can deploy ipfs peers which will join the public ipfs swarm by default.

ipfs peer

# peer.yaml
kind: Peer
name: peer-sample
spec: {}

Deploying this manifest will deploy a basic (but powerful ๐Ÿ’ช) ipfs peer which will starts with the all default settings that's similar to running ipfs init then ipfs daemon on your machine.

Let's deloy the above manifest.

$ kubectl apply -f peer.yaml

Kotal Peer controller will get a notification that a new Peer resource has been deployed, and will create all the Kubernetes resources (pod, service, configmap) necessary for it to work as expected. You can verify peer resources has been created by fetching all peers:

$ kubectl get peers # kubectl get
peer-sample go-ipfs

From the output above, we can confirm that ipfs peer peer-sample has been deployed and using go-ipfs client.

Get the pod created by our peer:

$ kubectl get pods
peer-sample-0 1/1 Running 0 5m

Check the logs of the running peer:

$ kubectl logs peer-sample-0

You'll get output similar to the following:

Initializing daemon...
go-ipfs version: 0.8.0-ce693d7
Repo version: 11
System version: amd64/linux
Golang version: go1.14.4
Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip4/
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /ip6/::1/udp/4001/quic
Swarm listening on /p2p-circuit
Swarm announcing /ip4/
Swarm announcing /ip4/
Swarm announcing /ip4/
Swarm announcing /ip4/
Swarm announcing /ip6/::1/tcp/4001
Swarm announcing /ip6/::1/udp/4001/quic
API server listening on /ip4/
Gateway (readonly) server listening on /ip4/
Daemon is ready

Congratulations ๐Ÿ”ฅ your peer is up and running and ready to receive api calls.

Let's forward localhost:5001 calls to peer-sample container:5001

$ kubectl port-forward peer-sample-0 5001
Forwarding from -> 5001
Forwarding from [::1]:5001 -> 5001

Let's read ipfs readme file by send http api call using cURL:

curl -X POST ""

You'll get the following result:

Hello and Welcome to IPFS!
โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ• โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘
โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•
If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!
| Warning: |
| This is alpha software. Use at your own discretion! |
| Much is missing or lacking polish. There are bugs. |
| Not yet secure. Read the security notes for more. |
Check out some of the other files in this directory:
./quick-start <-- usage examples
./readme <-- this file

You can view ipfs webui by visiting

Finally, delete the ipfs peer peer-sample, and Kubernetes will delete all resources created for the peer by kotal ipfs peer controller like pods, services ... etc:

$ kubectl delete peers peer-sample "peer-sample" deleted