Skip to content

Commit bdf1d96

Browse files
committed
Add rebalanceStrategy in QdrantCluster sepc
1 parent 0c42ae0 commit bdf1d96

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

Diff for: api/v1/qdrantcluster_types.go

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ const (
8282
GPUTypeAmd GPUType = "amd"
8383
)
8484

85+
type RebalanceStrategy string
86+
87+
//goland:noinspection GoUnusedConst
88+
const (
89+
ByCount RebalanceStrategy = "by_count"
90+
BySize RebalanceStrategy = "by_size"
91+
ByCountAndSize RebalanceStrategy = "by_count_and_size"
92+
)
93+
8594
// QdrantClusterSpec defines the desired state of QdrantCluster
8695
// +kubebuilder:pruning:PreserveUnknownFields
8796
type QdrantClusterSpec struct {
@@ -162,6 +171,9 @@ type QdrantClusterSpec struct {
162171
// to inspect the attached storage.
163172
// +optional
164173
StartupDelaySeconds *int `json:"startupDelaySeconds,omitempty"`
174+
// RebalanceStrategy specifies the strategy to use for automaticially rebalancing shards the cluster.
175+
// +optional
176+
RebalanceStrategy *RebalanceStrategy `json:"rebalanceStrategy,omitempty"`
165177
}
166178

167179
// Validate if there are incorrect settings in the CRD

Diff for: api/v1/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ spec:
565565
the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
566566
type: string
567567
type: object
568+
rebalanceStrategy:
569+
description: RebalanceStrategy specifies the strategy to use for automaticially
570+
rebalancing shards the cluster.
571+
type: string
568572
resources:
569573
description: Resources specifies the resources to allocate for each
570574
Qdrant node.

Diff for: crds/qdrant.io_qdrantclusters.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ spec:
564564
the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
565565
type: string
566566
type: object
567+
rebalanceStrategy:
568+
description: RebalanceStrategy specifies the strategy to use for automaticially
569+
rebalancing shards the cluster.
570+
type: string
567571
resources:
568572
description: Resources specifies the resources to allocate for each
569573
Qdrant node.

Diff for: docs/api.md

+14
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ _Appears in:_
733733
| `podDisruptionBudget` _[PodDisruptionBudgetSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#poddisruptionbudgetspec-v1-policy)_ | PodDisruptionBudget specifies the pod disruption budget for the cluster. | | |
734734
| `restartAllPodsConcurrently` _boolean_ | RestartAllPodsConcurrently specifies whether to restart all pods concurrently (also called one-shot-restart).<br />If enabled, all the pods in the cluster will be restarted concurrently in situations where multiple pods<br />need to be restarted like when RestartedAtAnnotationKey is added/updated or the Qdrant version need to be upgraded.<br />This helps sharded but not replicated clusters to reduce downtime to possible minimum during restart. | | |
735735
| `startupDelaySeconds` _integer_ | If StartupDelaySeconds is set (> 0), an additional 'sleep <value>' will be emitted to the pod startup.<br />The sleep will be added when a pod is restarted, it will not force any pod to restart.<br />This feature can be used for debugging the core, e.g. if a pod is in crash loop, it provided a way<br />to inspect the attached storage. | | |
736+
| `rebalanceStrategy` _[RebalanceStrategy](#rebalancestrategy)_ | RebalanceStrategy specifies the strategy to use for automaticially rebalancing shards the cluster. | | |
736737

737738

738739

@@ -1023,6 +1024,19 @@ _Appears in:_
10231024
| `fsGroup` _integer_ | FsGroup specifies file system group to run the Qdrant process as. | | |
10241025

10251026

1027+
#### RebalanceStrategy
1028+
1029+
_Underlying type:_ _string_
1030+
1031+
1032+
1033+
1034+
1035+
_Appears in:_
1036+
- [QdrantClusterSpec](#qdrantclusterspec)
1037+
1038+
1039+
10261040
#### RegionCapabilities
10271041

10281042

0 commit comments

Comments
 (0)