Kubernetes SQL Server 2019 persistent volume takes several minutes to mount after deleting pod, why?

12/15/2021

thanks so much for any guidance on this.

I have a deployment with 1 replica. I'm in a dev lab environment with a brand new Tanzu k8s cluster. Here are the steps I've taken and a curious problem I've noticed.

  • SQL server 2019 is successfully in running state and can be connected with Azure data studio, data can be read and written no problem.

  • To simulate catastrophic failue, the SQl server pod is deleted from the command line while Azure data studio is connected

  • This results in a dangling volume that is eventually mounted by the new pod on a new node but takes upwards of 4 to 5 minutes to return to running state and be available again. After the pod is in running state, there is no problem, the weather is fine.

mssql-deployment-8bc6c96dc-rqxlj    0/1     Pending             0          0s      <none>         <none>                                  <none>           <none>
mssql-deployment-8bc6c96dc-rqxlj    0/1     Pending             0          0s      <none>         sqltkc-workers-mpqdb-556696d6f6-rvs26   <none>           <none>
mssql-deployment-8bc6c96dc-rqxlj    0/1     ContainerCreating   0          0s      <none>         sqltkc-workers-mpqdb-556696d6f6-rvs26   <none>           <none>
mssql-deployment-8bc6c96dc-rqxlj    1/1     Running             0          4m11s   192.168.1.14   sqltkc-workers-mpqdb-556696d6f6-rvs26   <none>           <none>

My question is:

1) Why does it take so long?

2) Is there a way to speed this up through a config setting in the deployment or PVC?

3) Is there a way to fully terminate a pod BEFORE you spin up a new one and attempt to mount the volume?

Thanks!!!

-- texasdave
kubernetes
persistent-volumes
sql-server

0 Answers