Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -440,3 +443,5 @@ samples/databases/wide-world-importers/workload-drivers/order-insert/Multithread
*.pem
*.p12

codealike.json

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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")



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand Down