Access SQL Server 2019 Linux Database from frontend or API using Kubernetes service name

5/19/2019

I have been using SQL Server 2017 Linux image for quite some time. I am able to deploy this to Azure Kubernetes Service (AKS) cluster with Statefulset and a service name exposed via a Service object. I can then connect to the SQL Server instance using the service name from web API or frontend application. The complete working example of this can be found in the repo https://github.com/NileshGule/AKS-learning-series/tree/master/k8s/AKS

I upgraded to SQL Server 2019 Linux image using the docs https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-kubernetes-manage?view=sqlallproducts-allversions. With the operator and the availability group deployment, I am able to create the database. However, I cannot access the database from the front end and Web API projects without giving in the loadbalancer IP address of the Availability Group primary service.

Is there any way to access the SQL Server 2019 using service discovery without specifying the IP address?

-- Nilesh Gule
azure-aks
kubernetes
sql-server-2019

0 Answers