mssql
by XROW GmbH
Microsoft SQL Server is a DBMS used by many organizations. Ease Migrating your SQL Servers to Cloud Native by leveraging this Helm chart.
About this chart
Helm chart for Microsoft SQL Server
Microsoft SQL Server is still used by many organizations. And migration to Cloud native can be a blocked by having this technology. In order to help organization to lift-shift to Cloud Native, they can run also MS SQL in kubernetes via this Helm chart
DISCLAIMER BY DEPLOYING THIS HELM CHART, YOU ARE ACCEPTING THE END-USER Licensing Agreement of Microsoft SQL Server
Install
Verify the helm chart via cosign
cosign verify registry.gitlab.com/xrow-public/helm-mssql/mssql:1.10.3 --certificate-identity "https://gitlab.com/xrow-public/helm-mssql//.gitlab-ci.yml@refs/heads/main" --certificate-oidc-issuer "https://gitlab.com"
values.yaml
---
global:
storageClass: "managed-csi-premium" # Change this if needed
auth:
database: test
rootPassword: 'yourStrong(#)Password'
username: test
password: 'yourStrong(#)Password'
helm upgrade --install mssql oci://registry.gitlab.com/xrow-public/helm-mssql/charts/mssql --version 1.10.3 --create-namespace -n mssql -f values.yaml
values.yaml
Check default values of this chart here .
Features
- Applying Helm Chart standards
- Ability to specify own registry
- Persisting data
- Auto Bootstrapping Database
- Auto Bootstraping Database Owner User with given password
- Ability to execute initial DB scripts (SQL)
- Replication architecture with separate primary and secondary StatefulSets and services
- Performance Monitoring - Integrated with Prometheus Operator
Replication architecture
Set architecture: replication to deploy one primary StatefulSet and a configurable secondary StatefulSet.
architecture: replication
auth:
rootPassword: 'yourStrong(#)Password'
replicationPassword: 'yourStrong(#)Password'
secondary:
replicaCount: 2
The chart renders independent persistent volumes for primary and secondary pods, headless services for stable StatefulSet DNS, and separate client services:
<release>-mssql-primaryfor primary connections<release>-mssql-secondaryfor secondary connections
Data initalisation via init folder
FROM registry.gitlab.com/xrow-public/helm-mssql:1.10.3
COPY *.sql /docker-entrypoint-initdb.d
Test the container
podman build -t mssql .
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=<YourStrong#Passw0rd>' -p 1433:1433 -v sqlvolume:/var/opt/mssql -it localhost/mssql:1.10.3
Credits
Credits to ElmCompany for inital work.
Schema
Generated from values.schema.json.
| Path | Type | Default | Allowed values | Description |
|---|---|---|---|---|
| global | object | Global values shared across chart resources. | ||
| global.imageRegistry | string | "" | ||
| global.imagePullSecrets | array | [] | ||
| global.storageClass | string | "" | ||
| nameOverride | string | "" | ||
| fullnameOverride | string | "" | ||
| namespaceOverride | string | "" | ||
| clusterDomain | string | "cluster.local" | ||
| commonAnnotations | object | |||
| commonLabels | object | |||
| image | object | MSSQL server image settings. | ||
| image.registry | string | "registry.gitlab.com" | ||
| image.repository | string | "xrow-public/helm-mssql/mssql" | ||
| image.tag | string | "main" | ||
| image.pullPolicy | string | "IfNotPresent" | "Always", "IfNotPresent", "Never" | |
| image.pullSecrets | array | [] | ||
| image.debug | boolean | false | ||
| architecture | string | "standalone" | "standalone", "replication" | |
| edition | string | "Express" | "Developer", "Express", "Standard", "Enterprise", "EnterpriseCore" | |
| auth | object | MSSQL authentication and bootstrap database settings. | ||
| auth.rootPassword | string | "" | ||
| auth.createDatabase | boolean | true | ||
| auth.database | string | "database" | ||
| auth.databaseCollate | string | "Latin1_General_CI_AS" | ||
| auth.username | string | "" | ||
| auth.password | string | "" | ||
| auth.createLogin | boolean | true | ||
| auth.replicationUser | string | "replicator" | ||
| auth.replicationPassword | string | "" | ||
| auth.existingSecret | string | "" | ||
| primary | object | Primary MSSQL StatefulSet settings. | ||
| primary.name | string | "primary" | ||
| primary.lifecycleHooks | object | |||
| primary.hostAliases | array | [] | ||
| primary.existingConfigmap | string | "" | ||
| primary.mssqlConfig | string | "[EULA]\naccepteula = Y\naccepteulaml = Y\n\n[coredump]\ncaptureminiandfull = true\ncoredumptype = full\n\n[hadr]\nhadrenabled = 1\n\n[language]\nlcid = 1033\n\n[filelocation]\ndefaultdatadir = {{ .Values.primary.persistence.mount }}\ndefaultlogdir = /var/opt/mssql/log\n" | ||
| primary.tempdb | object | |||
| primary.tempdb.inMemory | object | |||
| primary.tempdb.inMemory.enabled | boolean | false | ||
| primary.tempdb.inMemory.mountPath | string | "/var/opt/mssql/tempdb" | ||
| primary.tempdb.inMemory.sizeLimit | string | "2Gi" | ||
| primary.updateStrategy | object | |||
| primary.updateStrategy.type | string | "RollingUpdate" | "RollingUpdate", "OnDelete" | |
| primary.podAnnotations | object | |||
| primary.podAffinityPreset | string | "" | "", "soft", "hard" | |
| primary.podAntiAffinityPreset | string | "soft" | "", "soft", "hard" | |
| primary.nodeAffinityPreset | object | |||
| primary.nodeAffinityPreset.type | string | "" | "", "soft", "hard" | |
| primary.nodeAffinityPreset.key | string | "" | ||
| primary.nodeAffinityPreset.values | array | [] | ||
| primary.affinity | object | |||
| primary.nodeSelector | object | |||
| primary.nodeSelector.kubernetes.io/os | string | "linux" | ||
| primary.tolerations | array | [] | ||
| primary.priorityClassName | string | "" | ||
| primary.schedulerName | string | "" | ||
| primary.terminationGracePeriodSeconds | string | "" | ||
| primary.topologySpreadConstraints | array | [] | ||
| primary.podManagementPolicy | string | "" | ||
| primary.podSecurityContext | object | |||
| primary.podSecurityContext.enabled | boolean | true | ||
| primary.podSecurityContext.fsGroup | integer | 1001 | ||
| primary.containerSecurityContext | object | |||
| primary.containerSecurityContext.enabled | boolean | true | ||
| primary.containerSecurityContext.runAsUser | integer | 1001 | ||
| primary.containerSecurityContext.runAsNonRoot | boolean | true | ||
| primary.resources | object | |||
| primary.resources.requests | object | |||
| primary.resources.requests.memory | string | "2G" | ||
| primary.resources.requests.cpu | string | "2000m" | ||
| primary.resources.limits | object | |||
| primary.resources.limits.memory | string | "4G" | ||
| primary.livenessProbe | object | |||
| primary.livenessProbe.enabled | boolean | true | ||
| primary.livenessProbe.initialDelaySeconds | integer | 5 | ||
| primary.livenessProbe.periodSeconds | integer | 10 | ||
| primary.livenessProbe.timeoutSeconds | integer | 1 | ||
| primary.livenessProbe.failureThreshold | integer | 3 | ||
| primary.livenessProbe.successThreshold | integer | 1 | ||
| primary.readinessProbe | object | |||
| primary.readinessProbe.enabled | boolean | true | ||
| primary.readinessProbe.initialDelaySeconds | integer | 5 | ||
| primary.readinessProbe.periodSeconds | integer | 10 | ||
| primary.readinessProbe.timeoutSeconds | integer | 1 | ||
| primary.readinessProbe.failureThreshold | integer | 3 | ||
| primary.readinessProbe.successThreshold | integer | 1 | ||
| primary.startupProbe | object | |||
| primary.startupProbe.enabled | boolean | true | ||
| primary.startupProbe.initialDelaySeconds | integer | 30 | ||
| primary.startupProbe.periodSeconds | integer | 10 | ||
| primary.startupProbe.timeoutSeconds | integer | 1 | ||
| primary.startupProbe.failureThreshold | integer | 10 | ||
| primary.startupProbe.successThreshold | integer | 1 | ||
| primary.extraFlags | string | "" | ||
| primary.extraEnvVars | array | [] | ||
| primary.extraEnvVarsCM | string | "" | ||
| primary.extraEnvVarsSecret | string | "" | ||
| primary.persistence | object | |||
| primary.persistence.enabled | boolean | true | ||
| primary.persistence.mount | string | "/var/opt/mssql" | ||
| primary.persistence.existingClaim | string | "" | ||
| primary.persistence.storageClass | string | "" | ||
| primary.persistence.annotations | object | |||
| primary.persistence.accessModes | array | ["ReadWriteOnce"] | ||
| primary.persistence.size | string | "8Gi" | ||
| primary.persistence.selector | object | |||
| primary.extraVolumes | array | [] | ||
| primary.extraVolumeMounts | array | [] | ||
| primary.initContainers | array | [] | ||
| primary.sidecars | array | [] | ||
| primary.service | object | |||
| primary.service.type | string | "ClusterIP" | "ClusterIP", "NodePort", "LoadBalancer", "ExternalName" | |
| primary.service.ports | object | |||
| primary.service.ports.mssql | integer | 1433 | ||
| primary.service.nodePorts | object | |||
| primary.service.nodePorts.mssql | string | "" | ||
| primary.service.clusterIP | string | "" | ||
| primary.service.loadBalancerIP | string | "" | ||
| primary.service.externalTrafficPolicy | string | "Cluster" | "Cluster", "Local" | |
| primary.service.loadBalancerSourceRanges | array | [] | ||
| primary.service.extraPorts | array | [] | ||
| primary.service.annotations | object | |||
| primary.service.sessionAffinity | string | "None" | "None", "ClientIP" | |
| primary.service.sessionAffinityConfig | object | |||
| primary.pdb | object | |||
| primary.pdb.create | boolean | false | ||
| primary.pdb.minAvailable | integer | 1 | ||
| primary.pdb.maxUnavailable | string | "" | ||
| primary.podLabels | object | |||
| secondary | object | Secondary MSSQL StatefulSet settings used by the replication architecture. | ||
| secondary.name | string | "secondary" | ||
| secondary.replicaCount | integer | 1 | ||
| secondary.hostAliases | array | [] | ||
| secondary.command | array | [] | ||
| secondary.args | array | [] | ||
| secondary.lifecycleHooks | object | |||
| secondary.existingConfigmap | string | "" | ||
| secondary.mssqlConfig | string | "[EULA]\naccepteula = Y\naccepteulaml = Y\n\n[coredump]\ncaptureminiandfull = true\ncoredumptype = full\n\n[hadr]\nhadrenabled = 1\n\n[language]\nlcid = 1033\n\n[filelocation]\ndefaultdatadir = {{ .Values.secondary.persistence.mount }}\ndefaultlogdir = /var/opt/mssql/log\n" | ||
| secondary.updateStrategy | object | |||
| secondary.updateStrategy.type | string | "RollingUpdate" | "RollingUpdate", "OnDelete" | |
| secondary.podAnnotations | object | |||
| secondary.podAffinityPreset | string | "" | "", "soft", "hard" | |
| secondary.podAntiAffinityPreset | string | "soft" | "", "soft", "hard" | |
| secondary.nodeAffinityPreset | object | |||
| secondary.nodeAffinityPreset.type | string | "" | "", "soft", "hard" | |
| secondary.nodeAffinityPreset.key | string | "" | ||
| secondary.nodeAffinityPreset.values | array | [] | ||
| secondary.affinity | object | |||
| secondary.nodeSelector | object | |||
| secondary.nodeSelector.kubernetes.io/os | string | "linux" | ||
| secondary.tolerations | array | [] | ||
| secondary.priorityClassName | string | "" | ||
| secondary.schedulerName | string | "" | ||
| secondary.terminationGracePeriodSeconds | string | "" | ||
| secondary.topologySpreadConstraints | array | [] | ||
| secondary.podManagementPolicy | string | "" | ||
| secondary.podSecurityContext | object | |||
| secondary.podSecurityContext.enabled | boolean | true | ||
| secondary.podSecurityContext.fsGroup | integer | 1001 | ||
| secondary.containerSecurityContext | object | |||
| secondary.containerSecurityContext.enabled | boolean | true | ||
| secondary.containerSecurityContext.runAsUser | integer | 1001 | ||
| secondary.containerSecurityContext.runAsNonRoot | boolean | true | ||
| secondary.resources | object | |||
| secondary.resources.limits | object | |||
| secondary.resources.requests | object | |||
| secondary.livenessProbe | object | |||
| secondary.livenessProbe.enabled | boolean | true | ||
| secondary.livenessProbe.initialDelaySeconds | integer | 5 | ||
| secondary.livenessProbe.periodSeconds | integer | 10 | ||
| secondary.livenessProbe.timeoutSeconds | integer | 1 | ||
| secondary.livenessProbe.failureThreshold | integer | 3 | ||
| secondary.livenessProbe.successThreshold | integer | 1 | ||
| secondary.readinessProbe | object | |||
| secondary.readinessProbe.enabled | boolean | true | ||
| secondary.readinessProbe.initialDelaySeconds | integer | 5 | ||
| secondary.readinessProbe.periodSeconds | integer | 10 | ||
| secondary.readinessProbe.timeoutSeconds | integer | 1 | ||
| secondary.readinessProbe.failureThreshold | integer | 3 | ||
| secondary.readinessProbe.successThreshold | integer | 1 | ||
| secondary.startupProbe | object | |||
| secondary.startupProbe.enabled | boolean | true | ||
| secondary.startupProbe.initialDelaySeconds | integer | 15 | ||
| secondary.startupProbe.periodSeconds | integer | 10 | ||
| secondary.startupProbe.timeoutSeconds | integer | 1 | ||
| secondary.startupProbe.failureThreshold | integer | 15 | ||
| secondary.startupProbe.successThreshold | integer | 1 | ||
| secondary.customLivenessProbe | object | |||
| secondary.customReadinessProbe | object | |||
| secondary.cust |
Deploy mssql with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mssql on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmssql is pinned at v1.10.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply