Availability Group
The availabilityGroup topology deploys an Always-On Availability Group: a set
of SQL Server replicas joined into a quorum-based cluster with automatic
failover. It maps to the operator's
MSSQLAvailabilityGroup resource.
Clients write to the <name>-primary Service and can read from the
<name>-replicas Service. When the primary fails, the operator promotes a
secondary and the Services follow the new roles.
Requirements
- At least 2 replicas (3 is the recommended minimum for a healthy quorum).
- An edition that supports Always-On:
Developer,Standard,Enterprise, orEnterpriseCore.Expressis not supported.
Example
apiVersion: core.openeverest.io/v1alpha1
kind: Instance
metadata:
name: example-ag
spec:
providerRef:
name: mssql
version: "2022"
topology:
type: availabilityGroup
parameters:
# synchronous (zero data loss) or asynchronous (lower latency)
availabilityMode: synchronous
# all | readOnly | no — whether secondaries accept read traffic
readableSecondaries: all
components:
engine:
replicas: 3
resources:
limits:
cpu: "2"
memory: 4Gi
storage:
size: 20Gi
parameters:
edition: Developer
# Reference a dockerconfigjson Secret you created in the namespace.
imagePullSecrets:
- ghcr-pull-secret
Topology parameters
Set under spec.topology.parameters:
| Parameter | Values | Default | Description |
|---|---|---|---|
availabilityMode | synchronous, asynchronous | synchronous | synchronous guarantees zero data loss; asynchronous favors lower latency. |
readableSecondaries | all, readOnly, no | all | Whether secondary replicas serve read traffic via the <name>-replicas Service. |
How replication works
Connecting
Write to the <name>-primary Service and read from <name>-replicas. See
Connecting for details and connection strings.
See also
- Standalone — the single-instance topology.
- Operator: Always-On Availability Groups.