24-Jan-2020

Stash v0.9.0-rc.4 - Introducing Batch Backup and Hooks

by Emruz Hossain

We are very excited to announce Stash v0.9.0-rc.4 which brings some cool features like batch backup and hooks. We have also added Percona-XtraDB addon. This version also comes with some bug fixes and general improvements.

Stash by AppsCode is a data backup and recovery solution for Kubernetes workloads. If you are running production workloads in Kubernetes, you might want to take backup of your disks, databases etc. Traditional tools are too complex to setup and maintain in a dynamic compute environment like Kubernetes. Stash is a Kubernetes operator that uses restic or Kubernetes CSI Driver VolumeSnapshotter functionality to address these issues. Using Stash, you can backup Kubernetes volumes mounted in workloads, stand-alone volumes and databases. User may even extend Stash via addons for any custom workload.

Features

FeaturesAvailabilityScope
Backup & Restore Workload DataDeployment, DaemonSet, StatefulSet, ReplicaSet, ReplicationController, OpenShift DeploymentConfig
Backup & Restore Stand-alone Volume (PVC)PersistentVolumeClaim, PersistentVolume
Backup & Restore databasesPostgreSQL, MySQL, MongoDB, Elasticsearch
VolumeSnapshotCSI Driver must support VolumeSnapshot and Kubernetes Alpha features must be enabled
Schedule BackupSchedule through cron expression
Instant BackupUse CLI or create BackupSession manually
Auto BackupUsing a Template and annotations
Batch BackupBackup multiple co-related targets under a single configuration
Pause Scheduled Backup
Support Multiple Storage ProviderAWS S3, Minio, Rook, GCS, Azure, OpenStack Swift, Backblaze B2, Rest Server, any PV/PVC
EncryptionAES-256 in counter mode (CTR) (for Restic driver)
Deduplication (send only diff)Uses Content Defined Chunking (CDC) (for Restic driver)
Cleanup old snapshots automaticallyCleanup according to different retention policies
Prometheus Metrics for Backup & Restore ProcessOfficial Prometheus Server, CoreOS Prometheus Operator
Prometheus Metrics for Stash OperatorOfficial Prometheus Server, CoreOS Prometheus Operator
Support RBAC enabled cluster
Support PSP enabled cluster
CLIkubectl plugin (for Kubernetes 1.12+)
ExtensibilityExtend using Function and Task
CustomizabilityCustomize backup / restore process using Function and Task
HooksExecute httpGet, httpPost, tcpSocket and exec hooks before and after of backup or restore process.
Send Notification to WebhookUse hooks to send notification to webhooks(i.e. Slack channel)

What’s New

The following new features has been introduced in this version.

Batch Backup

Sometimes, a single component may not meet the requirement for your application. For example, in order to deploy a WordPress, you will need a Deployment for the WordPress and another Deployment for database to store it’s contents. Now, you may want to backup both of the deployment and database under a single configuration as they are parts of a single application.

In order to support this use case, we are introducing BackupBatch CRD. This allows users to specify multiple targets under single configuration. For more details, please check these guides:

Hooks

You may need to prepare your application before backup/restore. For, example you may want to pause your application before backup and resume it after backup to ensure the backed up data consistency. You may want to send a notification after a backup is completed. Or, you may want to remove corrupted data before restoring. In order to support those use cases, we are introducing Hooks in this version.

Stash hooks allows executing certain action before and after a backup/restore process. You can send HTTP requests to a remote server via httpGet or httpPost hooks. You can check whether a TCP socket is open using tcpSocket hook. You can also execute some commands into your application pod using exec hook. For more details, please follow these guides:

Percona-XtraDB Addon

We have added a new addon for taking backup Percona-XtraDB cluster. Currently, it only supports Percona XtraDB version 5.7. Please check these guides for more details:

Important Bug Fixes

We have fixes the following noticeable bugs:

  • Failed to create CronJob when BackupConfiguration name is same as Database crd name #1022
  • Can’t install stash #1032
  • Backup mysql creates infinite dumps #1030
  • BackupSession skipped for paused BackupConfiguration #997
  • Operator is observing panic() while handling failed CronJob creation for BackupConfiguration #1019
  • Stash Addons: Make chart.sh script compatible with helm 3#984
  • backup error for items #1018
  • RBAC permission missing in Chart for PersistentVolumeClaim, exists in installer deploy script #981
  • Clarify that user can not user /stash as mountPath for local backend #945
  • Invalid flag name for PVC restorer job #956

Please try this version and let us know if you face any issues. You can follow us on Twitter @KubeStash, talk to us on Slack or file an issue here.

Get Up and Running Quickly

Deploy, manage, upgrade Kubernetes on any cloud and automate deployment, scaling, and management of containerized applications.