We have a number of automations to facilitate configuring and deploying IPFS Clusters:
Ansible roles for configuring and deploying
go-ipfs (including templated configuration files) are available at https://github.com/hsanjuan/ansible-ipfs-cluster.
IPFS Cluster provides official dockerized releases at https://hub.docker.com/r/ipfs/ipfs-cluster/ along with an example template for
If you want to run one of the
/ipfs/ipfs-cluster Docker containers, it is important to know that:
- The container does not run
go-ipfsand you should run the IPFS daemon separately, for example, using the
ipfs/go-ipfsDocker container. The
ipfs_connector/ipfshttp/node_multiaddressconfiguration value will need to be adjusted accordingly to be able to reach the IPFS API. This path supports DNS addresses (
/dns4/ipfs1/tcp/5001) and is set from the
CLUSTER_IPFSHTTP_NODEMULTIADDRESSenvironment variable when starting the container and no previous configuration exists.
- By default, we use the
/data/ipfs-clusteras the IPFS Cluster configuration path. We recommend mounting this folder as means to provide custom configurations and/or data persistency for your peers. This is usually achieved by passing
The container (Dockerfile here runs an
entrypoint.sh script which initializes IPFS Cluster when no configuration is present. The configuration values can be controlled by setting environment variables as explained in the configuration reference.
crdt consensus is used to initialize the configuration. This can be overriden by setting
Unless you run docker with
--net=host, you will need to set
$CLUSTER_IPFSHTTP_NODEMULTIADDRESSor make sure the configuration has the correct
We also provide an example
docker-compose.yml that is able to launch an IPFS Cluster with two Cluster peers and two IPFS daemons running.
One Cluster peer is launched first and acts as bootstrapper. A second peer is bootstrapped against the first one during the first boot. During the first launch, configurations are automatically generated and will be persisted for next launches in the
./compose folder, along with the
Only the IPFS swarm port (tcp
4101) and the IPFS Cluster API ports (tcp
9194) are exposed out of the containers.
This compose file is provided as an example on how to set up a multi-peer Cluster using Docker containers.
Kubernetes with Kustomize
Kustomize can be used to deploy IPFS Clusters on Kubernetes.
You can read more about it in the Running Cluster on Kubernetes guide.