Create a SQL Server AG via Helm
This guide shows you how to create a SQL Server Availability Group (AG) with Helm by modifying the values.yaml and installing the DxSqlAg chart.
Prerequisites
- A Kubernetes cluster with DxOperator v2 installed. See the DxOperator Helm Installation Guide for more information.
- A valid DxEnterprise license with availability group management features and tunnels enabled. A fully featured Developer Edition is available free for non-production use. To purchase DxEnterprise software for production workloads, please contact us.
Install the Chart
-
Create secrets for the DxEnterprise passkey and license key, and the SQL Server SA account.
kubectl create secret generic dxe --from-literal=DX_PASSKEY=<password> --from-literal=DX_LICENSE=<license_key>kubectl create secret generic mssql --from-literal=MSSQL_SA_PASSWORD=<password> -
Inspect and save the
values.yamlchart from the Helm repo.helm show values dh2i/dxsqlag > values.yaml -
Open the
values.yamlfile for editing using a text editor. -
From within the text editor, change the values below and save the changes.
values.yamldxEnterpriseContainer:
acceptEula: true
clusterSecret: dxe
sqlServerContainer:
acceptEula: true
mssqlSecret: mssqlSECURITY CAUTION: Avoid Default SQL Server Port for Availability GroupsFor security best practices, do not use the default SQL Server port (1433) when configuring SQL Server Availability Groups in production environments. Using the default port can expose your instance to automated scanning and brute-force attacks. In production environments, it is strongly recommended to configure a non-standard port to reduce the attack surface and improve security posture. For more information on configuring SQL Server to use a non-default port, see: Configure SQL Server's Listening Port
You may also add the
mssqlConfigMapdirectly here:infoSee the Microsoft documentation for all supported variables for MSSQL.
values.yamlmssqlConfigMap: |
[network]
tcpport = 51433tipThe remaining parameters in the
values.yamlfile can also be modified as desired to meet specific requirements (sync/async/config only replica quantities, image tags, vhost name, availability group name, etc). -
Install the Helm chart:
helm install dxsqlag dh2i/dxsqlag -f values.yaml -
Verify the StatefulSet has been created.
kubectl get sts dxsqlag
That's it! DxOperator will begin spinning up a new SQL Server Availability Group in Kubernetes and should - depending on cluster resources - finish within a few minutes. You can check on the progress using kubectl exec -itc dxe dxsqlag-0 -- dxcli get-ags-detail <vhost_name> <ag_name>.
Next Steps
- Create an AG listener and service or use service templates to enable cluster connectivity.
- Connect remotely using SSMS and DxAdmin.