KubeBlocks
BlogsEnterprise
⌘K
​
Blogs
Enterprise · Production-Grade · Kubernetes-Native

KubeBlocks SQL Server Operator for Kubernetes

Run Microsoft SQL Server 2022 with Always On Availability Groups on Kubernetes. Automated failover via Syncer, full Day-2 operations, and PITR backup — managed by a single enterprise operator.

Enterprise Edition Only — The SQL Server addon is not available in the open-source KubeBlocks distribution. A KubeBlocks Enterprise license is required to deploy and manage SQL Server clusters.

Get Enterprise →
AlwaysOn

HA Technology

PITR

Backup Recovery

Deploy SQL Server in 2 steps

1

Install KubeBlocks Enterprise operator

Contact us to get access → kubeblocks.com/contact

2

Create a SQL Server Cluster

# Requires KubeBlocks Enterprise
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: mssql-cluster
  namespace: demo
spec:
  clusterDef: mssql
  topology: cluster
  terminationPolicy: Delete
  componentSpecs:
    - name: mssql
      replicas: 3
      serviceVersion: "2022.19.0"
      volumeClaimTemplates:
        - name: data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi

Trusted by Engineering Teams at Scale

BONC CloudBONC Cloud
China Mobile CloudChina Mobile Cloud
China Telecom CloudChina Telecom Cloud
TencentTencent
XiaomiXiaomi
Ping AnPing An
VIP.comVIP.com
KwaiKwai
Tiger BrokersTiger Brokers
CITIC SecuritiesCITIC Securities
SealOSSealOS
FastGPTFastGPT
KubeSphereKubeSphere
MomentaMomenta
360360
TilaaTilaa
OlaresOlares
Changan AutomobileChangan Automobile
State GridState Grid
BONC CloudBONC Cloud
China Mobile CloudChina Mobile Cloud
China Telecom CloudChina Telecom Cloud
TencentTencent
XiaomiXiaomi
Ping AnPing An
VIP.comVIP.com
KwaiKwai
Tiger BrokersTiger Brokers
CITIC SecuritiesCITIC Securities
SealOSSealOS
FastGPTFastGPT
KubeSphereKubeSphere
MomentaMomenta
360360
TilaaTilaa
OlaresOlares
Changan AutomobileChangan Automobile
State GridState Grid
SQL Server Topology

Always On AG. Automated Failover.

KubeBlocks deploys SQL Server 2022 with a 3-replica Always On Availability Group. In the default topology, synchronous commit ensures zero data loss on failover. When the primary fails, Syncer promotes a secondary and updates the read-write Service endpoint automatically.

KubeBlocks replaces the traditional Pacemaker/Corosync stack with its own lightweight Syncer component. Syncer continuously monitors replica health and orchestrates failover, making Always On AG fully operational in ephemeral container environments without OS-level cluster dependencies.

AlwaysOn AG with 1 Primary and 2 Secondaries — synchronous replication across all replicas before acknowledging writes (default 3-replica topology)

Automatic failover via KubeBlocks Syncer — detects primary failure and promotes a secondary within seconds, no Pacemaker required

Two dedicated Kubernetes Services: read-write (Primary) on :1433 and read-only (Secondaries) on :1433 for traffic separation

Stable FQDNs via headless Services — AG endpoints use pod DNS names for consistent network identity across pod restarts

Role probing via roleProbe lifecycle action — KubeBlocks always knows which pod is Primary and routes traffic accordingly

Built-in Prometheus metrics exporter sidecar per replica for observability integration

Application Client
Read / Write
Connects to Primary via
mssql-rw Service · :1433
SQL Client
Read Only
Connects to Secondaries via
mssql-ro Service · :1433
SQL Client
automatic failover via Syncer
AlwaysOn Availability Group · :1433 (synchronous replication)
mssql-0Primary
:1433 · Read/Write
AG leader · Syncer
mssql-1Secondary
:1433 · Read Only
Sync replica
mssql-2Secondary
:1433 · Read Only
Sync replica
⬡Always On AGSynchronous replication across all 3 replicas — Syncer detects primary failure and promotes a secondary within seconds
Observability & Backup
Exporter
Prometheus metrics sidecar
per replica pod
Metrics
Backup
Full · Differential · Log
PITR via continuous log backup
DataProtection
SQL Server / AlwaysOn AG
Primary Replica
Secondary / Observability
Day-2 Operations

Full Lifecycle Management. One Operator.

Declare an OpsRequest or Cluster resource and KubeBlocks handles the rest.

High Availability

AlwaysOn AG

Deploy 3-replica AG with synchronous replication; Syncer handles automatic failover

Auto Failover

Primary failure detected by Syncer; secondary promoted and Service endpoint updated within seconds

Read/Write Split

mssql-rw Service routes to Primary; mssql-ro Service load-balances across Secondaries

Rolling Restart

Restart all replicas one at a time without AG disruption

Stop / Start

Suspend the cluster to save resources; resume without data loss

Day-2 Operations

Vertical Scaling

Resize CPU and memory for all replicas via OpsRequest; rolling apply keeps AG online

Volume Expansion

Expand SQL Server data volume via OpsRequest — online expansion requires a StorageClass that supports it

Dynamic Config

Reconfigure mssql.conf parameters via Reconfiguring OpsRequest — some take effect online; others apply via a controlled rolling restart

Full Backup

On-demand or scheduled full database backup to S3-compatible storage

Incremental Backup

Backs up changes since the last full backup — faster and smaller than a full backup

PITR

Transaction-log backup (when enabled, default cron: every minute) enables point-in-time recovery to any second within the retention window

Capabilities

Built for Production SQL Server

KubeBlocks automates the hardest parts of running SQL Server on Kubernetes — so your team doesn't have to.

AlwaysOn AG Automatic Failover
Syncer continuously monitors replica health. When the primary fails, it promotes the most up-to-date secondary and updates the read-write Service endpoint — no Pacemaker required.
RTO < 30s
T+0s — Normal
Healthy
mssql-0
Primary
mssql-1
Secondary
mssql-2
Secondary
T+1s — Failure
Node Down
mssql-0
Failed
mssql-1
Secondary
mssql-2
Secondary
T+5s — Detect
Detecting
mssql-0
Unreachable
mssql-1
Candidate
mssql-2
Secondary
T+15s — Promote
Promoting
mssql-0
Offline
mssql-1
Promoting…
mssql-2
Secondary
T+28s — Recovered
Healthy
mssql-0
Rejoining
mssql-1
Primary ★
mssql-2
Secondary
< 30s
Recovery Time (RTO)
0
Manual Steps Required
Sync
Replication Mode
No human intervention needed. KubeBlocks Syncer continuously monitors AG health, promotes the most up-to-date secondary, and updates the read-write Service endpoint — all without Pacemaker or manual kubectl commands.
From the Blog

Go Deeper on SQL Server on Kubernetes

KubeBlocks x MSSQL: Operator-based Always On AG Revealed

KubeBlocks x MSSQL: Operator-based Always On AG Revealed

How KubeBlocks implements SQL Server Always On AG on Kubernetes — Addon architecture, lifecycle management, and operational walkthrough.

KubeBlocks x MSSQL: High Availability Implementation

KubeBlocks x MSSQL: High Availability Implementation

Inside the Syncer-based HA engine: how KubeBlocks replaces Pacemaker for SQL Server and validates resilience with Chaos Mesh.

SQL Server 2022 on Kubernetes. Enterprise-Grade.

KubeBlocks SQL Server is available as part of KubeBlocks Enterprise. Contact us to get started with Always On AG, PITR backup, and full Day-2 operations on your Kubernetes clusters.

Requires KubeBlocks Enterprise License

Get Enterprise →

© 2026 KUBEBLOCKS INC