diff --git a/.gitignore b/.gitignore index 1d12d79395..0c4d04eb14 100644 --- a/.gitignore +++ b/.gitignore @@ -188,6 +188,9 @@ AppPackages/ # but keep track of directories ending in .cache !*.[Cc]ache/ +# codealike API key files +codealike.json + # Others ClientBin/ [Ss]tyle[Cc]op.* @@ -440,3 +443,5 @@ samples/databases/wide-world-importers/workload-drivers/order-insert/Multithread *.pem *.p12 +codealike.json + diff --git a/samples/features/high availability/Kubernetes/sample-deployment-powershell-script/deploy-ag.ps1 b/samples/features/high availability/Kubernetes/sample-deployment-powershell-script/deploy-ag.ps1 new file mode 100644 index 0000000000..70b89a8f21 --- /dev/null +++ b/samples/features/high availability/Kubernetes/sample-deployment-powershell-script/deploy-ag.ps1 @@ -0,0 +1,49 @@ +Param( + [parameter(Mandatory=$false)] + [string]$NamespaceName="ag1" +) + +$currentWorkingDirectory = (Get-Location).Path | Split-Path -Parent +$manifestRootDirectory = Join-Path $currentWorkingDirectory "sample-manifest-files" + +Set-Location $manifestRootDirectory + +Write-Host "Creating namespace" -ForegroundColor Yellow +kubectl create namespace $NamespaceName +Write-Host "Namespace $NamespaceName created successfully" -ForegroundColor Cyan + +Write-Host "Deploying SQL Server Operator" -ForegroundColor Yellow + +kubectl apply ` +--filename operator.yaml ` +--namespace $NamespaceName + +Write-Host "SQL Server Operator deployed successfully" -ForegroundColor Cyan + +Write-Host "Creating SA password and master key password" -ForegroundColor Yellow + +kubectl create ` +secret generic sql-secrets ` +--from-literal=sapassword="P@ssw0rd!" ` +--from-literal=masterkeypassword="P@ssw0rd!" ` +--namespace $NamespaceName + +Write-Host "Created SA password and master key password successfully" -ForegroundColor Yellow + +Write-Host "Deploying SQL Server custom resource" -ForegroundColor Yellow + +kubectl apply ` +--filename sqlserver.yaml ` +--namespace $NamespaceName + +Write-Host "SQL Server custom resource deployed successfully" -ForegroundColor Cyan + +Write-Host "Deploying SQL Server Availability Group" -ForegroundColor Yellow + +kubectl apply ` +--filename ag-services.yaml ` +--namespace $NamespaceName + +Write-Host "SQL Server Availability Group deployed successfully" -ForegroundColor Cyan + +Set-Location $currentWorkingDirectory \ No newline at end of file diff --git a/samples/features/high availability/Kubernetes/sample-deployment-script/deploy-ag.py b/samples/features/high availability/Kubernetes/sample-deployment-script/deploy-ag.py index 2e9c337e09..0076307d9a 100644 --- a/samples/features/high availability/Kubernetes/sample-deployment-script/deploy-ag.py +++ b/samples/features/high availability/Kubernetes/sample-deployment-script/deploy-ag.py @@ -18,7 +18,7 @@ SqlServerYaml, AgServiceYaml, FailoverYaml) DEFAULT_K8S_AGENTS_IMAGE = ( - "mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu") + "mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu") diff --git a/samples/features/high availability/Kubernetes/sample-deployment-script/templates/sqlserver.yaml b/samples/features/high availability/Kubernetes/sample-deployment-script/templates/sqlserver.yaml index aa69033fb8..1e250aafd7 100644 --- a/samples/features/high availability/Kubernetes/sample-deployment-script/templates/sqlserver.yaml +++ b/samples/features/high availability/Kubernetes/sample-deployment-script/templates/sqlserver.yaml @@ -10,7 +10,7 @@ metadata: spec: sqlServerContainer: - image: mcr.microsoft.com/mssql/server:2019-CTP2.1-ubuntu + image: mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu saPassword: secretKeyRef: diff --git a/samples/features/high availability/Kubernetes/sample-manifest-files/operator.yaml b/samples/features/high availability/Kubernetes/sample-manifest-files/operator.yaml index e7268fbf6f..92f66effa2 100644 --- a/samples/features/high availability/Kubernetes/sample-manifest-files/operator.yaml +++ b/samples/features/high availability/Kubernetes/sample-manifest-files/operator.yaml @@ -63,6 +63,6 @@ spec: - name: MSSQL_K8S_NAMESPACE valueFrom: fieldRef: {fieldPath: metadata.namespace} - image: mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu + image: mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu name: mssql-operator serviceAccount: mssql-operator diff --git a/samples/features/high availability/Kubernetes/sample-manifest-files/rotate-creds.yaml b/samples/features/high availability/Kubernetes/sample-manifest-files/rotate-creds.yaml index 046c5a549f..f976efc1bd 100644 --- a/samples/features/high availability/Kubernetes/sample-manifest-files/rotate-creds.yaml +++ b/samples/features/high availability/Kubernetes/sample-manifest-files/rotate-creds.yaml @@ -64,7 +64,7 @@ spec: restartPolicy: Never containers: - name: rotate-creds - image: mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu + image: mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu command: ["/mssql-server-k8s-rotate-creds"] env: - name: MSSQL_K8S_SQL_SERVER_NAME diff --git a/samples/features/high availability/Kubernetes/sample-manifest-files/sqlserver.yaml b/samples/features/high availability/Kubernetes/sample-manifest-files/sqlserver.yaml index 9e3a1f6544..cfae869278 100644 --- a/samples/features/high availability/Kubernetes/sample-manifest-files/sqlserver.yaml +++ b/samples/features/high availability/Kubernetes/sample-manifest-files/sqlserver.yaml @@ -6,7 +6,7 @@ metadata: namespace: ag1 spec: acceptEula: true - agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu + agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu availabilityGroups: [ag1] instanceRootVolumeClaimTemplate: accessModes: [ReadWriteOnce] @@ -15,7 +15,7 @@ spec: storageClass: default saPassword: secretKeyRef: {key: sapassword, name: sql-secrets} - sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.1-ubuntu'} + sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu'} --- apiVersion: v1 kind: Service @@ -34,7 +34,7 @@ metadata: namespace: ag1 spec: acceptEula: true - agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu + agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu availabilityGroups: [ag1] instanceRootVolumeClaimTemplate: accessModes: [ReadWriteOnce] @@ -43,7 +43,7 @@ spec: storageClass: default saPassword: secretKeyRef: {key: sapassword, name: sql-secrets} - sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.1-ubuntu'} + sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu'} --- apiVersion: v1 kind: Service @@ -62,7 +62,7 @@ metadata: namespace: ag1 spec: acceptEula: true - agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.1-ubuntu + agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP2.2-ubuntu availabilityGroups: [ag1] instanceRootVolumeClaimTemplate: accessModes: [ReadWriteOnce] @@ -71,7 +71,7 @@ spec: storageClass: default saPassword: secretKeyRef: {key: sapassword, name: sql-secrets} - sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.1-ubuntu'} + sqlServerContainer: {image: 'mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu'} --- apiVersion: v1 kind: Service