Skip to main content
Version: v2.0-RC

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

  1. 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>
  2. Inspect and save the values.yaml chart from the Helm repo.

    helm show values dh2i/dxsqlag > values.yaml
  3. Open the values.yaml file for editing using a text editor.

  4. From within the text editor, change the values below and save the changes.

    values.yaml
    dxEnterpriseContainer:
    acceptEula: true
    clusterSecret: dxe

    sqlServerContainer:
    acceptEula: true
    mssqlSecret: mssql
    SECURITY CAUTION: Avoid Default SQL Server Port for Availability Groups

    For 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 mssqlConfigMap directly here:

    info

    See the Microsoft documentation for all supported variables for MSSQL.

    values.yaml
    mssqlConfigMap: |
    [network]
    tcpport = 51433
    tip

    The remaining parameters in the values.yaml file can also be modified as desired to meet specific requirements (sync/async/config only replica quantities, image tags, vhost name, availability group name, etc).

  5. Install the Helm chart:

    helm install dxsqlag dh2i/dxsqlag -f values.yaml
  6. 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

Additional Information