Keep Postgres backups in your cluster with SeaweedFS

Keep Postgres backups in your cluster with SeaweedFS

• By Aditya Pimpalkar Aditya Pimpalkar

OpenEverest already backs databases up to S3, and in this post I’ll show how - using the provider for SeaweedFS in OpenEverest to back up a database, all within OpenEverest.

One thing to get out of the way first: running your backup S3 in the same cluster as the database isn’t a recommended backup setup. If the cluster is lost, the backups go with it. The safer pattern is a bucket outside the cluster. But that’s a separate concern - the point here is that in-cluster S3 with OpenEverest is possible, and SeaweedFS makes it easy to demonstrate.

The usual setup is a bucket outside the cluster, owned by someone else. After MinIO closed its community path, I wanted to see whether SeaweedFS could serve as the S3 store. It can - here’s how.

provider-seaweedfs turns SeaweedFS into an OpenEverest Instance: master, volume servers, filer, and an S3 gateway, driven by the seaweedfs-operator. provider-cloudnative-pg already writes PostgreSQL backups through the CNPG Barman Cloud plugin to any S3-compatible store.

I wired the two together on a local cluster. SeaweedFS was only the object store. Postgres kept its own backup format, WAL archive, and restore path.

What came out of it

SeaweedFS Instance Ready135 s

Created 2026-12-01T16:06:47Z, Ready=True at 16:09:02Z. status.phase was Provisioned.

Postgres Ready106 s

BackupConfigured at 16:19:49Z. Ready at 16:21:35Z. One replica, PostgreSQL 18.7, WAL archiving already on.

On-demand base backup9 s

app-db-1gib: startedAt 2026-12-02T11:52:59Z, completedAt 11:53:08Z, state: Succeeded. data.tar is 1,150,586,880 bytes (1.1 GiB). A 5-second poll reported Succeeded about 30 seconds after kubectl apply.

Restore into a new Instance72 s

From apply at 16:23:07Z to Ready observed at 16:24:19Z. All 3 rows came back. The source table had already been dropped.

SeaweedFS PostgreSQL Barman backup Restore

The sized base backup is two objects under its base/ prefix: data.tar at 1,150,586,880 bytes (1.1 GiB) and backup.info at 1,441 bytes. The table behind it is 1,024 rows of 1 MiB random bytea (1,024 MB of payload, 1,064 MB on disk with Postgres overhead).

provider-seaweedfs is still an MVP. These numbers are one run on local k3d disks.

The setup

Kubernetesk3d, 4 nodes (1 server + 3 agents), v1.37.2+k3s1. Each node reported 8 CPU and about 12 GiB.
Namespaceblog-demo. Both providers were already installed in everest-system.
SeaweedFSprovider-seaweedfs chart 0.3.1, SeaweedFS 4.54 (chrislusf/seaweedfs:4.54)
PostgreSQLprovider-cloudnative-pg chart 0.4.3, PostgreSQL 18.7, BackupClass cnpg-barman-plugin
Disklocal-path (the k3d default). allowVolumeExpansion is false on that class.

This is where the pods landed. k3d does not dedicate these CPUs; the picture is placement, not capacity.

k3d-everest-dev 4 nodes
server-0 master-0 filer-1 app-db-restored-1
agent-0 volume-0
agent-1 s3
agent-2 filer-0 app-db-1
SeaweedFS master volume server, 10 GiB filer, 1 GiB each S3 gateway PostgreSQL, 5 GiB

Who talks to whom

OpenEverest core stores an Instance. It does not know what SeaweedFS or PostgreSQL is. Each provider turns that Instance into the custom resource its operator already understands.

For this test the data path is the bottom row. Barman, running as the CNPG Barman Cloud plugin, speaks S3 to the SeaweedFS gateway. The gateway stores objects through the filer and the volume servers. Restore reads the same bucket back into a new Postgres Instance.

From the Postgres Instance, provider-cloudnative-pg generates an ObjectStore resource (here app-db-seaweed-s3-ef892b52). It holds the bucket address and credentials that Barman uses. You don’t write it yourself. Each Postgres Instance can use only one backup storage.

1. A SeaweedFS Instance as the bucket

The HA preset in the chart is 3 masters, 2 volumes, 2 filers. This run used a smaller layout that still keeps two filers. The filer holds the metadata for every object, and the S3 gateway cannot serve a request without it. SeaweedFS 4.48 and newer can run more than one filer; 4.54 is what the provider defaulted to on this cluster.

apiVersion: core.openeverest.io/v1alpha1
kind: Instance
metadata:
  name: seaweed-backups
  namespace: blog-demo
spec:
  providerRef:
    name: provider-seaweedfs
  version: "4.54"
  components:
    master:
      type: seaweedfs
      replicas: 1
      resources:
        requests: { cpu: 100m, memory: 128Mi }
        limits:   { cpu: "1",  memory: 512Mi }
    volume:
      type: seaweedfs
      replicas: 1
      resources:
        requests: { cpu: 100m, memory: 256Mi }
        limits:   { cpu: "1",  memory: 1Gi }
      storage:
        size: 10Gi
    filer:
      type: seaweedfs
      replicas: 2
      resources:
        requests: { cpu: 100m, memory: 128Mi }
        limits:   { cpu: "1",  memory: 512Mi }
      storage:
        size: 1Gi
    s3:
      type: seaweedfs
      replicas: 1
      resources:
        requests: { cpu: 100m, memory: 128Mi }
        limits:   { cpu: "1",  memory: 512Mi }

Five pods came up: master-0, volume-0, filer-0, filer-1, and one S3 Deployment pod. The image pull of chrislusf/seaweedfs:4.54 (272,632,533 bytes) dominated the wait on the nodes that did not have it yet. The Ready condition flipped 135 seconds after create.

status.phase stayed Provisioned. A wait on jsonpath={.status.phase}=Ready does not succeed. Wait on the Ready condition.

What the connection Secret actually contains

On Ready the provider writes Secret seaweed-backups-conn. The keys I used:

KeyValue in this run
endpointURLhttps://seaweed-backups-s3.blog-demo.svc:8334
host / portseaweed-backups-s3.blog-demo.svc / 8334
regionus-east-1
forcePathStyletrue
verifyTLSfalse (the certificate is the one the provider generated)
ca.crtCA for that certificate. Subject CN=seaweed-backups S3 CA, issued by the provider.
AWS_ACCESS_KEY_IDgenerated admin access key, also published as username
AWS_SECRET_ACCESS_KEYgenerated admin secret, also published as password

S3 authentication is on from the first boot. Anonymous requests are denied. The same Secret is a valid credential source for a BackupStorage in the same namespace, because that API reads AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

Two more Secrets showed up beside it: seaweed-backups-s3-https (the gateway certificate) and seaweed-backups-s3-ca.

The bucket

Barman does not create the bucket. I ran aws s3 mb from a pod, with AWS_CA_BUNDLE pointed at ca.crt from the connection Secret:

make_bucket: pg-backups
2026-12-01 16:12:16 pg-backups

That was the only object-store call I made by hand. Everything after it was an OpenEverest Backup or a new Instance.

We also support bucket creation through plugin-user-management.

2. BackupStorage, and the TLS rule that matters

apiVersion: backup.openeverest.io/v1alpha1
kind: BackupStorage
metadata:
  name: seaweed-s3
  namespace: blog-demo
spec:
  backupStorageClassRef:
    name: s3
  location:
    objectStore:
      bucket: pg-backups
  parameters:
    region: us-east-1
    endpointURL: https://seaweed-backups-s3.blog-demo.svc:8334
    forcePathStyle: true
  authentication:
    mode: AccessKey
    credentialsSecretRef:
      name: seaweed-backups-conn
  tls:
    ca:
      secretKeyRef:
        name: seaweed-backups-conn
        key: ca.crt

forcePathStyle: true matches what the SeaweedFS connection Secret publishes. The endpoint is the in-cluster Service DNS, so Postgres and Barman never leave the cluster.

Use ca.crt. Don’t turn verification off. The SeaweedFS S3 gateway uses HTTPS with a certificate the provider generated. Postgres’s backup tool (Barman) checks that certificate against a CA, and it cannot be told to skip the check.

I tested the shortcut to make sure. I created a second BackupStorage with tls.insecureSkipVerify: true. The storage itself was accepted, but a Postgres Instance that used it was rejected:

BackupConfigured=False
reason=BackupStorageIncompatible
TLSOptionUnsupported: BackupClass "cnpg-barman-plugin" does not support
tls.insecureSkipVerify on BackupStorageClass "s3"

So the working setup is the one above: point tls.ca at ca.crt from the connection Secret. The verifyTLS: false value in that Secret is only for clients that can skip the check. Barman is not one of them.

3. Postgres, with the archive pointed at that bucket

apiVersion: core.openeverest.io/v1alpha1
kind: Instance
metadata:
  name: app-db
  namespace: blog-demo
spec:
  providerRef:
    name: provider-cloudnative-pg
  version: "18.7"
  components:
    engine:
      type: postgresql
      replicas: 1
      resources:
        requests: { cpu: 100m, memory: 256Mi }
        limits:   { cpu: "1",  memory: 1Gi }
      storage:
        size: 5Gi
  backup:
    enabled: true
    classRef:
      name: cnpg-barman-plugin
    storages:
      - storageRef:
          name: seaweed-s3
        pitr:
          enabled: true
        schedules:
          - name: hourly
            enabled: true
            cron: "0 * * * *"
            retention:
              type: time
              duration: 7d

One replica, on purpose. This test is about the object store, and a single primary makes “the table is gone” unambiguous later. The hourly schedule is configured with time retention, which is the retention Barman understands. I did not wait around for that schedule to fire. The backup below is on demand.

BackupConfigured became True at 16:19:49Z with the message Backup configuration applied to engine. Ready followed at 16:21:35Z. The CloudNativePG Cluster then reported Cluster in healthy state and ContinuousArchiving=True.

Postgres was already saving its log to SeaweedFS

Postgres writes every change to a log called the WAL (write-ahead log). Barman copies finished WAL files to the bucket as they fill up. This happens as soon as the Instance is Ready, before any backup is taken.

To check, I created a table blog_demo, inserted three rows, and forced Postgres to close its current WAL file.

 id | note                                          | created_at
----+-----------------------------------------------+-------------------------------
  1 | seaweed holds our backups                     | 2026-12-01 16:21:58.411538+00
  2 | barman wrote this WAL somewhere               | 2026-12-01 16:21:58.411538+00
  3 | if this survives restore, Seaweed did its job | 2026-12-01 16:21:58.411538+00

Then I asked Postgres how many WAL files it had archived (pg_stat_archiver):

 archived_count | last_archived_wal        | last_archived_time            | failed_count
----------------+--------------------------+-------------------------------+-------------
              2 | 000000010000000000000002 | 2026-12-01 16:21:58.902123+00 |            0

Two WAL files were already in SeaweedFS and none had failed (failed_count = 0), all before I took a backup. The base backup in the next sections is a full copy of the data. The WAL files are what let you restore to a point in time after that copy.

4. A 1 GiB payload, then the base backup

The three-row table is enough to prove a restore copied the right tuples. It is a bad picture of what Barman actually uploads. I loaded a sized table next to it: 1,024 rows, each 1 MiB of random bytes.

gen_random_bytes on this server rejects a length above 1,024, so each row is 1,024 chunks of 1,024 bytes concatenated. The insert finished in 8.5 seconds. pg_total_relation_size('payload') was 1,064 MB for 1,024 MB of payload. A CHECKPOINT and pg_switch_wal() followed. pg_stat_archiver then reported archived_count = 45 and failed_count = 0.

apiVersion: backup.openeverest.io/v1alpha1
kind: Backup
metadata:
  name: app-db-1gib
  namespace: blog-demo
spec:
  origin:
    type: Instance
    instanceRef:
      name: app-db
  classRef:
    name: cnpg-barman-plugin
  storageRef:
    name: seaweed-s3
  deletionPolicy: Retain

Status when it finished:

state: Succeeded
startedAt: "2026-12-02T11:52:59Z"
completedAt: "2026-12-02T11:53:08Z"
message: backupId=20261202T115259 lsn=0/60000028..0/60000120 wal=000000010000000000000060..000000010000000000000060
path: backups/blog-demo/app-db/c72a6e67-a640-4341-b44b-3a5f120c34e2/seaweed-s3
executionMode: ProviderManaged

Nine seconds, start to complete. path is the prefix inside the bucket, and c72a6e67-a640-4341-b44b-3a5f120c34e2 is the Postgres Instance UID. The provider documents this layout: each Instance writes under <prefix>/backups/<namespace>/<instance>/<uid>/<storage>/, so two databases can share a bucket and still have separate retention.

operatorBackupRef pointed at a CloudNativePG Backup of the same name (postgresql.cnpg.io). OpenEverest did not copy bytes itself. It asked the operator, and the operator asked Barman.

The base-backup prefix, listed with the same CA, is two objects:

base/20261202T115259/data.tar1.1 GiB

1,150,586,880 bytes. The base backup Barman restores from. The payload table is 1,024 MB of random bytes; the tar is larger because it is a copy of the data directory, not just that table.

base/20261202T115259/backup.info1.4 KiB

1,441 bytes. Barman's description of the backup. Restore reads this to find data.tar.

aws s3 ls --summarize on that prefix reported Total Objects: 2 and Total Size: 1150588321. The WAL files live under wals/ in the same Instance prefix, next to base/.

This is a Barman backup of Postgres sitting in SeaweedFS. It is a different feature from SeaweedFS’s own filer-metadata backup (SeaweedBackup / dataMirror), which snapshots the object store itself and is not what ran here.

5. Drop the table, restore somewhere else

This restore is the earlier backup, app-db-before-drop, taken when the database was the three rows. The 1.1 GiB backup above is a later run and was not the source of this restore.

On the original primary:

DROP TABLE blog_demo;
Did not find any tables named "blog_demo".

The new Instance bootstraps from that Backup and keeps using the same bucket afterwards, which is what the provider’s restore example does. dataSource is bootstrap-only.

apiVersion: core.openeverest.io/v1alpha1
kind: Instance
metadata:
  name: app-db-restored
  namespace: blog-demo
spec:
  providerRef:
    name: provider-cloudnative-pg
  version: "18.7"
  dataSource:
    type: Backup
    backup:
      backupRef:
        name: app-db-before-drop
  components:
    engine:
      type: postgresql
      replicas: 1
      resources:
        requests: { cpu: 100m, memory: 256Mi }
        limits:   { cpu: "1",  memory: 1Gi }
      storage:
        size: 5Gi
  backup:
    enabled: true
    classRef:
      name: cnpg-barman-plugin
    storages:
      - storageRef:
          name: seaweed-s3
        pitr:
          enabled: true

What the Ready condition said while it came up. Time zero is the kubectl apply at 16:23:07Z:

0 s72 s
  1. Restoring the backup+0 s · 16:23:07Z

    Restore "app-db-restored-datasource" in progress (state="")

    phase=Pending

  2. Starting the primary+10 s · 16:23:17Z

    Creating primary instance app-db-restored-1

    phase=Pending · longest step, about 52 s

  3. Waiting for the instance+62 s · 16:24:09Z

    Some instances are not yet active. Please wait.

    phase=Pending

  4. Ready+72 s · 16:24:19Z

    The instance is ready. Cluster: healthy, ContinuousArchiving=True.

    phase=Provisioned · Ready=True

The restored primary, database app:

 id | note                                          | created_at
----+-----------------------------------------------+-------------------------------
  1 | seaweed holds our backups                     | 2026-12-01 16:21:58.411538+00
  2 | barman wrote this WAL somewhere               | 2026-12-01 16:21:58.411538+00
  3 | if this survives restore, Seaweed did its job | 2026-12-01 16:21:58.411538+00

Same created_at as the insert, down to the microsecond. The original Instance still had no blog_demo table, so those rows were not read from it. They were read out of pg-backups on SeaweedFS.

I restored to the backup id, which is a full base backup plus the WAL required to make it consistent. I did not pick a later point in time, even though pitr.enabled is set on both Instances.

If you set this up

  1. Create the bucket with the admin keys from <seaweed>-conn before any BackupStorage references it. Barman will not create it for you.
  2. Point endpointURL at https://<instance>-s3.<namespace>.svc:8334, set forcePathStyle: true.
  3. Put ca.crt from that same Secret on spec.tls.ca. tls.insecureSkipVerify: true is rejected as soon as a CNPG Instance references the storage.
  4. Use time retention (7d here). The CNPG provider rejects count retention for this BackupClass; Barman’s recovery window is a duration, and it applies to the whole archive for that cluster, including on-demand backups and WAL.
  5. Keep the restored Instance on the same BackupStorage if you want WAL archiving to continue after the restore. That is what app-db-restored does.
  6. Do not point a SeaweedFS Instance’s own backup configuration at its own S3 Service. provider-seaweedfs rejects that endpoint (BackupConfigured=StorageIsSelf), because mirroring the filer into a bucket inside the same cluster loops. SeaweedFS as the target for another engine is the path this post ran.
  7. Wait on the Ready condition. status.phase reads Provisioned when the Instance is usable.

What one local run does not say

  • The provider is still MVP, and this was one k3d cluster with local-path volumes. Losing the node that holds volume-0 takes the only copy of the bucket with it.
  • The sized backup is one 1.1 GiB data.tar of a 1 GiB payload, measured once. Nothing here is a throughput result.
  • The hourly schedule has fired since the Instance was created (app-db-hourly-* Backups in Succeeded). I did not watch a retention pass delete anything. What 7d removes is what the provider documents: Barman’s recovery window for that cluster’s archive.
  • SeaweedFS’s own backup and restore (filer metadata snapshots and dataMirror) did not run. A backup of the object store is a different test.
  • pitr.enabled: true turned WAL archiving on. I restored the backup id, not an arbitrary timestamp.

To get involved with OpenEverest yourself:

Join Slack Star the Repo

See Also