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.
-
Create a Backblaze account and bucket:
-
Sign up at Backblaze
- Create a new private bucket
-
Generate application key with write access
-
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
- Set up port forwarding:
kubectl -n longhorn-system port-forward svc/longhorn-frontend 8080:80
- Access the UI at http://localhost:8080
UI Features
- Volume management
- Backup scheduling
- Performance monitoring
- Disaster recovery
- Volume snapshots
Backup Configuration
Automated Backups
- Configure backup schedule in Longhorn UI:
- Go to Settings > Backup
- Set backup interval
- Configure retention policy
Backup Verification
- Check backup status:
-
By using the UI, as explained above
-
Verify backup in Backblaze:
- Log in to Backblaze
- Navigate to your bucket
- Check backup files
Troubleshooting
Common Issues
- Backup Failures
- Check Backblaze credentials
- Verify network connectivity
- 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.