Deploy Dragonfly Vector Database on CoreWeave Kubernetes Service (CKS)
This tutorial explains how to deploy Dragonfly, an open-source vector database built for GenAI applications, on CoreWeave Kubernetes Service (CKS). By the end, you have a running Dragonfly cluster managed by the Dragonfly Operator. The cluster is configured with automated snapshotting to persistent storage, and reachable from your local machine through a Redis-compatible client.This tutorial is for platform engineers and ML practitioners who want a low-latency, Redis-compatible in-memory store to back GenAI workloads on CKS.
Before you start, you need a working CKS cluster, ideally with CPU Nodes. You can also use a GPU Node cluster, but Dragonfly has no capability that would benefit from GPUs.You’ll need the following tools on your local machine:
kubectl installed and configured for your cluster.
Before deploying Dragonfly, confirm that your local tooling can reach the cluster and that the cluster has Nodes suitable for running the database.
Verify that you can access your cluster with kubectl. For example:
kubectl cluster-info
You should see something similar to:
Kubernetes control plane is running at...CoreDNS is running at...node-local-dns is running at...
Verify your cluster has at least one CPU Node. GPU Nodes are also supported, but CPU Nodes are preferred since Dragonfly cannot use GPUs for any of its functionality. For example:
kubectl get nodes -o=custom-columns="NAME:metadata.name,CLASS:metadata.labels['node\.coreweave\.cloud\/class']"
You should see something similar to the following:
NAME CLASSg137a10 gpug5424e0 cpug77575e cpugd926d4 gpu
This installs the Dragonfly Custom Resource Definition (CRD), which defines Dragonfly clusters, along with the Operator that manages them. It creates a new namespace called dragonfly-operator-system for the Operator itself.You can add dragonfly-operator as a dependency to the CoreWeave chart, which you download in the next step. However, installing it in a separate namespace from the database is preferred. The Operator can manage multiple Dragonfly clusters in different namespaces.
Edit the chart’s values.yaml with your details. None of the values in values.yaml must be changed, but you can adjust them for your specific use case. Keep the following principles in mind:
Dragonfly allocates 80% of the limit memory.
If the CPU limit is set, the I/O threads are equal to it.
If the CPU limit is not set, all visible cores are used.
If the CPU limit is not set and the proactor threads parameter is set, the parameter is used.
Provisioning a secret for the database password. You can also specify one of your own through the dbPassword attribute in values.yaml, or provide an existing secret containing the password through existingDbPasswordSecretName.
Setting Node affinities for the Dragonfly Pods to CPU Nodes. Pods will be scheduled onto GPU Nodes if no CPU Nodes are available.
For example:
affinity: # prefer running on CPU nodes, if available nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 preference: matchExpressions: - key: node.coreweave.cloud/class operator: In values: - cpu
By default, the chart configures Dragonfly to maintain a single snapshot file and provisions a sidecar container that copies the snapshot to a persistent volume. You can control the scheduling of the snapshot copy job through snapshotMoveCron.
Snapshots will accumulateSnapshots are not pruned, regardless of which mechanism you use (timestamped snapshots or scheduled snapshot copies). They accumulate on your volume unless you clean out unneeded ones periodically.
Alternatively, you can specify a database file name as an argument. The effect is that a single snapshot is kept with that name. The cron expression governs the timing of creating that snapshot.
Connect to the database at localhost:27017. You can use any Redis client, such as the Redis CLI, to connect:
redis-cli -h localhost -p 27017
Authenticate before you read or write keys. Replace [YOUR-PASSWORD] with your Dragonfly password:
Example session
localhost:27017> GET 1(error) NOAUTH Authentication required.localhost:27017> AUTH [YOUR-PASSWORD]OKlocalhost:27017> GET 1(nil)
If you didn’t specify your own password, you can get the password by looking at the cw-dragonfly-db-password secret in the dragonfly namespace. Note the password is base64 encoded.
You now have a running Dragonfly cluster on CKS, managed by the Dragonfly Operator, with snapshotting configured to a VAST-backed persistent volume and reachable from your local machine through a Redis-compatible client.