Skip to content

Longhorn Storage

Longhorn provides persistent storage for your Kubernetes cluster with backup capabilities to Backblaze.

Configuration

Backblaze Setup

Back blaze is a cheap distributed file system storage solution, compatible with S3. It's used for backups for DBs, container registry and anything that needed to be backed up, really.

You must configure longhorn to use your backblaze bucket as backup.

  1. Create a Backblaze account and bucket:

  2. Sign up at Backblaze

  3. Create a new private bucket
  4. Generate application key with write access

  5. Configure Backblaze credentials in group_vars/all/secrets.yml:

backblaze_key_id: "your-backblaze-key-id"
backblaze_application_key: "your-backblaze-application-key"
backblaze_bucket: "your-backblaze-bucket"
backblaze_region: "your-region"

See Example secrets file for details.

Managing Backups

The ansible scripts will automatically configure automatic weekly backups for you, see the corresponding section in longhorn role for details.

Accessing the UI

  1. Set up port forwarding:
kubectl -n longhorn-system port-forward svc/longhorn-frontend 8080:80
  1. Access the UI at http://localhost:8080

UI Features

  • Volume management
  • Backup scheduling
  • Performance monitoring
  • Disaster recovery
  • Volume snapshots

Backup Configuration

Automated Backups

  1. Configure backup schedule in Longhorn UI:
  2. Go to Settings > Backup
  3. Set backup interval
  4. Configure retention policy

Backup Verification

  1. Check backup status:
  2. By using the UI, as explained above

  3. Verify backup in Backblaze:

  4. Log in to Backblaze
  5. Navigate to your bucket
  6. Check backup files

Troubleshooting

Common Issues

  1. Backup Failures
  2. Check Backblaze credentials
  3. Verify network connectivity
  4. Check Longhorn logs: bash kubectl logs -n longhorn-system -l app=longhorn-manager

If you fill variables right, backups should be all automatically configured for you, it should be plug and play.