CLI

Every warrenfs command and its flags. One binary is the storage daemon, the FUSE mount, the CSI plugin and the admin tool.

warrenfs <command> [flags]
Command What it does
serve run the storage daemon
config print the effective configuration, secrets redacted
env list the environment variable for every setting
mount mount a bucket at a directory with FUSE
csi run the CSI node plugin
status used and free space, nodes and volumes
drain move a node's data to the other nodes (cluster mode)
undrain stop draining a node (cluster mode)
remove take a node that is gone for good out of the Raft group (cluster mode)
peer-ca make a cluster CA for TLS between instances
version print the version

Exit status: 0 on success, 1 on an error (printed to stderr), 2 on a usage error.

serve

warrenfs serve --config /etc/warrenfs/config.yaml
Flag Default Meaning
--config $WARRENFS_CONFIG the YAML config file; without one, only defaults and WARRENFS_* variables apply

Runs until SIGINT or SIGTERM, then stops accepting requests, waits up to 30 seconds for running ones, and, as Raft leader, hands leadership over. Logs are JSON on stderr. See Configuration.

config

warrenfs config --config /etc/warrenfs/config.yaml

Loads and validates the configuration exactly as serve would, and prints it as YAML with the secrets redacted, followed by the names of the client apps. Every invalid setting is reported at once. Takes --config like serve.

env

warrenfs env

Lists every setting's environment variable next to its key path, then the secrets.

mount

WARRENFS_TOKEN=<token> warrenfs mount --url http://10.0.0.1:7480 --bucket app /srv/app-files

Mounts a bucket at a directory and stays in the foreground until SIGINT or SIGTERM, which unmounts. The token is read from $WARRENFS_TOKEN and must belong to the bucket's app.

Flag Default Meaning
--url $WARRENFS_URL internal API of the instance on this machine; required
--bucket bucket to mount; required
--uid the current user owner of every file and directory
--gid the current group group of every file and directory
--allow-other false let users other than the mounting one see the files
--spool the system temp directory where files being written are kept until close

What the mount supports and refuses: Names and the mount.

csi

warrenfs csi --endpoint unix:///csi/csi.sock

The CSI node plugin, driver name warrenfs, for inline ephemeral volumes. On start it mounts every volume recorded in its state directory again.

Flag Default Meaning
--endpoint unix:///csi/csi.sock the CSI socket
--node-id $WARRENFS_NODE_NAME this node's name; required
--url $WARRENFS_URL internal API of the instance on this node; required
--state-dir /var/lib/warrenfs-csi/state where mounted volumes are recorded; holds tokens, root only
--spool-dir /var/lib/warrenfs-csi/spool where files being written are kept
--mount-dir /var/lib/warrenfs-csi/mnt staging directories the file systems are mounted in

Deployment: Kubernetes.

status

warrenfs status

Prints space, nodes and volumes, and in cluster mode the Raft leader and members. In cluster mode it asks an instance (the one on this node by default) with the peer token; in kubernetes mode it reads the Volume resources and Leases through the Kubernetes API. It does not apply to standalone mode, which has no cluster to report on; use /metrics there.

Flag Default Meaning
--config $WARRENFS_CONFIG config file, for the mode, cluster name, replication and reserve
--url this node's instance internal API of an instance (cluster mode)
--context the current one kubeconfig context, when run outside the cluster (kubernetes mode)
--json false print JSON

The output is explained in Day two.

drain, undrain, remove

warrenfs drain node3
warrenfs undrain node3
warrenfs remove node3

Cluster mode only. drain moves the node's volumes and name shards to the other nodes and keeps new volumes off it; undrain stops that. remove takes a node that is gone for good out of the Raft group; its volumes are then repaired elsewhere. Each prints <node>: <command> done once the change is recorded in the volume map; the moves themselves run in the background.

Flag Default Meaning
--config $WARRENFS_CONFIG config file
--url this node's instance internal API of an instance

The peer token is read from $WARRENFS_PEER_TOKEN, and with peerTLS the CA from $WARRENFS_PEER_CA_CERT and $WARRENFS_PEER_CA_KEY. In kubernetes mode, drain with the node label warrenfs/drain=true instead.

peer-ca

warrenfs peer-ca /etc/warrenfs

Writes DIR/ca.crt and DIR/ca.key (mode 0600), never over existing files: the cluster CA for peerTLS. Every instance needs both, as WARRENFS_PEER_CA_CERT and WARRENFS_PEER_CA_KEY (the PEM, or the file's path).

Flag Default Meaning
--name warrenfs cluster name, in the CA's subject

version

warrenfs version

Prints the version set at build time with -ldflags "-X main.version=...", or dev.