seaweed-block
seaweed-block is an experimental block storage service for Kubernetes.
It provides a CSI-based block volume path backed by SeaweedFS components. The current implementation focuses on a small, understandable storage stack for testing block volume creation, attach, mount, write/read, and cleanup flows.
Status
Alpha.
The current code passes a single-node Kubernetes smoke test:
dynamic PVC create
→ CSI attach
→ iSCSI mount
→ pod write/read checksum
→ cleanup
This is not production-ready.
Known missing pieces:
- multi-node failover
- failover while a volume is mounted
- durable production packaging (the alpha manifest still uses
emptyDir) - broader recovery testing
- RF=2/RF=3 replication on the Kubernetes path
- a real operator (a manifest launcher does the work today)
Why this exists
Kubernetes storage usually comes down to two options:
- a full storage stack such as Ceph/Rook
- Local PVs with weaker failure handling
seaweed-block explores a smaller block storage design for cases where a full
storage platform is too heavy but local storage is not enough. The current
goal is to validate the control path, data path, and recovery model before
expanding the system.
Architecture
The alpha path:
- Kubernetes PVC
- CSI driver
- block master / controller
- block volume process
- iSCSI target
- WAL-backed local write path
The local write path:
write → WAL → flush/checkpoint → extent
The WAL-first design makes writes easier to inspect and recover during development.
Recovery is split into base transfer and live WAL feeding so normal writes keep flowing while a peer catches up. Only one peer is the source of truth for a recovery stream at any given time.
Quick start
You need a Linux Kubernetes node where privileged CSI pods are allowed and
iscsi_tcp is loadable. k3s works.
For a default k3s install:
export KUBECONFIG="${KUBECONFIG:-/etc/rancher/k3s/k3s.yaml}"
Fast path: published images
bash scripts/run-k8s-demo-ghcr.sh "$PWD"
This pulls:
ghcr.io/seaweedfs/seaweed-block:alpha
ghcr.io/seaweedfs/seaweed-block-csi:alpha
If the GHCR packages are not public yet, use the local build path below.
Local build path
bash scripts/build-alpha-images.sh "$PWD"
For k3s, import both images:
docker save sw-block:local | sudo k3s ctr images import -
docker save sw-block-csi:local | sudo k3s ctr images import -
Run the smoke test
bash scripts/run-k8s-alpha.sh "$PWD"
Expected:
[alpha] PASS: dynamic PVC create/delete completed checksum write/read and cleanup
Run the app demo (PVC survives pod replacement)
bash scripts/run-alpha-app-demo.sh "$PWD"
The demo writes from one pod, deletes it, then mounts the same PVC from a second pod and verifies the data. See docs/kubernetes-app-demo.md.
Use your own PVC
bash scripts/install-k8s-alpha.sh "$PWD"
kubectl apply -f examples/kubernetes/basic-app/storageclass-pvc.yaml
bash scripts/apply-k8s-alpha-blockvolumes.sh
kubectl apply -f examples/kubernetes/basic-app/writer-pod.yaml
apply-k8s-alpha-blockvolumes.sh is temporary. It applies the blockvolume
workload generated by blockmaster until a real operator owns that
reconciliation. The default install path renders generated workloads with a
PVC owner reference, so Kubernetes garbage collection removes them after the
PVC is deleted.
Repository layout
cmd/ command entry points (blockmaster, blockvolume, blockcsi)
core/ core storage logic (authority, csi, host, lifecycle, recovery, replication)
internal/ non-public packages and TestOps registry
deploy/ Kubernetes manifests
docs/ design and quickstart docs
examples/ Kubernetes examples
scripts/ build, install, and smoke-test helpers
Development
Run tests:
go test ./...
Run the Kubernetes alpha smoke:
bash scripts/run-k8s-alpha.sh "$PWD"
More detail:
Current limitations
This project is still early.
Do not use it for production workloads. The current alpha is for local development, design validation, and Kubernetes smoke testing.
Before production use, the project needs stronger recovery behavior, multi-node support, durable packaging, observability, failure testing, and operational documentation.
License
Apache-2.0