Operations
Backup And Restores
Monitoring
tpl
This guide demonstrates how to deploy a Qdrant cluster using KubeBlocks and configure scheduled backups with retention in an S3 repository.
Before proceeding, ensure the following:
kubectl create ns demo
namespace/demo created
KubeBlocks uses a declarative approach for managing Qdrant Clusters. Below is an example configuration for deploying a Qdrant Cluster with 3 replicas.
Apply the following YAML configuration to deploy the cluster:
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
name: qdrant-cluster
namespace: demo
spec:
terminationPolicy: Delete
clusterDef: qdrant
topology: cluster
componentSpecs:
- name: qdrant
serviceVersion: 1.10.0
replicas: 3
resources:
limits:
cpu: "0.5"
memory: "0.5Gi"
requests:
cpu: "0.5"
memory: "0.5Gi"
volumeClaimTemplates:
- name: data
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
Monitor the cluster status until it transitions to the Running state:
kubectl get cluster qdrant-cluster -n demo -w
Expected Output:
kubectl get cluster qdrant-cluster -n demo
NAME CLUSTER-DEFINITION TERMINATION-POLICY STATUS AGE
qdrant-cluster qdrant Delete Creating 49s
qdrant-cluster qdrant Delete Running 62s
Check the pod status and roles:
kubectl get pods -l app.kubernetes.io/instance=qdrant-cluster -n demo
Expected Output:
NAME READY STATUS RESTARTS AGE
qdrant-cluster-qdrant-0 2/2 Running 0 1m43s
qdrant-cluster-qdrant-1 2/2 Running 0 1m28s
qdrant-cluster-qdrant-2 2/2 Running 0 1m14s
Once the cluster status becomes Running, your Qdrant cluster is ready for use.
If you are creating the cluster for the very first time, it may take some time to pull images before running.
Backup Repository Configured:
BackupRepo
BackupRepo
status is Ready
Cluster is Running:
Running
stateKubeBlocks automatically creates a BackupSchedule
resource when the cluster is created. Follow these steps to enable and configure scheduled backups:
kubectl get backupschedule qdrant-cluster-qdrant-backup-schedule -n demo -oyaml
Example Output:
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: BackupSchedule
spec:
backupPolicyName: qdrant-cluster-Qdrant-backup-policy
schedules:
- backupMethod: datafile
# ┌───────────── minute (0-59)
# │ ┌───────────── hour (0-23)
# │ │ ┌───────────── day of month (1-31)
# │ │ │ ┌───────────── month (1-12)
# │ │ │ │ ┌───────────── day of week (0-6) (Sunday=0)
# │ │ │ │ │
# 0 18 * * *
# schedule this job every day at 6:00 PM (18:00).
cronExpression: 0 18 * * * # update the cronExpression to your need
enabled: true # set to `true` to schedule base backup periodically
retentionPeriod: 7d # set the retention period to your need
kubectl edit backupschedule qdrant-cluster-qdrant-backup-schedule -n demo
Update these key parameters:
enabled
: Set to true
to activate scheduled backupscronExpression
: Configure backup frequency using cron syntaxretentionPeriod
: Set how long to keep backups (e.g., 7d
, 1mo
)Example configuration for daily backups at 6PM UTC with 7-day retention:
schedules:
- backupMethod: datafile
enabled: true
cronExpression: "0 18 * * *"
retentionPeriod: 7d
# Check schedule status
kubectl get backupschedule qdrant-cluster-qdrant-backup-schedule -n demo -w
# View detailed configuration
kubectl describe backupschedule qdrant-cluster-qdrant-backup-schedule -n demo
After enabling scheduled backups, monitor their execution and manage backup retention:
kubectl get backup -n demo -l app.kubernetes.io/instance=qdrant-cluster
kubectl describe backup <backup-name> -n demo
kubectl delete backup <backup-name> -n demo
kubectl edit backupschedule qdrant-cluster-qdrant-backup-schedule -n demo
To remove all created resources, delete the Qdrant cluster along with its namespace:
kubectl delete cluster qdrant-cluster -n demo
kubectl delete ns demo
This guide demonstrated:
Your Qdrant cluster now has: