From fb0f97defe97068c1ac6b62007c5f75294af8de2 Mon Sep 17 00:00:00 2001
From: Kathi Raja Ravindra <42912207+KR-Ravindra@users.noreply.github.com>
Date: Tue, 10 Jan 2023 14:27:21 +0530
Subject: [PATCH 1/2] Added secrets.yaml which stateful set will use to set SA
password
---
.../templates/secret.yaml | 9 +++++++++
.../sample-helm-chart-statefulset-deployment/values.yaml | 2 ++
2 files changed, 11 insertions(+)
create mode 100644 linux/sample-helm-chart-statefulset-deployment/templates/secret.yaml
diff --git a/linux/sample-helm-chart-statefulset-deployment/templates/secret.yaml b/linux/sample-helm-chart-statefulset-deployment/templates/secret.yaml
new file mode 100644
index 00000000..20365e8b
--- /dev/null
+++ b/linux/sample-helm-chart-statefulset-deployment/templates/secret.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: Secret
+metadata:
+ name: mssql
+ labels:
+ {{- include "sql-statefull-deploy.labels" . | nindent 4 }}
+type: Opaque
+data:
+ SA_PASSWORD: {{ .Values.sa_password | b64enc | quote}}
\ No newline at end of file
diff --git a/linux/sample-helm-chart-statefulset-deployment/values.yaml b/linux/sample-helm-chart-statefulset-deployment/values.yaml
index 709ad6cd..820fb5cb 100644
--- a/linux/sample-helm-chart-statefulset-deployment/values.yaml
+++ b/linux/sample-helm-chart-statefulset-deployment/values.yaml
@@ -16,6 +16,8 @@ MSSQL_PID:
value: "Developer"
MSSQL_AGENT_ENABLED:
value: "false"
+sa_password: "Toughpass1!" #default SA Password
+
containers:
ports:
From 4bd1adf51b79fec44347d6c4ce9a7cd02a627e7e Mon Sep 17 00:00:00 2001
From: Kathi Raja Ravindra <42912207+KR-Ravindra@users.noreply.github.com>
Date: Tue, 10 Jan 2023 14:33:04 +0530
Subject: [PATCH 2/2] Add a little documentation about secret.yaml
---
linux/sample-helm-chart-statefulset-deployment/readme.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/linux/sample-helm-chart-statefulset-deployment/readme.md b/linux/sample-helm-chart-statefulset-deployment/readme.md
index ff2be90c..9c7f4248 100644
--- a/linux/sample-helm-chart-statefulset-deployment/readme.md
+++ b/linux/sample-helm-chart-statefulset-deployment/readme.md
@@ -32,6 +32,7 @@ On the client machine where you have the Helm tools installed, download the char
| Values.podSecurityContext.fsgroup | Security context at the pod level. | 10001 |
| Values.service.port | The service port number. | 1433 |
| Values.replicas | This value controls the number of SQL Server deployments that would be done, consider this as the number of SQL Server instances that will run. | 3 |
+| Values.sa_password | This sets the initial SA Password when pods bootup | Toughpass1!
@@ -51,6 +52,7 @@ In this scenario, I am deploying three SQL Server containers on a Azure Kubernet
| mssqlconfig.yaml | SQL server mssql.conf file and its content that you would like to mount to the SQL Server container. For parameters that you can pass in this file please refer mssql.conf documentation. To modify the mssql.conf settings please modify this file. |
| sc.yaml | A manifest file that describes the storage class (SC) to be deployed. To make any changes to the sc please modify this file accordingly. |
| service.yaml | A manifest file that defines the kubernetes service type and port. Because this is a statefulset deployment, this manifest files helps in creating the headless service. Please modify this for any service modification that is needed. |
+| secret.yaml | A manifest file that defines the secret, SA_PASSWORD which will be initially set as password for mssql. Please modify this after initial bootup to secure your setup. |