From 67165d136193fe4283161326b1baaf76506dfcd1 Mon Sep 17 00:00:00 2001 From: vsamidurai Date: Fri, 22 May 2026 09:00:08 +0100 Subject: [PATCH] add multi-az routing support - add MultiAz flag to enable multi-az routing for cluster span across different zones - add MultiAz flag to indicate multi-az cluster in QC customResource CRC-1963 --- api/routing/v1alpha1/envoybootstrapconfig_types.go | 7 +++++++ api/routing/v1alpha1/routing_types.go | 5 +++++ api/v1/qdrantcluster_types.go | 8 ++++++++ .../templates/region-crds/qdrant.io_qdrantclusters.yaml | 9 +++++++++ .../routing.qdrant.io_envoybootstrapconfigs.yaml | 8 ++++++++ .../routing.qdrant.io_qdrantclusterroutes.yaml | 6 ++++++ crds/qdrant.io_qdrantclusters.yaml | 9 +++++++++ docs/api.md | 3 +++ 8 files changed, 55 insertions(+) diff --git a/api/routing/v1alpha1/envoybootstrapconfig_types.go b/api/routing/v1alpha1/envoybootstrapconfig_types.go index 4922c77..34d85c0 100644 --- a/api/routing/v1alpha1/envoybootstrapconfig_types.go +++ b/api/routing/v1alpha1/envoybootstrapconfig_types.go @@ -42,6 +42,13 @@ type EnvoyBootstrapConfigSpec struct { // +kubebuilder:default=false // +optional ProxyProtocolEnabled bool `json:"proxyProtocolEnabled,omitempty"` + // MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true, + // the route-manager advertises this fact to Envoy via node metadata so that + // zone-aware routing decisions can be made per-cluster via + // QdrantClusterRouting.spec.multiAZ. + // +kubebuilder:default=false + // +optional + MultiAZ bool `json:"multiAZ,omitempty"` } // EnvoyBootstrapConfigStatus defines the observed state of EnvoyBootstrapConfig. diff --git a/api/routing/v1alpha1/routing_types.go b/api/routing/v1alpha1/routing_types.go index fcdea33..d6cc8e3 100644 --- a/api/routing/v1alpha1/routing_types.go +++ b/api/routing/v1alpha1/routing_types.go @@ -59,6 +59,11 @@ type QdrantClusterRoutingSpec struct { // If true enable (proxy) access log for this qdrant cluster. // +optional EnableAccessLog *bool `json:"enableAccessLog,omitempty"` + // MultiAZ is true when the Qdrant cluster spans multiple availability + // zones and traffic should be kept same-zone where possible. + // +kubebuilder:default=false + // +optional + MultiAZ bool `json:"multiAZ,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/api/v1/qdrantcluster_types.go b/api/v1/qdrantcluster_types.go index 6cee691..d1f098c 100644 --- a/api/v1/qdrantcluster_types.go +++ b/api/v1/qdrantcluster_types.go @@ -153,6 +153,14 @@ type QdrantClusterSpec struct { // WriteCluster specifies the write cluster for this cluster. This configures the NetworkPolicy to allow egress to the write cluster. // +optional WriteCluster *WriteCluster `json:"writeCluster,omitempty"` + // MultiAZ indicates that this cluster spans multiple availability zones + // and traffic should be kept same-zone where possible. When true, the + // operator propagates the flag to the generated QdrantClusterRouting so + // the route-manager enables zone-aware load balancing on the Envoy + // clusters that front this Qdrant cluster. + // +kubebuilder:default=false + // +optional + MultiAZ bool `json:"multiAZ,omitempty"` } // Validate if there are incorrect settings in the CRD diff --git a/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml b/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml index 9058070..5e2fc40 100644 --- a/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml +++ b/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml @@ -510,6 +510,15 @@ spec: type: array type: object type: object + multiAZ: + default: false + description: |- + MultiAZ indicates that this cluster spans multiple availability zones + and traffic should be kept same-zone where possible. When true, the + operator propagates the flag to the generated QdrantClusterRouting so + the route-manager enables zone-aware load balancing on the Envoy + clusters that front this Qdrant cluster. + type: boolean nodeSelector: additionalProperties: type: string diff --git a/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_envoybootstrapconfigs.yaml b/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_envoybootstrapconfigs.yaml index 6fe6e6c..fd5aab4 100644 --- a/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_envoybootstrapconfigs.yaml +++ b/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_envoybootstrapconfigs.yaml @@ -65,6 +65,14 @@ spec: When set the Envoy runs in dedicated mode for this cluster. When nil it runs in shared mode. type: string + multiAZ: + default: false + description: |- + MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true, + the route-manager advertises this fact to Envoy via node metadata so that + zone-aware routing decisions can be made per-cluster via + QdrantClusterRouting.spec.multiAZ. + type: boolean proxyProtocolEnabled: default: false description: ProxyProtocolEnabled enables the PROXY protocol on Envoy diff --git a/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_qdrantclusterroutes.yaml b/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_qdrantclusterroutes.yaml index 2aa8a0b..992433e 100644 --- a/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_qdrantclusterroutes.yaml +++ b/charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_qdrantclusterroutes.yaml @@ -88,6 +88,12 @@ spec: The fully qualified domain name (also know as host). For shared routing this will be used for SNI resolving. type: string + multiAZ: + default: false + description: |- + MultiAZ is true when the Qdrant cluster spans multiple availability + zones and traffic should be kept same-zone where possible. + type: boolean nodeIndexes: description: NodeIndexes specifies the indexes of the individual nodes in the cluster. diff --git a/crds/qdrant.io_qdrantclusters.yaml b/crds/qdrant.io_qdrantclusters.yaml index 8ae2c61..d6ae1bf 100644 --- a/crds/qdrant.io_qdrantclusters.yaml +++ b/crds/qdrant.io_qdrantclusters.yaml @@ -509,6 +509,15 @@ spec: type: array type: object type: object + multiAZ: + default: false + description: |- + MultiAZ indicates that this cluster spans multiple availability zones + and traffic should be kept same-zone where possible. When true, the + operator propagates the flag to the generated QdrantClusterRouting so + the route-manager enables zone-aware load balancing on the Envoy + clusters that front this Qdrant cluster. + type: boolean nodeSelector: additionalProperties: type: string diff --git a/docs/api.md b/docs/api.md index b57ffbe..63e83e1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -980,6 +980,7 @@ _Appears in:_ | `rebalanceStrategy` _[RebalanceStrategy](#rebalancestrategy)_ | RebalanceStrategy specifies the strategy to use for automaticially rebalancing shards the cluster.
Cluster-manager needs to be enabled for this feature to work. | | Enum: [by_count by_size by_count_and_size]
Optional: \{\}
| | `readClusters` _[ReadCluster](#readcluster) array_ | ReadClusters specifies the read clusters for this cluster to synchronize.
Cluster-manager needs to be enabled for this feature to work. | | Optional: \{\}
| | `writeCluster` _[WriteCluster](#writecluster)_ | WriteCluster specifies the write cluster for this cluster. This configures the NetworkPolicy to allow egress to the write cluster. | | Optional: \{\}
| +| `multiAZ` _boolean_ | MultiAZ indicates that this cluster spans multiple availability zones
and traffic should be kept same-zone where possible. When true, the
operator propagates the flag to the generated QdrantClusterRouting so
the route-manager enables zone-aware load balancing on the Envoy
clusters that front this Qdrant cluster. | false | Optional: \{\}
| @@ -1738,6 +1739,7 @@ _Appears in:_ | --- | --- | --- | --- | | `clusterID` _string_ | ClusterID identifies the Qdrant cluster this Envoy instance serves.
When set the Envoy runs in dedicated mode for this cluster.
When nil it runs in shared mode. | | Optional: \{\}
| | `proxyProtocolEnabled` _boolean_ | ProxyProtocolEnabled enables the PROXY protocol on Envoy listeners. | false | Optional: \{\}
| +| `multiAZ` _boolean_ | MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true,
the route-manager advertises this fact to Envoy via node metadata so that
zone-aware routing decisions can be made per-cluster via
QdrantClusterRouting.spec.multiAZ. | false | Optional: \{\}
| @@ -1786,6 +1788,7 @@ _Appears in:_ | `nodeIndexes` _integer array_ | NodeIndexes specifies the indexes of the individual nodes in the cluster. | | | | `allowedSourceRanges` _string array_ | AllowedSourceRanges specifies the allowed CIDR source ranges for the ingress. | | Optional: \{\}
| | `enableAccessLog` _boolean_ | If true enable (proxy) access log for this qdrant cluster. | | Optional: \{\}
| +| `multiAZ` _boolean_ | MultiAZ is true when the Qdrant cluster spans multiple availability
zones and traffic should be kept same-zone where possible. | false | Optional: \{\}
|