Sql Server cluster on K8S

Jack Chuong 331 Reputation points
2023-12-28T10:10:41.2133333+00:00

Hi all,

I am learning about deploying sql server on k8s.

I have read documents as below:

https://pradeepl.com/blog/kubernetes/deploying-sql-server-on-kubernetes/ https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-kubernetes-best-practices-statefulsets?view=sql-server-ver16 https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-containers-deploy-helm-charts-kubernetes?view=sql-server-ver16 https://github.com/microsoft/mssql-docker/tree/master/linux/sample-helm-chart-statefulset-deployment

It seems that, when installing sql server on k8s using helm or yaml manifest, statefulset or deployment with replicas > 1, the pods created are just separate sql server instances unrelated to each other, if I want to configure master-slave or always-on, it must be configured manually later?
Is there a sql operator or something like that ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,755 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,865 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Anveshreddy Nimmala 2,465 Reputation points Microsoft Vendor
    2023-12-29T05:20:19.91+00:00

    Hello Jack Chuong.

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    it's great to hear that you are learning about deploying SQL Server on Kubernetes.it seems that you are correct in your understanding that when installing SQL Server on Kubernetes using Helm or YAML manifest,the pods created are separate SQL Server instances that are not related to each other. If you want to configure master-slave or alwayson, you will need to configure it manually later.

    Regarding your question about a SQL operator.

    There is a SQL Server operator for Kubernetes that is currently in preview. The SQL Server operator for Kubernetes is a Kubernetes-native way to deploy, manage, and scale SQL Server. It provides a declarative way to define and manage SQL Server instances as Kubernetes resources. You can find more information about the SQL Server operator for Kubernetes in below link.

    https://learn.microsoft.com/en-us/sql/linux/quickstart-sql-server-containers-azure?view=sql-server-ver16&tabs=kubectl

    Hope this helps you.


  2. Don Boxley 0 Reputation points
    2024-04-23T17:12:23.95+00:00

    Hello Jack Chuong,

    Just wanted to let you that you can use the following preferred SQL Server Operator for Kubernetes to get up and running.

    Also take a look at the following MS blog about using the operator to build a SQL Server AG in K8s in under 3 mins.

    Cheers 😎

    0 comments No comments