Deploy IPFS peer

Deploy Peer

peer.yaml
1
apiVersion: ipfs.kotal.io/v1alpha1
2
kind: Peer
3
metadata:
4
name: simple-peer
5
spec: {}
Copied!
This is a simple ipfs peer that joins the public ipfs swarm, and will starts with the all default settings that's similar to running ipfs init then ipfs daemon on your machine.
Let's deploy the peer:
1
kubectl apply -f peer.yaml
Copied!
Kotal operator will notice your simple-peer and will create all the necessary pods, persistent volumes, services, configmaps, and secrets.
1
kubectl get peers
Copied!
It will return an output similar to the following:
1
NAME CLIENT
2
simple-peer go-ipfs
Copied!

Fetch Peer Logs

Get the pods created for the peer:
1
kubectl get pods
Copied!
It will return an output similar to the following:
1
NAME READY STATUS RESTARTS AGE
2
simple-peer-0 1/1 Running 0 5m
Copied!
Check the logs of the running peer:
1
kubectl logs -f simple-peer-0
Copied!
You'll get output similar to the following:
1
Initializing daemon...
2
go-ipfs version: 0.8.0-ce693d7
3
Repo version: 11
4
System version: amd64/linux
5
Golang version: go1.14.4
6
Swarm listening on /ip4/10.244.0.6/tcp/4001
7
Swarm listening on /ip4/10.244.0.6/udp/4001/quic
8
Swarm listening on /ip4/127.0.0.1/tcp/4001
9
Swarm listening on /ip4/127.0.0.1/udp/4001/quic
10
Swarm listening on /ip6/::1/tcp/4001
11
Swarm listening on /ip6/::1/udp/4001/quic
12
Swarm listening on /p2p-circuit
13
Swarm announcing /ip4/10.244.0.6/tcp/4001
14
Swarm announcing /ip4/10.244.0.6/udp/4001/quic
15
Swarm announcing /ip4/127.0.0.1/tcp/4001
16
Swarm announcing /ip4/127.0.0.1/udp/4001/quic
17
Swarm announcing /ip6/::1/tcp/4001
18
Swarm announcing /ip6/::1/udp/4001/quic
19
API server listening on /ip4/0.0.0.0/tcp/5001
20
WebUI: http://0.0.0.0:5001/webui
21
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
22
Daemon is ready
Copied!
Your peer is up and running and ready to receive api calls.

Read file Using IPFS HTTP API

Let's forward localhost:5001 calls to simple-peer:5001
1
kubectl port-forward simple-peer-0 5001
Copied!
In another terminal window, send http api call using cURL:
1
curl -X POST "http://127.0.0.1:5001/api/v0/cat?arg=QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme"
Copied!
You'll get the following output:
1
Hello and Welcome to IPFS!
2
​
3
β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
4
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
5
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
6
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘
7
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
8
β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β•
9
​
10
If you're seeing this, you have successfully installed
11
IPFS and are now interfacing with the ipfs merkledag!
12
​
13
-------------------------------------------------------
14
| Warning: |
15
| This is alpha software. Use at your own discretion! |
16
| Much is missing or lacking polish. There are bugs. |
17
| Not yet secure. Read the security notes for more. |
18
-------------------------------------------------------
19
​
20
Check out some of the other files in this directory:
21
​
22
./about
23
./help
24
./quick-start <-- usage examples
25
./readme <-- this file
26
./security-notes
Copied!
You can also view ipfs webui by visiting http://0.0.0.0:5001/webui
Finally, delete the ipfs peer:
1
kubectl delete -f peer.yaml
Copied!
Kubernetes garbage collector will delete all the resources that has been created by Kotal IPFS Peer controller.
Last modified 10d ago