Kubernetes not able to set Collation in sqldeployment.yaml

Hello,
I deployed ms sql server with Kubernetes, but in sqldeployment.yaml there is no place where I can change the default Collation???

The Collation bellow does not work.
Any help???

image: microsoft/mssql-server-linux:2017-latest
env:

  • name: MSSQL_PID
    value: Express
  • name: ACCEPT_EULA
    value: “Y”
  • name: MSSQL_COLLATION
    value: “Cyrillic_General_CI_AS”
  • name: SA_PASSWORD

Cluster information:

Kubernetes version:
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS:
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

Is MSSQL_COLLATION a valid variable for the container image? I don’t see any mention of at the container registry.

As far as I can tell, you need an initContainer that:

  • mounts the dataset
  • runs as root

It will need to run a script that does something like this:

  • checks if collation needs to be updated
  • if it does, run /opt/mssql/bin/mssql-conf set-collation COLLATION_NAME against the data

I did it as root, but it does not change the collation

------SSH root------------
kubectl exec -it mssql-deployment-6b5db58dd7-z8gtm bash

./kubectl-wls

The official documentation doesn’t mention it, but if you search Google for “change mssql collation linux” you should stumble upon sites like this that explain the first step to do is to stop the service. This is why I think it needs to happen in an initContainer.

The official documentation for this tool can be found here.

The complete documentation for mssql on Linux is here:

I did it.
It can be done during initialization of the Cluster.
In sqldeployment.yaml you have to include Collation.
containers:
- name: mssql
image: microsoft/mssql-server-linux:2017-latest
env:
- name: MSSQL_PID
value: Express
- name: ACCEPT_EULA
value: “Y”
- name: MSSQL_COLLATION
value: “Cyrillic_General_CI_AS”
- name: SA_PASSWORD
valueFrom:
secretKeyRef:
name: mssql
key: password
ports:
- name: mssql
containerPort: 1433