Happy Monday everyone.

I haven’t written much about them yet (key emphasis there …) but AGs now being supported for containers in SQL Server 2019 is a big deal. Recently, SQL Server 2019 CTP 3.0 was released, but there’s a slight problem: if you try to deploy an AG with Kubernetes, you may see the following errors when trying to deploy the pods with the YAML that contains their definition. The services (i.e. instances of SQL Server) get created, but the pods do not.

YAML execution error (click to make bigger)

The fix, however, is easy. For CTP 3.0, a few things changed for the SQL Server operator. You have to modify the operator.yaml file with two changes which are documented below.

The first new thing is the word “update” is added to the verbs list in the section below.

[code]
– apiGroups: [mssql.microsoft.com]
resources: [sqlservers]
verbs: [get, list, watch, update]
[/code]

The second is a new section that now must exist after MSSQL_K8S_NAMESPACE.

[code]
– name: MSSQL_POD_NAME
valueFrom:
fieldRef: {fieldPath: metadata.name}
[/code]

The updated operator.yaml file can be downloaded from my repository.

Also, remember in the YAML file where you define the pods, update the following two lines:

[code]
agentsContainerImage: mcr.microsoft.com/mssql/ha:2019-CTP3.0-ubuntu
[/code]

and

[code]
sqlServerContainer: {image: ‘mcr.microsoft.com/mssql/server:2019-CTP3.0-ubuntu’}
[/code]

Hope this helps some of you.