Redis Backup
Prerequisites
- Redis database asset
- Redis credentials
- Storage bucket asset
- Storage bucket asset credentials
Procedure from web console
- Navigate to the policy's page: Operations > Policies (or go directly to
/home/operations/policies) - Click on Create Policy button
- Select Redis backup
- Fill out the Redis backup policy form with the following information:
- Policy name: Enter a descriptive name for your backup policy
- The Redis asset to backup: Select the Redis instance from the dropdown
- The credential name to access Redis: Select the credential bound to the Redis asset from the dropdown
- The Bucket asset where backups will be saved: Choose the storage bucket from the dropdown
- The opts for Redis backup: Configure additional backup options (optional)
- The credential name to access Bucket: Select the credential bound to the Bucket from the dropdown
- The path inside the bucket where backup is saved: Define the storage path within the bucket
- The backup schedule in Cron format: Set the backup frequency using cron syntax (e.g.,
0 2 * * *for daily at 2 AM) - Enable GZIP compression: Check this option to compress backups
- Click Next to continue with the policy configuration
- Select the target cluster where you want to deploy the policy (optional - if not specified, the policy will be deployed to the default cluster)
- Review the policy configuration summary
- Click Create Policy to deploy the Redis backup policy
Procedure from CLI
Create a YAML file with the policy configuration:
apiVersion: operations.resiliency.io/v1alpha1
kind: Policy
metadata:
name: <policy-name>
namespace: resiliency-system
spec:
templateName: redis-backup
params:
- name: redis-asset
value: <redis-asset-id>
- name: bucket-asset
value: <bucket-asset-id>
- name: redis-backup-opts
value: "<backup-options>"
- name: bucket-credential
value: <bucket-credential-name>
- name: bucket-path
value: "<path-in-bucket>"
- name: schedule
value: "<cron-schedule>"
- name: use-gzip
value: <true|false>
- name: kubernetes-resources
value: <kubernetes-resources-config>
- name: redis-credential
value: <redis-credential-name>
placement:
clusterName: <target-cluster-id>
createNamespace: true
credentialName: <cluster-credential-name>
suspended: false
Apply the policy to the cluster:
kubectl apply -f redis-backup-policy.yaml
Note: Replace the placeholder values (<policy-name>, <redis-asset-id>, etc.) with your actual configuration values.