Skip to main content

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, or EnterpriseCore. Express is 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:

ParameterValuesDefaultDescription
availabilityModesynchronous, asynchronoussynchronoussynchronous guarantees zero data loss; asynchronous favors lower latency.
readableSecondariesall, readOnly, noallWhether 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​