diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..8b482407 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/mssql-docker.iml b/.idea/mssql-docker.iml new file mode 100644 index 00000000..5e764c4f --- /dev/null +++ b/.idea/mssql-docker.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/linux/preview/CentOS/Dockerfile b/linux/preview/CentOS/Dockerfile index f3c2d9d8..4857cd02 100644 --- a/linux/preview/CentOS/Dockerfile +++ b/linux/preview/CentOS/Dockerfile @@ -15,7 +15,7 @@ LABEL name="microsoft/mssql-server-linux" \ ### Required labels above - recommended below url="https://www.microsoft.com/en-us/sql-server/" \ run='docker run --name ${NAME} \ - -e ACCEPT_EULA=Y -e SA_PASSWORD=yourStrong@Password \ + -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=yourStrong@Password \ -p 1433:1433 \ -d ${IMAGE}' \ io.k8s.description="MS SQL Server is ....." \ diff --git a/linux/preview/CentOS/Makefile b/linux/preview/CentOS/Makefile index 3efcfc66..bd2bb1b2 100644 --- a/linux/preview/CentOS/Makefile +++ b/linux/preview/CentOS/Makefile @@ -5,7 +5,7 @@ TARGET = centos7 REGISTRY = docker-registry.default.svc.cluster.local OC_USER = developer OC_PASS = developer -SA_PASSWORD = yourStrong@Password +MSSQL_SA_PASSWORD = yourStrong@Password all: build build: @@ -16,15 +16,15 @@ lint: dockerfile_lint -f Dockerfile test: - $(eval CONTAINERID=$(shell docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=${SA_PASSWORD} -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION})) + $(eval CONTAINERID=$(shell docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD} -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION})) @sleep 2 @docker exec ${CONTAINERID} ps aux @sleep 20 - @docker exec ${CONTAINERID} sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q "sp_databases" + @docker exec ${CONTAINERID} sqlcmd -S localhost -U SA -P ${MSSQL_SA_PASSWORD} -Q "sp_databases" @docker rm -f ${CONTAINERID} run: - docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=${SA_PASSWORD} -p 1433:1433 -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION} + docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD} -p 1433:1433 -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION} clean: rm -f build \ No newline at end of file diff --git a/linux/preview/README.md b/linux/preview/README.md index 22e74d62..3242e52a 100644 --- a/linux/preview/README.md +++ b/linux/preview/README.md @@ -49,13 +49,13 @@ $ make run - At least 3.25 GB of RAM. Make sure to assign enough memory to the Docker VM if you're running on Docker for [Mac](https://docs.docker.com/docker-for-mac/#/general) or [Windows](https://docs.docker.com/docker-for-windows/#/advanced). - Requires the following environment flags - ACCEPT_EULA=Y - - SA_PASSWORD= + - MSSQL_SA_PASSWORD= - A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols. # How to use this image --- ## Start a mssql-server instance -> ``docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux`` +> ``docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux`` ## Connect to Microsoft SQL Server Starting with the CTP 1.4 (March 17, 2017) release the mssql-tools package including sqlcmd, bcp are included in the image. You can connect to the SQL Server using the sqlcmd tool inside of the container by using the following command on the host: @@ -69,7 +69,7 @@ You can connect to the SQL Server instance in the container from outside the con ## Environment variables - ACCEPT_EULA confirms acceptance of the [End-User Licensing Agreement](http://go.microsoft.com/fwlink/?LinkId=746388). -- SA_PASSWORD is the database system administrator (userid = 'sa') password used to connect to SQL Server once the container is running. +- MSSQL_SA_PASSWORD is the database system administrator (userid = 'sa') password used to connect to SQL Server once the container is running. Additional, optional environment variables are documented in the [product documentation](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-environment-variables). @@ -87,7 +87,7 @@ Additional, optional environment variables are documented in the [product docume --- - **How do I map a volume using Docker for Windows?** Make sure to enable [shared drives in the settings menu](https://docs.docker.com/docker-for-windows/#shared-drives). After that, you can map a volume specifying the **Windows path:Linux path**. The following is an example of a command to map a Windows folder to the data directory in the container: -> ``docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -v C:\MyWindowsVolume:/var/opt/mssql -d microsoft/mssql-server-linux`` +> ``docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -v C:\MyWindowsVolume:/var/opt/mssql -d microsoft/mssql-server-linux`` # Further reading --- diff --git a/linux/preview/RHEL/Dockerfile b/linux/preview/RHEL/Dockerfile index 06a276ce..5723c65c 100644 --- a/linux/preview/RHEL/Dockerfile +++ b/linux/preview/RHEL/Dockerfile @@ -15,7 +15,7 @@ LABEL name="microsoft/mssql-server-linux" \ ### Required labels above - recommended below url="https://www.microsoft.com/en-us/sql-server/" \ run='docker run --name ${NAME} \ - -e ACCEPT_EULA=Y -e SA_PASSWORD=yourStrong@Password \ + -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=yourStrong@Password \ -p 1433:1433 \ -d ${IMAGE}' \ io.k8s.description="MS SQL Server is ....." \ diff --git a/linux/preview/RHEL/Makefile b/linux/preview/RHEL/Makefile index b7a06203..5ee03705 100644 --- a/linux/preview/RHEL/Makefile +++ b/linux/preview/RHEL/Makefile @@ -5,7 +5,7 @@ TARGET = rhel7 REGISTRY = docker-registry.default.svc.cluster.local OC_USER = developer OC_PASS = developer -SA_PASSWORD = yourStrong@Password +MSSQL_SA_PASSWORD = yourStrong@Password all: build build: @@ -16,15 +16,15 @@ lint: dockerfile_lint -f Dockerfile test: - $(eval CONTAINERID=$(shell docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=${SA_PASSWORD} -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION})) + $(eval CONTAINERID=$(shell docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD} -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION})) @sleep 2 @docker exec ${CONTAINERID} ps aux @sleep 20 - @docker exec ${CONTAINERID} sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q "sp_databases" + @docker exec ${CONTAINERID} sqlcmd -S localhost -U SA -P ${MSSQL_SA_PASSWORD} -Q "sp_databases" @docker rm -f ${CONTAINERID} run: - docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=${SA_PASSWORD} -p 1433:1433 -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION} + docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD} -p 1433:1433 -d ${CONTEXT}/${IMAGE_NAME}:${TARGET}-${VERSION} clean: rm -f build \ No newline at end of file diff --git a/linux/preview/SLES/README.md b/linux/preview/SLES/README.md index 2adb2759..d4b5ec97 100644 --- a/linux/preview/SLES/README.md +++ b/linux/preview/SLES/README.md @@ -40,7 +40,7 @@ ``` 4. Run the docker image. ``` - sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=' \ + sudo docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=' \ -p 1433:1433 --name sql1 \ -d mssql-sles-tools-nonroot ``` diff --git a/linux/preview/examples/mssql-customize/configure-db.sh b/linux/preview/examples/mssql-customize/configure-db.sh index be49de93..c9c7b89a 100644 --- a/linux/preview/examples/mssql-customize/configure-db.sh +++ b/linux/preview/examples/mssql-customize/configure-db.sh @@ -11,7 +11,7 @@ i=0 while [[ $DBSTATUS -ne 0 ]] && [[ $i -lt 60 ]] && [[ $ERRCODE -ne 0 ]]; do i=$i+1 - DBSTATUS=$(/opt/mssql-tools/bin/sqlcmd -h -1 -t 1 -U sa -P $SA_PASSWORD -Q "SET NOCOUNT ON; Select SUM(state) from sys.databases") + DBSTATUS=$(/opt/mssql-tools/bin/sqlcmd -h -1 -t 1 -U sa -P $MSSQL_SA_PASSWORD -Q "SET NOCOUNT ON; Select SUM(state) from sys.databases") ERRCODE=$? sleep 1 done @@ -22,5 +22,5 @@ if [ $DBSTATUS -ne 0 ] OR [ $ERRCODE -ne 0 ]; then fi # Run the setup script to create the DB and the schema in the DB -/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql +/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $MSSQL_SA_PASSWORD -d master -i setup.sql diff --git a/linux/preview/examples/mssql-polybase/README.md b/linux/preview/examples/mssql-polybase/README.md index 289961f2..061b8fe8 100644 --- a/linux/preview/examples/mssql-polybase/README.md +++ b/linux/preview/examples/mssql-polybase/README.md @@ -14,9 +14,9 @@ 3. Start SQL Server with PolyBase feature. - Use `docker run` command to run /opt/mssql/bin/sqlservr in an isolated container. - On bash shell (Linux/macOS/Windows GitBash): - - `$ docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' -p 1433:1433 -d mssql-polybase-preview` + - `$ docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=YourStrong!Passw0rd' -p 1433:1433 -d mssql-polybase-preview` - On elevated PowerShell command prompt: - - `PS> docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YourStrong!Passw0rd" -p 1433:1433 -d mssql-polybase-preview` + - `PS> docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong!Passw0rd" -p 1433:1433 -d mssql-polybase-preview` 4. Enable PolyBase feature. - After SQL Server is started with `docker run` command, PolyBase must be enabled to access its features. diff --git a/linux/preview/openSUSE/README.md b/linux/preview/openSUSE/README.md index 4c70a7e2..71e4d4f8 100644 --- a/linux/preview/openSUSE/README.md +++ b/linux/preview/openSUSE/README.md @@ -10,7 +10,7 @@ ``` 3. Run the docker image. ``` - sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=' \ + sudo docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=' \ -p 1433:1433 --name sql1 \ -d mssql-opensuse ``` diff --git a/linux/rancher/values.test.yaml b/linux/rancher/values.test.yaml index 95544cc1..4ad30627 100644 --- a/linux/rancher/values.test.yaml +++ b/linux/rancher/values.test.yaml @@ -1,4 +1,4 @@ -# since a default SA_PASSWORD is not set, this is used for helm lint and helm debug, otherwise unused +# since a default MSSQL_SA_PASSWORD is not set, this is used for helm lint and helm debug, otherwise unused mssql: sa: password: Sfr9nxVVkbMVGTQweKmD diff --git a/linux/sample-helm-chart-statefulset-deployment/readme.md b/linux/sample-helm-chart-statefulset-deployment/readme.md index ff2be90c..fd19aee0 100644 --- a/linux/sample-helm-chart-statefulset-deployment/readme.md +++ b/linux/sample-helm-chart-statefulset-deployment/readme.md @@ -10,7 +10,7 @@ This HELM chart is a sample "as-is" chart provided for reference to help guide w 4. Requires the following variables to be set or changed in the values.yaml file :
a. Please ensure that you accept the EULA for SQL Server, by changing the value of ACCEPT_EULA.value=y in values.yaml file or set it during the helm install command --set ACCEPT_EULA.value=Y.
b. Please do choose the right edition of SQL Server that you would like to install you can change the value of the MSSQL_PID.value in the values file to the edition that you want to install or you can also - change it during the helm install command using the option --set MSSQL_PID.value=Enterprise, If you do not pass the flag and do not change it in the yaml, then by default it is going to install developer edition.
c. Also please do provide your customized value for the sa_password, if you do not provide it then by default the sa_password will the value as shown in the below table.
+ change it during the helm install command using the option --set MSSQL_PID.value=Enterprise, If you do not pass the flag and do not change it in the yaml, then by default it is going to install developer edition.
c. Also please do provide your customized value for the mssql_sa_password, if you do not provide it then by default the mssql_sa_password will the value as shown in the below table.
Note: Once you deploy SQL server containers using the chart below, please log into SQL Server using sa account and change the password for sa, this ensures that as DBA you have the control of the sa user and password. diff --git a/linux/sample-helm-chart-statefulset-deployment/templates/deployment.yaml b/linux/sample-helm-chart-statefulset-deployment/templates/deployment.yaml index 136d5424..68c78e2a 100644 --- a/linux/sample-helm-chart-statefulset-deployment/templates/deployment.yaml +++ b/linux/sample-helm-chart-statefulset-deployment/templates/deployment.yaml @@ -38,11 +38,11 @@ spec: value: "{{ .Values.ACCEPT_EULA.value | upper}}" - name: MSSQL_AGENT_ENABLED value: "{{ .Values.MSSQL_AGENT_ENABLED.value}}" - - name: SA_PASSWORD + - name: MSSQL_SA_PASSWORD valueFrom: secretKeyRef: name: mssql - key: SA_PASSWORD + key: MSSQL_SA_PASSWORD volumeMounts: - name: mssql mountPath: "/var/opt/mssql" diff --git a/linux/sample-helm-chart/readme.md b/linux/sample-helm-chart/readme.md index aba6bd36..48ab15a7 100644 --- a/linux/sample-helm-chart/readme.md +++ b/linux/sample-helm-chart/readme.md @@ -10,7 +10,7 @@ This HELM chart is a sample "as-is" chart provided for reference to help guide w 4. Requires the following variables to be set or changed in the values.yaml file :
a. Please ensure that you accept the EULA for SQL Server, by changing the value of ACCEPT_EULA.value=y in values.yaml file or set it during the helm install command --set ACCEPT_EULA.value=Y.
b. Please do choose the right edition of SQL Server that you would like to install you can change the value of the MSSQL_PID.value in the values file to the edition that you want to install or you can also - change it during the helm install command using the option --set MSSQL_PID.value=Enterprise, If you do not pass the flag and do not change it in the yaml, then by default it is going to install developer edition.
c. Also please do provide your customized value for the sa_password, if you do not provide it then by default the sa_password will the value as shown in the below table.
+ change it during the helm install command using the option --set MSSQL_PID.value=Enterprise, If you do not pass the flag and do not change it in the yaml, then by default it is going to install developer edition.
c. Also please do provide your customized value for the mssql_sa_password, if you do not provide it then by default the mssql_sa_password will the value as shown in the below table.
Note: Once you deploy SQL server containers using the chart below, please log into SQL Server using sa account and change the password as mentioned here, this ensures that as DBA you have the control of the sa user and password. @@ -27,7 +27,7 @@ On the client machine where you have the Helm tools installed, download the char | Values.MSSQL_PID.value | Set the SQL Server edition or product key. please refer environment variable for more details | Developer | | Values.MSSQL_AGENT_ENABLED.value | Enable SQL Server Agent. For example, 'true' is enabled and 'false' is disabled. By default, agent is disabled. please refer environment variable for more details. | TRUE | | Values.hostname | The name that you would like to see when you run the select @@servername for the SQL instance running inside the container. | mssqllatest | -| Values.sa_password | Configure the SA user password. | StrongPass1! | +| Values.mssql_sa_password | Configure the SA user password. | StrongPass1! | | Values.containers.ports.containerPort | Port on which the SQL Server is listening inside the container. | 1433 | | Values.podSecurityContext.fsgroup | Security context at the pod level. | 10001 | | Values.service.type | The type of the service to be created within the kubernetes cluster. | LoadBalancer | @@ -57,7 +57,7 @@ In this scenario, I am deploying SQL Server containers on a Azure Kubernetes Ser | deployment.yaml | A manifest file to describing the deployment details for SQL Server. | | 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. | | pvc.yaml | A manifest file that describes the storage class (SC), Persistent volume (PV) and Persistent volume claims (pvc). This will be mounted to the SQL Container and referenced by the deployment.yaml. To make any changes to the sc,pv or pvc please modify this file accordingly. | -| secret.yaml | A manifest file to create secrets to manage the sa_password that will be used to login to the SQL Server container that is deployed. Please modify the value.yaml file to provide your custom sa_password that you will use to login into the SQL Server once deployed. As a security measure please ensure that you change the sa_password once you login to the SQL Server for the first time. | +| secret.yaml | A manifest file to create secrets to manage the mssql_sa_password that will be used to login to the SQL Server container that is deployed. Please modify the value.yaml file to provide your custom mssql_sa_password that you will use to login into the SQL Server once deployed. As a security measure please ensure that you change the mssql_sa_password once you login to the SQL Server for the first time. | | service.yaml | A manifest file that defines the kubernetes service type and port. Please modify this for any service modification that is needed. | With this information, and probably after you have modified the required files you are now ready to deploy SQL Server using this chart. From the client machine where you have the helm chart installed, change the diff --git a/linux/sample-helm-chart/templates/_helpers.tpl b/linux/sample-helm-chart/templates/_helpers.tpl index f4b91c0c..1737b683 100644 --- a/linux/sample-helm-chart/templates/_helpers.tpl +++ b/linux/sample-helm-chart/templates/_helpers.tpl @@ -66,5 +66,5 @@ Create the name of the service account to use Create the name for the SA password secret key. */}} {{- define "mssql.sapassword" -}} - sa_password + mssql_sa_password {{- end -}} diff --git a/linux/sample-helm-chart/templates/deployment.yaml b/linux/sample-helm-chart/templates/deployment.yaml index 0e2827e9..aa3b9eec 100644 --- a/linux/sample-helm-chart/templates/deployment.yaml +++ b/linux/sample-helm-chart/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: value: "{{ .Values.ACCEPT_EULA.value | upper}}" - name: MSSQL_AGENT_ENABLED value: "{{ .Values.MSSQL_AGENT_ENABLED.value}}" - - name: SA_PASSWORD + - name: MSSQL_SA_PASSWORD valueFrom: secretKeyRef: name: mssql-secret diff --git a/linux/sample-helm-chart/templates/secret.yaml b/linux/sample-helm-chart/templates/secret.yaml index be2ffc50..a018f8ee 100644 --- a/linux/sample-helm-chart/templates/secret.yaml +++ b/linux/sample-helm-chart/templates/secret.yaml @@ -6,4 +6,4 @@ metadata: {{- include "mssql-latest.labels" . | nindent 4 }} type: Opaque data: - sa_password : {{ .Values.sa_password | b64enc | quote}} \ No newline at end of file + mssql_sa_password : {{ .Values.mssql_sa_password | b64enc | quote}} \ No newline at end of file diff --git a/linux/sample-helm-chart/values.yaml b/linux/sample-helm-chart/values.yaml index 2bbae807..79b75cfd 100644 --- a/linux/sample-helm-chart/values.yaml +++ b/linux/sample-helm-chart/values.yaml @@ -17,7 +17,7 @@ MSSQL_PID: MSSQL_AGENT_ENABLED: value: "true" hostname: mssqllatest -sa_password: "Toughpass1!" +mssql_sa_password: "Toughpass1!" containers: ports: containerPort: 1433