Skip to content

Commit d0529e2

Browse files
authored
add multi-az routing support (#268)
- 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
1 parent 40a7627 commit d0529e2

8 files changed

Lines changed: 55 additions & 0 deletions

File tree

api/routing/v1alpha1/envoybootstrapconfig_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ type EnvoyBootstrapConfigSpec struct {
4242
// +kubebuilder:default=false
4343
// +optional
4444
ProxyProtocolEnabled bool `json:"proxyProtocolEnabled,omitempty"`
45+
// MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true,
46+
// the route-manager advertises this fact to Envoy via node metadata so that
47+
// zone-aware routing decisions can be made per-cluster via
48+
// QdrantClusterRouting.spec.multiAZ.
49+
// +kubebuilder:default=false
50+
// +optional
51+
MultiAZ bool `json:"multiAZ,omitempty"`
4552
}
4653

4754
// EnvoyBootstrapConfigStatus defines the observed state of EnvoyBootstrapConfig.

api/routing/v1alpha1/routing_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ type QdrantClusterRoutingSpec struct {
5959
// If true enable (proxy) access log for this qdrant cluster.
6060
// +optional
6161
EnableAccessLog *bool `json:"enableAccessLog,omitempty"`
62+
// MultiAZ is true when the Qdrant cluster spans multiple availability
63+
// zones and traffic should be kept same-zone where possible.
64+
// +kubebuilder:default=false
65+
// +optional
66+
MultiAZ bool `json:"multiAZ,omitempty"`
6267
}
6368

6469
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

api/v1/qdrantcluster_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ type QdrantClusterSpec struct {
153153
// WriteCluster specifies the write cluster for this cluster. This configures the NetworkPolicy to allow egress to the write cluster.
154154
// +optional
155155
WriteCluster *WriteCluster `json:"writeCluster,omitempty"`
156+
// MultiAZ indicates that this cluster spans multiple availability zones
157+
// and traffic should be kept same-zone where possible. When true, the
158+
// operator propagates the flag to the generated QdrantClusterRouting so
159+
// the route-manager enables zone-aware load balancing on the Envoy
160+
// clusters that front this Qdrant cluster.
161+
// +kubebuilder:default=false
162+
// +optional
163+
MultiAZ bool `json:"multiAZ,omitempty"`
156164
}
157165

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

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,15 @@ spec:
510510
type: array
511511
type: object
512512
type: object
513+
multiAZ:
514+
default: false
515+
description: |-
516+
MultiAZ indicates that this cluster spans multiple availability zones
517+
and traffic should be kept same-zone where possible. When true, the
518+
operator propagates the flag to the generated QdrantClusterRouting so
519+
the route-manager enables zone-aware load balancing on the Envoy
520+
clusters that front this Qdrant cluster.
521+
type: boolean
513522
nodeSelector:
514523
additionalProperties:
515524
type: string

charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_envoybootstrapconfigs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ spec:
6565
When set the Envoy runs in dedicated mode for this cluster.
6666
When nil it runs in shared mode.
6767
type: string
68+
multiAZ:
69+
default: false
70+
description: |-
71+
MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true,
72+
the route-manager advertises this fact to Envoy via node metadata so that
73+
zone-aware routing decisions can be made per-cluster via
74+
QdrantClusterRouting.spec.multiAZ.
75+
type: boolean
6876
proxyProtocolEnabled:
6977
default: false
7078
description: ProxyProtocolEnabled enables the PROXY protocol on Envoy

charts/qdrant-kubernetes-api/templates/routing-crds/routing.qdrant.io_qdrantclusterroutes.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ spec:
8888
The fully qualified domain name (also know as host).
8989
For shared routing this will be used for SNI resolving.
9090
type: string
91+
multiAZ:
92+
default: false
93+
description: |-
94+
MultiAZ is true when the Qdrant cluster spans multiple availability
95+
zones and traffic should be kept same-zone where possible.
96+
type: boolean
9197
nodeIndexes:
9298
description: NodeIndexes specifies the indexes of the individual nodes
9399
in the cluster.

crds/qdrant.io_qdrantclusters.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,15 @@ spec:
509509
type: array
510510
type: object
511511
type: object
512+
multiAZ:
513+
default: false
514+
description: |-
515+
MultiAZ indicates that this cluster spans multiple availability zones
516+
and traffic should be kept same-zone where possible. When true, the
517+
operator propagates the flag to the generated QdrantClusterRouting so
518+
the route-manager enables zone-aware load balancing on the Envoy
519+
clusters that front this Qdrant cluster.
520+
type: boolean
512521
nodeSelector:
513522
additionalProperties:
514523
type: string

docs/api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ _Appears in:_
980980
| `rebalanceStrategy` _[RebalanceStrategy](#rebalancestrategy)_ | RebalanceStrategy specifies the strategy to use for automaticially rebalancing shards the cluster.<br />Cluster-manager needs to be enabled for this feature to work. | | Enum: [by_count by_size by_count_and_size] <br />Optional: \{\} <br /> |
981981
| `readClusters` _[ReadCluster](#readcluster) array_ | ReadClusters specifies the read clusters for this cluster to synchronize.<br />Cluster-manager needs to be enabled for this feature to work. | | Optional: \{\} <br /> |
982982
| `writeCluster` _[WriteCluster](#writecluster)_ | WriteCluster specifies the write cluster for this cluster. This configures the NetworkPolicy to allow egress to the write cluster. | | Optional: \{\} <br /> |
983+
| `multiAZ` _boolean_ | MultiAZ indicates that this cluster spans multiple availability zones<br />and traffic should be kept same-zone where possible. When true, the<br />operator propagates the flag to the generated QdrantClusterRouting so<br />the route-manager enables zone-aware load balancing on the Envoy<br />clusters that front this Qdrant cluster. | false | Optional: \{\} <br /> |
983984

984985

985986

@@ -1738,6 +1739,7 @@ _Appears in:_
17381739
| --- | --- | --- | --- |
17391740
| `clusterID` _string_ | ClusterID identifies the Qdrant cluster this Envoy instance serves.<br />When set the Envoy runs in dedicated mode for this cluster.<br />When nil it runs in shared mode. | | Optional: \{\} <br /> |
17401741
| `proxyProtocolEnabled` _boolean_ | ProxyProtocolEnabled enables the PROXY protocol on Envoy listeners. | false | Optional: \{\} <br /> |
1742+
| `multiAZ` _boolean_ | MultiAZ marks this Envoy fleet as the multi-AZ load balancer. When true,<br />the route-manager advertises this fact to Envoy via node metadata so that<br />zone-aware routing decisions can be made per-cluster via<br />QdrantClusterRouting.spec.multiAZ. | false | Optional: \{\} <br /> |
17411743

17421744

17431745

@@ -1786,6 +1788,7 @@ _Appears in:_
17861788
| `nodeIndexes` _integer array_ | NodeIndexes specifies the indexes of the individual nodes in the cluster. | | |
17871789
| `allowedSourceRanges` _string array_ | AllowedSourceRanges specifies the allowed CIDR source ranges for the ingress. | | Optional: \{\} <br /> |
17881790
| `enableAccessLog` _boolean_ | If true enable (proxy) access log for this qdrant cluster. | | Optional: \{\} <br /> |
1791+
| `multiAZ` _boolean_ | MultiAZ is true when the Qdrant cluster spans multiple availability<br />zones and traffic should be kept same-zone where possible. | false | Optional: \{\} <br /> |
17891792

17901793

17911794

0 commit comments

Comments
 (0)