forked from seaweedfs/seaweedfs-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Backup Configuration
Nikita Ganzikov edited this page Jul 25, 2025
·
2 revisions
This example demonstrates how to configure SeaweedFS with backup capabilities using various storage backends.
SeaweedFS backup functionality allows you to:
- Automatically backup data to external storage
- Support multiple backup destinations (S3, GCS, Azure, etc.)
- Configure incremental and full backups
- Set backup schedules and retention policies
Configure basic backup to S3:
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: seaweed-with-backup
namespace: default
spec:
version: "3.67"
# Core components
master:
replicas: 1
volume:
replicas: 3
filer:
replicas: 1
s3: true
# Backup configuration
filerBackup:
replicas: 1
sink:
s3:
enabled: true
region: "us-west-2"
bucket: "seaweedfs-backup"
directory: "backups"
awsAccessKeyID: "your-access-key"
awsSecretAccessKey: "your-secret-key"A more robust backup setup with multiple options:
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: production-backup-cluster
namespace: seaweedfs-system
labels:
environment: production
app: seaweedfs
spec:
version: "3.67"
# Core components
master:
replicas: 3
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
volume:
replicas: 5
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 1000m
memory: 2Gi
storageClassName: "fast-ssd"
filer:
replicas: 2
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 500m
memory: 1Gi
s3: true
persistence:
enabled: true
mountPath: "/data"
resources:
requests:
storage: 10Gi
# Enhanced backup configuration
filerBackup:
replicas: 1
resources:
requests:
cpu: 200m
memory: 256Mi
limits:
cpu: 400m
memory: 512Mi
# Multiple backup destinations
sink:
s3:
enabled: true
region: "us-west-2"
bucket: "seaweedfs-backup-primary"
directory: "daily-backups"
isIncremental: true
awsCredentialsSecretRef:
name: aws-backup-credentials
mapping:
awsAccessKeyID: access-key
awsSecretAccessKey: secret-keyfilerBackup:
sink:
s3:
enabled: true
region: "us-west-2"
bucket: "my-backup-bucket"
directory: "seaweedfs-backups"
awsAccessKeyID: "AKIAIOSFODNN7EXAMPLE"
awsSecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
endpoint: "https://s3.amazonaws.com" # Optional custom endpoint
isIncremental: truefilerBackup:
sink:
googleCloudStorage:
enabled: true
bucket: "my-gcs-backup-bucket"
directory: "seaweedfs-backups"
googleApplicationCredentials: "/path/to/credentials.json"
isIncremental: truefilerBackup:
sink:
azure:
enabled: true
accountName: "myazureaccount"
accountKey: "my-account-key"
container: "backup-container"
directory: "seaweedfs-backups"
isIncremental: truefilerBackup:
sink:
backblaze:
enabled: true
b2AccountID: "my-account-id"
b2MasterApplicationKey: "my-master-key"
bucket: "my-backup-bucket"
directory: "seaweedfs-backups"
b2Region: "us-west-002"
isIncremental: truefilerBackup:
sink:
local:
enabled: true
directory: "/backups/seaweedfs"
isIncremental: falsefilerBackup:
sink:
filer:
enabled: true
grpcAddress: "backup-filer:8880"
directory: "/backups"
replication: "001"
collection: "backups"
ttLSec: 2592000 # 30 days
isIncremental: true# Create AWS credentials secret
kubectl create secret generic aws-backup-credentials \
--from-literal=access-key=YOUR_ACCESS_KEY \
--from-literal=secret-key=YOUR_SECRET_KEY \
--namespace=default# Apply the configuration
kubectl apply -f seaweed-with-backup.yaml# Check backup pod status
kubectl get pods -l app.kubernetes.io/component=filer-backup
# Check backup logs
kubectl logs -l app.kubernetes.io/component=filer-backup -f
# Check backup service
kubectl get svc -l app.kubernetes.io/component=filer-backup# Verify S3 backup
aws s3 ls s3://seaweedfs-backup/backups/
# Verify GCS backup
gsutil ls gs://my-gcs-backup-bucket/seaweedfs-backups/
# Verify Azure backup
az storage blob list --container-name backup-container --account-name myazureaccount# Check pod events
kubectl describe pod -l app.kubernetes.io/component=filer-backup
# Check resource limits
kubectl top pods -l app.kubernetes.io/component=filer-backup# Check secret exists
kubectl get secret aws-backup-credentials
# Verify secret content
kubectl get secret aws-backup-credentials -o yaml# Test connectivity to backup destination
kubectl run test-pod --image=busybox --rm -it --restart=Never -- wget -O- https://s3.amazonaws.com
# Check DNS resolution
kubectl run test-pod --image=busybox --rm -it --restart=Never -- nslookup s3.amazonaws.com# Check backup configuration
kubectl describe seaweed seaweed-with-backup
# Check backup events
kubectl get events --field-selector involvedObject.name=seaweed-with-backup
# Check backup logs with timestamps
kubectl logs -l app.kubernetes.io/component=filer-backup --timestamps
# Check backup metrics
kubectl port-forward svc/seaweed-with-backup-filer-backup 5555:5555
curl http://localhost:5555/metrics | grep backupfilerBackup:
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 1000m
memory: 2GifilerBackup:
persistence:
enabled: true
mountPath: "/data"
resources:
requests:
storage: 10Gi
storageClassName: "fast-ssd"filerBackup:
sink:
s3:
enabled: true
region: "us-west-2" # Choose region close to your cluster
bucket: "seaweedfs-backup"apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: backup-network-policy
namespace: default
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: filer-backup
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- protocol: TCP
port: 443 # HTTPS for cloud storage# Delete the cluster
kubectl delete seaweed seaweed-with-backup
# Delete credentials
kubectl delete secret aws-backup-credentials
kubectl delete secret gcs-backup-credentials
kubectl delete secret azure-backup-credentials
# Clean up backup data (optional)
aws s3 rm s3://seaweedfs-backup/backups/ --recursive- Basic Cluster - Basic cluster setup
- Admin UI - Add admin interface
- Bucket Management - Create buckets
- Configuration Reference - Advanced configuration
- Seaweed Resource - Complete API reference
- Installation Guide - Operator installation
- Quick Start - Getting started guide