

Deploying SQL Server to Kubernetes using Helm
source link: https://www.tuicool.com/articles/hit/RzqiI3r
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

In previousposts I’ve run through how to deploy sql server to Kubernetes using yaml files. That’s a great way to deploy but is there possibly an easier way?
Enter Helm . A package manager for Kubernetes.
Helm packages are called charts and wouldn’t you know it? There’s a chart for SQL Server !
Helm comes in two parts. Helm itself is the client side tool, and tiller, which is the server side component. Details of what each part does can be found here .
So the first thing to do is install Helm. Now you can download the installers from the website here but I found the easiest way to install Helm locally was to install the Kubernetes extension for VS Code . Installing that extension will ask if you want to install other tools, one of which being helm. Nice and easy!
Now install tiller on your cluster (if you don’t have a cluster setup, I have a guide to building one in AKShere): –
helm init
Now search for the mssql-linux package: –
helm search stable/mssql-linux
And deploy!
helm install --name sql-server stable/mssql-linux --set acceptEula.value=Y --set sapassword=Testing1122 --set edition.value=Developer
N.B. – If you get the following error: –
Error: release sql-server failed: namespaces “default” is forbidden: User “system:serviceaccount:kube-system:default” cannot get namespaces in the namespace “default”
Run the following and then retry the deployment: –
kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts;
You can check the progress of the deployment by running the following: –
kubectl get deployments kubectl get pods kubectl get services
You may have noticed that the service does not have an external IP. So we can’t connect externally to the SQL instance running in the pod. In order to connect, let’s spin up another pod which has sqlcmd installed and enter a bash session: –
kubectl run sqltools --image=microsoft/mssql-tools -ti --restart=Never --rm=true -- /bin/bash
Now we can connect using sqlcmd: –
sqlcmd -S sql-server-mssql-linux -U sa
And now run a test query: –
SELECT @@VERSION; GO
And that’s how to deploy SQL Server to Kubernetes using Helm! Pretty cool imho.
Finally to delete the deployment: –
helm delete sql-server
Thanks for reading!
Recommend
-
85
Helm这个东西其实早有耳闻,但是一直没有用在生产环境,而且现在对这货的评价也是褒贬不一。正好最近需要再次部署一套测试环境,对于单体服务,部署一套测试环境我相信还是非常快的,但是对于微服务架构的应用,要部署一套新的环境,就有点折磨人了,微服务越多、...
-
15
TL;DR If you want to use Helm, but not Azure Dev Spaces. You can do it manually following
-
20
Posted 12 days ago2020-12-08T00:00:00+01:00 by Wolfgang Ofner In my last post, I explained how Helm works and how to add it to your microservice. This post is going to be more practical. Helm is a package manage...
-
8
Tutorial: Deploying and Using WebAssembly Under Deno on the Server Side Using Travis CI Jan 4, 2021 | Montana Mendy | n...
-
33
-
5
Deploying SQL Server Automatically I’ve had to install SQL Server many times over the years. Often it has felt that most o...
-
12
Deploy Quarkus applications to Kubernetes using a Helm chart ...
-
5
Abstract This blog provides guidance on how to deploy Microsoft SQL Server leveraging
-
4
Argo CD provides numerous ways to deploy resources from a Helm chart. In this article, you will learn about three patterns used to manage and deploy Helm charts, including when and where to use each pattern in your
-
7
Leveraging Kustomize to Render Helm Charts and Deploying via ArgoCD March 18, 2024 本文有 247 个字 需要花费 2 分钟阅读
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK