microsoft / microsoft/sql-server-samples
Unable to connect to primary with Kubernetes Service ag1-primary on AWS EKS
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 11.2k
- Forks
- 9.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
I have successfully followed this guide to create am HA SQL cluster on Kubernetes.
The guide uses AKS but states that any Kubernetes cluster can be used. I am using EKS. Specifically, I used this Terraform module to provision an EKS cluster in a VPC in a private subnet.
I am using internal ELBs for the LoadBalancer. I can successfully connect to each intance, but am unable to connect to SQL using the primary-ag1 k8s service.
I get the following error:

One thing i noticed in the service is the selector points to a Microsoft API:
selector: {role.ag.mssql.microsoft.com/ag1: primary, type: sqlservr}
Could this be the issue as I'm not running in AKS?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the ag1-primary Kubernetes Service in the issue with the Microsoft SQL Server HA guide and inspect its selector and endpoints on EKS. Verify whether the primary service resolves to the intended SQL instance and whether the internal LoadBalancer behaves as expected. Done means identifying the EKS-specific cause and documenting or correcting the configuration needed to connect to the primary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, kubernetes, sql
- Domain
- cloud, databases, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100