Skip to main content
Qdrant Operator logo

Qdrant Operator

A Kubernetes operator for managing Qdrant vector database clusters

CI PyPI Python 3.12+ License: MIT Kubernetes

Documentation • Features • Installation • Usage • Configuration


Features

  • Cluster Management - Deploy and manage Qdrant clusters via Helm
  • Automated Backups - Per-node snapshots streamed to S3-compatible storage, with a manifest
  • CSI Volume Snapshot Backups - Opt-in method: volumeSnapshot snapshots every data volume in seconds instead of streaming through the operator
  • Scheduled Backups - CronJob-style schedules with concurrency and retention policies
  • Disaster Recovery - Restore collections node-by-node from presigned URLs, with optional remapping
  • Declarative Collections - QdrantCollection keeps vectors, payload indexes and aliases in Git and re-creates what was deleted by hand
  • Least-Privilege Tokens - QdrantAccessKey signs Qdrant JWT tokens per collection and writes them into a Secret, renewing before expiry
  • Live Migrations - QdrantMigration copies collections between clusters (or from Qdrant Cloud) without an S3 round trip
  • Admission Validation - CEL rules on every CRD reject impossible specs before the operator sees them
  • Async-First - Built on kopf with fully async adapters for performance

Tested on a real cluster

Every check below ran on managed Kubernetes against 3 Qdrant v1.20.2 nodes holding two collections of 1,000,000 Wikipedia chunks each, with dense, BM25 sparse and payload indexes. Faults were injected by hand; the operator did the rest.

12 of 12 checks passed: self-healing, scaling with rebalancing, online disk resize, operator restarts without pod restarts, collections as code, verified migration, scheduled backup, restore, disruption budget, access keys, HTTPS, metrics

Self-healing. One node lost its pod and its data volume. The operator waited out the crash loop, restored the missing replicas on the other peers, removed the dead peer, and rebalanced once the pod came back empty.

Self-heal timeline: balanced 25m35s after the volume was deleted

Scaling with rebalancing. Replicas move onto a new peer when you scale out. With drainOnScaleDown, a departing peer is emptied, removed from consensus and its volumes deleted before the StatefulSet shrinks.

Scaling 3 to 4 to 3 peers with 1,000,000 points

Migrations that survive outages. The target pod was deleted a quarter of the way through a copy. The migration retried, resumed from its checkpoint and finished with matching counts.

Migration of 100,000 points with a target outage at 24,000

Installation

Prerequisites

  • Kubernetes cluster (v1.26+)
  • Helm 3.x installed
  • kubectl configured with cluster access
# From the OCI registry (published on every release)
helm install qdrant-operator oci://ghcr.io/4thel00z/charts/qdrant-operator -n qdrant-system --create-namespace

# Or from the local chart
helm install qdrant-operator ./charts/qdrant-operator

# Or install in a specific namespace
helm install qdrant-operator ./charts/qdrant-operator -n qdrant-system --create-namespace

# Verify installation
kubectl get pods -l app.kubernetes.io/name=qdrant-operator

Upgrading

Helm installs the CRDs in crds/ once and never updates them. Before helm upgrade, apply the CRDs of the new version (they are attached to every GitHub release):

kubectl apply -f manifests/crds/
helm upgrade qdrant-operator oci://ghcr.io/4thel00z/charts/qdrant-operator -n qdrant-system

Configuration

Override default values:

helm install qdrant-operator ./charts/qdrant-operator \
  --set operator.logLevel=DEBUG \
  --set resources.limits.memory=2Gi

Run several replicas with kopf peering (one active, the rest standby; failover within ha.lifetime, 60 seconds by default):

helm install qdrant-operator ./charts/qdrant-operator --set ha.enabled=true --set replicaCount=2

To watch only some namespaces, set watchNamespaces; the chart then creates a Role and RoleBinding in each of them instead of cluster-wide rules (empty by default, which watches every namespace):

helm install qdrant-operator ./charts/qdrant-operator --set 'watchNamespaces={team-a,team-b}'

Or use a values file:

helm install qdrant-operator ./charts/qdrant-operator -f my-values.yaml

Install from PyPI

The operator is also a Python package; the qdrant-operator command runs it against your kubeconfig, forwarding any extra flags to kopf run (for example --namespace team-a).

uv tool install qdrant-operator   # or: pipx install qdrant-operator
qdrant-operator --help

Container images: ghcr.io/4thel00z/qdrant-operator:<version> (linux/amd64, linux/arm64, signed provenance).

Build Docker Image (Optional)

# Replace with your registry
docker build -t ghcr.io/YOUR_ORG/qdrant-operator:0.1.0 .
docker push ghcr.io/YOUR_ORG/qdrant-operator:0.1.0

Local Development

# Install dependencies
uv sync

# Apply CRDs to cluster
kubectl apply -f manifests/crds/

# Run operator locally against your kubeconfig
make dev

Usage

Create a Qdrant Cluster

apiVersion: qdrant.io/v1alpha1
kind: QdrantCluster
metadata:
  name: my-qdrant
  namespace: default
spec:
  replicas: 3
  version: v1.16.3
  resources:
    requests:
      cpu: "500m"
      memory: "1Gi"
    limits:
      cpu: "2"
      memory: "4Gi"
  persistence:
    size: 10Gi
    storageClassName: standard
  cluster:
    enabled: true

Create a Backup

apiVersion: qdrant.io/v1alpha1
kind: QdrantBackup
metadata:
  name: my-backup
  namespace: default
spec:
  clusterRef:
    name: my-qdrant
  storage:
    s3:
      bucket: my-backups
      prefix: qdrant
      region: us-east-1
      credentialsSecretRef:
        name: s3-credentials
        accessKeyIdKey: AWS_ACCESS_KEY_ID

Schedule Automated Backups

apiVersion: qdrant.io/v1alpha1
kind: QdrantBackupSchedule
metadata:
  name: daily-backup
  namespace: default
spec:
  schedule: "0 2 * * *"  # Daily at 2 AM
  clusterRef:
    name: my-qdrant
  storage:
    s3:
      bucket: my-backups
      prefix: scheduled
      region: us-east-1
      credentialsSecretRef:
        name: s3-credentials
        accessKeyIdKey: AWS_ACCESS_KEY_ID
  retentionPolicy:
    keepLast: 7
    keepDaily: 30
  concurrencyPolicy: Forbid

Restore from Backup

apiVersion: qdrant.io/v1alpha1
kind: QdrantRestore
metadata:
  name: my-restore
  namespace: default
spec:
  backupRef:
    name: my-backup
  targetClusterRef:
    name: my-qdrant-new
  collectionMapping:
    old_collection: new_collection

Declare a Collection

apiVersion: qdrant.io/v1alpha1
kind: QdrantCollection
metadata:
  name: articles
  namespace: default
spec:
  clusterRef:
    name: my-qdrant
  collectionName: Articles        # optional; Qdrant names may use characters Kubernetes names cannot
  vectors:
    - name: text
      size: 768
      distance: Cosine
      memory: cold                # Qdrant 1.19+; use onDisk: true on older releases
    - name: image
      size: 512
      distance: Dot
  sparseVectors:
    - name: bm25
      modifier: idf
  replicationFactor: 2
  optimizers:                     # Qdrant's own field names, passed through
    indexing_threshold: 10000
  payloadIndexes:
    - field: tenant_id
      type: keyword
      params: {is_tenant: true}
    - field: body
      type: text
      params: {tokenizer: word, lowercase: true}
  aliases: [articles-live]
  metadata: {owner: search-team}  # merged into the collection's metadata
  deletionPolicy: Retain          # Delete drops the collection with the resource

Custom sharding declares its keys in the same resource; keys are created when missing and never dropped, because dropping one deletes its points:

spec:
  shardingMethod: custom
  shardNumber: 1                  # shards per key
  shardKeys:
    - key: eu
    - key: us
      replicationFactor: 2

A single entry without name is Qdrant's unnamed vector. Vector size and distance, shardNumber and shardingMethod cannot change on a live collection; a mismatch puts the resource into phase: Degraded with a Ready=False condition instead of silently ignoring the spec. Everything else is patched in place, and only fields you declared are compared. Indexes and aliases the operator did not create are left alone.

Issue a Scoped Token

Requires spec.apiKey.jwtRbac: true on the cluster (tokens are signed with the cluster's API key).

apiVersion: qdrant.io/v1alpha1
kind: QdrantAccessKey
metadata:
  name: billing-reader
  namespace: default
spec:
  clusterRef:
    name: my-qdrant
  collections:                    # or: access: r | m  for cluster-wide tokens
    - name: invoices
      access: r                   # r, rw, or prw (points only, no snapshots or indexes)
  subject: billing-service
  ttl: 720h
  renewBefore: 24h                # default: a third of ttl
  secretName: billing-qdrant      # default: metadata.name

The Secret gets token and url keys and is garbage-collected with the resource. The token is re-issued when the spec changes, the cluster's API key rotates, the Secret disappears, or renewBefore is reached.

Migrate Between Clusters

apiVersion: qdrant.io/v1alpha1
kind: QdrantMigration
metadata:
  name: cloud-to-k8s
  namespace: default
spec:
  source:
    endpoint:                     # or: clusterRef: {name: old-qdrant}
      url: https://xyz.eu-central.aws.cloud.qdrant.io:6333
      apiKeySecretRef: {name: qdrant-cloud, key: api-key}
  targetClusterRef:
    name: my-qdrant
  collections: [articles]         # empty = all
  collectionMapping:
    articles: articles_v2
  batchSize: 500
  batchDelayMs: 0                 # throttle
  ensurePayloadIndexes: true      # also on targets that already exist
  target:                         # for collections the migration creates
    replicationFactor: 2
    # shardKey: tier-a            # route every point to one shard key
    # shardKeyField: tenant       # or route by a payload field

Points are scrolled from the source and upserted on the target, so the run is idempotent and a one-node source can become a three-node target (shard counts follow the target unless set under target). Missing target collections are created from the source configuration, including payload indexes; existing targets must have the same vector sizes and distances. On a custom-sharded target, each point keeps its source shard key (keys are created as they are met) unless routed with target.shardKey / target.shardKeyField; an auto-sharded target receives the points without shard keys. Progress and the scroll offset live in status, so a run interrupted by an operator restart resumes where it stopped.

Configuration

Environment Variables

Variable Description Default
KUBECONFIG Path to kubeconfig file In-cluster config
LOG_LEVEL Logging level INFO
LOG_FORMAT json or text json

S3 Credentials Secret

apiVersion: v1
kind: Secret
metadata:
  name: s3-credentials
type: Opaque
stringData:
  AWS_ACCESS_KEY_ID: "your-access-key"
  AWS_SECRET_ACCESS_KEY: "your-secret-key"

Development

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run integration tests (requires k8s cluster + helm)
make test-integration

# Run end-to-end tests against the operator deployed on kind
make e2e-image e2e-deploy test-e2e

# Lint and format
uv run ruff check src tests
uv run ruff format src tests

# Type checking
uv run pyright src tests

Releasing

CI (.github/workflows/ci.yml) runs lint, pyright, unit tests, chart lint, a wheel/image build, the adapter integration suite on kind and an end-to-end run of the operator deployed by its chart on kind, on every push and pull request.

Releases are driven by release-please from the conventional commit history, all inside .github/workflows/release.yml on pushes to main:

  1. A release PR is kept up to date that bumps pyproject.toml and Chart.yaml, refreshes uv.lock and updates CHANGELOG.md.
  2. Merging that PR creates the vX.Y.Z tag and the GitHub release, and the same run publishes the wheel and sdist to PyPI (trusted publishing, no token), pushes the multi-arch image and the Helm chart to ghcr.io, and attaches the artifacts and CRDs to the release.

No secrets are involved beyond the default GITHUB_TOKEN; the repository setting Allow GitHub Actions to create and approve pull requests must be on for the release PR to appear.

License

MIT License - see LICENSE for details.

Metadata

Release files for qdrant-operator 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qdrant-operator 0.6.1
File Size Uploaded Provenance Actions
qdrant_operator-0.6.1.tar.gz 72.9 kB With provenance Details for qdrant_operator-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qdrant-operator 0.6.1
File Interpreter ABI Platform Actions
qdrant_operator-0.6.1-py3-none-any.whl Python 3 none any Details for qdrant_operator-0.6.1-py3-none-any.whl

Total release size: 151.3 kB

Release files / qdrant_operator-0.6.1.tar.gz

Download URL qdrant_operator-0.6.1.tar.gz
Size 72.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1b0813b0e629fb5b56857810efa0cc94f214eda3d140fde1cc7cc7537b2e6d24
BLAKE2b-256 checksum
How to use checksums
b54eb8c25aa9e465cc0e2574a3461bcbf9d9889559dde66d95d6e145461c5225
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / qdrant_operator-0.6.1-py3-none-any.whl

Download URL qdrant_operator-0.6.1-py3-none-any.whl
Size 78.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf4e1e6b4126a865e5d145cf4b685fa081b6e279d94960ce529410b3f6b3a2cd
BLAKE2b-256 checksum
How to use checksums
929a377fae5fe3398cbe688e3b817f61575ff2824c4c6edd87e12a5e20e3db60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for qdrant-operator 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qdrant_operator-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page