seaweedfs

by apecloud

Helm chartv1.0.0App 4.47Verified publisher

SeaweedFS distributed object storage with an S3-compatible gateway

About this chart

SeaweedFS

SeaweedFS is an object store with separate master, volume, filer and S3 services. This addon targets KubeBlocks 1.0 and SeaweedFS 4.47 (serviceVersion: "4.47.0"). The Chinese design explains the component boundaries and validation plan.

This is an initial implementation. Offline script, chart and KubeBlocks 1.0 schema checks are available; live acceptance is still required. Neither topology is claimed to be production ready.

Topologies

Componentstandalone (default)distributedPersistent directory
masterExactly 1Exactly 3, native Raft election/data/master
volumeExactly 1, one data copy (000)2–32, two copies on distinct volume servers (001)/data/volume
filerExactly 1Exactly 1/data/filer, LevelDB2
s31–321–32Stateless

The distributed topology still has a single filer. Loss of its PVC can lose the object namespace even when volume data survives. It is not a complete HA or backup solution. Volume scale-out adds capacity; existing data is not automatically rebalanced. Direct volume scale-in is rejected by a lifecycle action because it requires data evacuation. Master membership and filer replicas are fixed.

The distributed example needs at least three schedulable nodes: its master and volume pods use required anti-affinity. Increasing volume replicas requires another eligible node per replica unless the operator deliberately changes that scheduling policy. Replication placement does not promise availability-zone separation.

Install and create

Install KubeBlocks from the release-1.0 line first. From the root of this repository:

helm dependency build addons/seaweedfs
helm upgrade --install seaweedfs addons/seaweedfs -n kb-system
kubectl create namespace demo
kubectl apply -f examples/seaweedfs/cluster.yaml

For the distributed example:

kubectl apply -f examples/seaweedfs/cluster-distributed.yaml

Alternatively, install the Cluster chart after the addon:

helm dependency build addons-cluster/seaweedfs
helm install seaweedfs addons-cluster/seaweedfs -n demo
# For distributed, use a different release name:
helm install seaweedfs-dist addons-cluster/seaweedfs -n demo \
  --set topology=distributed --set s3.replicas=2

Examples explicitly set the engine version and PVC sizes. They use the default StorageClass; set storageClassName in the Cluster chart or each example PVC when needed. DoNotTerminate is the default deletion policy. Deleting stored data requires an explicit change to the Cluster termination policy.

Definition and script/config names are shared, cluster-wide addon identities. Install one addon release per Kubernetes cluster; instances may live in different namespaces. Do not install a second addon release into another namespace to try to create an independent copy of those definitions.

S3 access

The default S3 service is <cluster>-s3, port 8333. Only expose this gateway to application clients. Master, volume and filer interfaces have no internal authentication in this first version and require a trusted cluster network.

kubectl -n demo port-forward svc/seaweedfs-s3 8333:8333

In another shell with AWS CLI installed, load the generated account without printing the secret:

export AWS_ACCESS_KEY_ID="$(kubectl -n demo get secret seaweedfs-s3-account-admin -o jsonpath='{.data.username}' | base64 --decode)"
export AWS_SECRET_ACCESS_KEY="$(kubectl -n demo get secret seaweedfs-s3-account-admin -o jsonpath='{.data.password}' | base64 --decode)"
export AWS_DEFAULT_REGION=us-east-1
aws --endpoint-url http://127.0.0.1:8333 s3 mb s3://example-bucket
printf 'hello SeaweedFS\n' > /tmp/seaweedfs-example.txt
aws --endpoint-url http://127.0.0.1:8333 s3 cp /tmp/seaweedfs-example.txt s3://example-bucket/object.txt
aws --endpoint-url http://127.0.0.1:8333 s3 cp s3://example-bucket/object.txt -

Use path-style S3 addressing. The gateway fails to start if either credential is absent. Credentials are read from environment variables, so changing the account Secret requires restarting all S3 instances. Automatic credential rotation and general account management are not implemented. The anonymous /healthz endpoint only checks that the gateway responds; it does not prove authenticated object reads or filer/volume availability.

Operations and boundaries

All listed operations require live acceptance against the pinned candidate before being considered supported in production. Run operations sequentially and verify object checksums after each one.

OperationImplementation / boundaryExample
RestartExisting data is reused; singleton filer/standalone components have downtimerestart
Stop / StartIntended to retain PVCs and reopen existing statestop, start
Vertical scalingRecreates the selected component podsverticalscale
PVC expansionRequires an expandable StorageClass/CSI; shrinking is not supportedvolume-expand
S3 scalingStateless replicas; keep at least one. Scale out before the scale-in exampleout, in
Volume scale-outDistributed topology only; new capacity, no automatic rebalancevolume-scale-out
Volume scale-inRejected; migrate and verify data before a separately designed removalNo destructive example
Master / filer scalingFixed membership / single LevelDB2 storeNot supported
TLS, backup/restore, PITR, rebuildNo implementation or capability declarationsNot supported
Engine upgrade, reconfigure, planned switchoverSingle tested-version target; no operation contract yetNot supported

Creation/update order is master → volume → filer → s3; termination is the reverse. Master pods are created in parallel to permit election, then updated serially, with followers before the leader. The engine performs failover; this addon does not offer a planned Switchover operation.

Configuration and runtime inputs

image.registry and image.repository support equivalent mirrors. The supported tag is fixed at 4.47; changing the tag/version requires a reviewed version matrix. volumeSizeLimitMB defaults to 1024 MiB per SeaweedFS volume file, independently of PVC capacity. The volume server derives its maximum volume count from disk space (-max=0). Do not change a cluster-wide definition's setting for running instances without a separately validated migration.

Startup scripts use these explicit input contracts:

VariableSource / format
POD_NAMEKubernetes downward API, the actual Pod name
SEAWEEDFS_POD_FQDNSCurrent componentVarRef, comma-separated actual Pod FQDNs
SEAWEEDFS_MASTER_FQDNSMaster componentVarRef, comma-separated actual Pod FQDNs
SEAWEEDFS_MASTER_REPLICASDefinition constant, exactly 1 or 3
SEAWEEDFS_REPLICATIONDefinition constant, 000 or 001
SEAWEEDFS_FILER_HOST, SEAWEEDFS_FILER_PORTInternal filer Service host and HTTP port; do not expose/replace that internal service
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYRequired KubeBlocks admin account Secret

Pod names need not have contiguous ordinals and DNS suffixes are not hardcoded. The engine runs as UID/GID 1000 with PVC fsGroup 1000. Mounted scripts are read-only executable files; the filer config is read-only and points its LevelDB2 store into the persistent volume. Startup never formats or removes existing data. Startup/liveness use local TCP checks; readiness uses the engine's HTTP health checks.

Offline checks

These checks start no databases and contact no Kubernetes API:

helm dependency build addons/seaweedfs --skip-refresh
helm dependency build addons-cluster/seaweedfs --skip-refresh
helm lint addons/seaweedfs
helm lint addons-cluster/seaweedfs
shellcheck addons/seaweedfs/scripts/*.sh
shellspec --load-path ./shellspec addons/seaweedfs/scripts-ut-spec
# Python environment requires PyYAML and jsonschema.
KB_CRD_DIR=/path/to/kubeblocks/config/crd/bases \
  python3 addons/seaweedfs/tests/test_charts.py

The CRDs must come from the intended release-1.0 commit. This offline schema check rejects undeclared fields but does not execute Kubernetes admission, defaulting, CEL or controllers. Live validation must still verify generated objects, account authentication, persisted reads, supported operations, failure recovery and cleanup on both topologies.

Deploy seaweedfs with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has seaweedfs on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartseaweedfs is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply