Upgrading Qdrant for KnowledgeBases
The agent-orca operator deploys a dedicated Qdrant StatefulSet for each KnowledgeBase. Starting with this release, the operator automatically manages Qdrant version upgrades using a sequential minor-version walk.
How It Works
- The operator derives its target Qdrant version from the compiled
github.com/qdrant/go-clientmodule version (or the Helmqdrant.image.tagoverride). - On each reconcile, it probes the running Qdrant version via the HTTP root endpoint (
GET /on port 6333). - If the running version is behind the target, the operator walks through each intermediate minor version one step at a time:
- Creates a collection snapshot before each step
- Patches the StatefulSet container image to the next minor version
- Waits for the pod to become ready
- Re-probes the version and repeats until the target is reached
This is necessary because Qdrant only guarantees storage migration between consecutive minor versions. Skipping minors (e.g. v1.12 → v1.17) can fail or corrupt data.
Monitoring Upgrade Progress
# Watch version and upgrade state
kubectl get knowledgebase my-kb -o jsonpath='{.status.qdrantVersion}'
kubectl get knowledgebase my-kb -o jsonpath='{.status.qdrantTargetVersion}'
kubectl get knowledgebase my-kb -o jsonpath='{.status.qdrantUpgradeState}'
# Check conditions
kubectl get knowledgebase my-kb -o jsonpath='{.status.conditions}' | jq .Conditions set during upgrades:
| Condition | When |
|---|---|
QdrantUpgrading=True | An upgrade step is in progress |
QdrantUpgradeAvailable=True | A version gap exists but autoUpgrade is disabled |
QdrantUpgrading=False, Reason=UpgradeFailed | A step failed; rolled back to previous version |
The Qdrant column in kubectl get knowledgebase shows the running version.
Holding Upgrades
Set autoUpgrade: false on the KnowledgeBase spec to prevent automatic upgrades. The operator will still report the version gap via the QdrantUpgradeAvailable condition but will not modify the StatefulSet.
apiVersion: agentorca.agentorca.io/v1alpha1
kind: KnowledgeBase
metadata:
name: my-kb
spec:
vectorStore:
autoUpgrade: false
# ...To resume automatic upgrades, set autoUpgrade: true (or remove the field; the default is true).
Failure Handling
If a Qdrant pod enters CrashLoopBackOff after an image update and remains failing for 5 minutes, the operator:
- Reverts the StatefulSet image to the previously running version
- Sets
QdrantUpgradeStatetoFailed - Sets condition
QdrantUpgrading=Falsewith reasonUpgradeFailed
The operator will not retry automatically. To retry after investigating:
- Fix the underlying issue (check pod logs, storage, etc.)
- Toggle
autoUpgradefromfalsetotrueon the KnowledgeBase spec
If a snapshot fails before the upgrade can begin, the state is also set to Failed with a descriptive condition message. No image change is made.
Manual Override
If you need to manage Qdrant versions independently:
- Set
autoUpgrade: falseon the KnowledgeBase - Override the image via Helm or direct StatefulSet patch:
kubectl set image statefulset/kb-qdrant-my-kb \
qdrant=qdrant/qdrant:v1.14.1 -n defaultRemember to step through consecutive minor versions manually.
Helm-Level Override
To set the target version for all new KnowledgeBases at operator deploy time:
qdrant:
image:
tag: "v1.17.1"The auto-upgrade mechanism uses this value as its target for existing KnowledgeBases as well.
