%3CLINGO-SUB%20id%3D%22lingo-sub-2023375%22%20slang%3D%22en-US%22%3EDeploy%20SQL%20Server%20on%20Azure%20Kubernetes%20Service%20cluster%20via%20Helm%20Charts%20-%20on%20a%20windows%20client%20machine!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2023375%22%20slang%3D%22en-US%22%3E%3CP%3EA%26nbsp%3Bbrief%26nbsp%3Bsnapshot%26nbsp%3Bof%26nbsp%3Bthe%26nbsp%3Bconversation%26nbsp%3Bthat%26nbsp%3Bmy%26nbsp%3Bcolleague%26nbsp%3Band%26nbsp%3BI%26nbsp%3Bhad%20a%20couple%20of%20weeks%20ago%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EColleague%3C%2FSTRONG%3E%3A%26nbsp%3B%20%3CEM%3E%22I%20am%20new%20to%20Kubernetes%20and%20Linux%20world%20and%20was%20hoping%20if%20I%20could%20deploy%20SQL%20Server%20using%20helm%20chart%20from%20my%20Helm%20on%20my%20windows%20client%20and%20a%20managed%20kubernetes%20cluster%20service%20like%20Azure%20kubernetes%20service%20cluster%20(AKS)%3F%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EMe%3C%2FSTRONG%3E%3A%26nbsp%3B%20%3CEM%3E%22Yes%2C%20you%20can!%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EColleague%3C%2FSTRONG%3E%3A%20%3CEM%3E%22Great!%20Can%20you%20share%20articles%20or%20guidance%20to%20do%20that%20so%20I%20could%20follow%20those%3F%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EMe%3C%2FSTRONG%3E%3A%20%3CEM%3E%22hmm..%20For%20Helm%20refer%20this..%20for%20Kubernetes%20refer%20this..%20For%20SQL%20Server%20deployment%20using%20helm%20on%20kubernetes%20refer%20this..%20%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3Eand%20that's%20when%20I%20noticed%20there%20wasn't%20a%20single%20stop%20end%20to%20end%20guidance.%20This%20is%20what%20prompted%20me%20to%20write%20this%20blog.%20And%20I%20hope%20this%20helps%20anyone%20who%20is%20new%20to%20Kubernetes%2Fhelm%20charts%20or%20even%20SQL%20Server%20and%20want%20to%20get%20started%20with%20the%20deployment%20of%20SQL%20Server%20on%20Kubernetes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20the%20end%20of%20this%20blog%2C%20you%20should%20have%20the%20SQL%20Server%20deployed%20via%20the%20helm%20charts%20on%20the%20managed%20kubernetes%20service%20which%20in%20this%20case%20is%20Azure%20Kubernetes%20Service%20(AKS).%20For%20more%20information%20on%20Kubernetes%2C%20Helm%20chart%20please%20refer%20to%20articles%20mentioned%20below%20to%20get%20you%20started.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fkubernetes.io%2Fdocs%2Fconcepts%2Foverview%2Fwhat-is-kubernetes%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EWhat%20is%20Kubernetes%3C%2FA%3E%20%3F%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fhelm.sh%2Fdocs%2Ftopics%2Fcharts%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EWhat%20is%20helm%20chart%3C%2FA%3E%20%3F%3C%2FLI%3E%0A%3CLI%3EThe%20sample%20helm%20chart%20that%20we%20will%20use%20for%20this%20SQL%20Server%20deployment%20is%20available%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmssql-docker%2Ftree%2Fmaster%2Flinux%2Fsample-helm-chart%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20Please%20go%20through%20the%20readme%20file%2C%20to%20understand%20the%20files%20and%20values%20that%20you%20can%20chance%20and%20customize%20for%20your%20SQL%20Server%20deployment.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EWith%20the%20pre-read%20done%2C%20now%20lets%20start%20with%20deployment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--555470702%22%20id%3D%22toc-hId--555470702%22%20id%3D%22toc-hId--555470702%22%3EThe%20follow%20along%20plan-%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20deploy%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fkubernetes-walkthrough%23create-aks-cluster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAKS%20(Azure%20Kubernetes%20Service)%20cluster%3C%2FA%3E.%26nbsp%3B%20If%20you%20do%20not%20want%20to%20use%20AKS%20and%20want%20to%20create%20your%20custom%20kubernetes%20cluster%20you%20could%20do%20that%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20your%20windows%20client%20system%2C%20from%20where%20you%20will%20connect%20to%20the%20AKS%20cluster%20and%20deploy%20SQL%20Server%20using%20the%20helm%20chart%20below%2C%20the%20tools%20that%20need%20to%20be%20installed%20on%20the%20windows%20client%20are%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%20class%3D%22lia-list-style-type-lower-alpha%22%3E%0A%3CLI%20class%3D%22lia-align-left%22%3E%3CP%3EYou%20first%20install%20%22az%22%2C%20you%20can%20follow%20the%20steps%20documented%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Finstall-azure-cli-windows%3Ftabs%3Dazure-cli%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20From%20the%20link%2C%20download%20the%20current%20version%20of%20%22az%20cli%22%20exe%20and%20install%20the%20exe.%20If%20the%20installation%20is%20successful%2C%20you%20can%20type%20the%20command%20az%20in%20command%20prompt%20and%20if%20it%20is%20installed%20you%20should%20see%20output%20similar%20to%20the%20image%20shown%20below%3A%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_0-1609360512193.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243519i661328A91D7D40C4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_0-1609360512193.png%22%20alt%3D%22amvin87_0-1609360512193.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOnce%20you%20have%20the%20Azure%20CLI%20installed%20the%20next%20step%20is%20to%20install%20chocolatey%2C%20which%20is%20required%20to%20install%20helm%20on%20the%20windows%20client.%20To%20install%20chocolatey%2C%20follow%20the%20%3CA%20href%3D%22https%3A%2F%2Fchocolatey.org%2Fcourses%2Finstallation%2Finstalling%3Fmethod%3Dinstalling-chocolatey%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Echocolatey%20install%3C%2FA%3E%20documentation.%20Follow%20the%20%22Install%20with%20cmd.exe%22%20section%20for%20a%20installation%20via%20the%20cmd.exe.%20Once%20the%20installation%20of%20the%20chocolatey%20is%20complete%20to%20confirm%2C%20open%20cmd.exe%20and%20run%20the%20command%20%3A%20choco%20as%20shown%20below%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_1-1609360512196.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243518i7F424A4B80B0044D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_1-1609360512196.png%22%20alt%3D%22amvin87_1-1609360512196.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWith%20chocolatey%20installed%2C%20it%20is%20now%20time%20to%20%3CA%20href%3D%22https%3A%2F%2Fhelm.sh%2Fdocs%2Fintro%2Finstall%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Einstall%20helm%3C%2FA%3E.%20To%20install%20helm%2C%20open%20cmd.exe%20and%20run%20the%20command%3A%26nbsp%3B%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EChoco%20install%20kubernetes-helm%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BPost%20the%20successful%20installation%2C%20when%20you%20run%20helm%20command%20in%20the%20cmd.exe%20you%20should%20see%20the%20output%20as%20shown%20below%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_2-1609360512200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243520i484C34D4FD6E2A44%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_2-1609360512200.png%22%20alt%3D%22amvin87_2-1609360512200.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ENow%20it%20is%20time%20to%20install%20the%20%22kubectl%22%20tool%20to%20interact%20and%20work%20with%20the%20kubernetes%20cluster%2C%20to%20install%20kubectl%20in%20the%20command%20prompt%20run%20the%20command%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Eaz%20aks%20install-cli%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BPost%20the%20successful%20install%20of%20%22kubectl%22%20you%20should%20add%20the%20path%20to%20%22kubectl%22%20as%20one%20of%20the%26nbsp%3B%20environment%20variables.%20In%20my%20case%20the%20path%20to%20kubectl%20is%20at%20%22C%3A%5CUsers%5Camitkh%5C.azure-kubectl%22%26nbsp%3Bso%20I%20add%20the%20path%20to%20the%20environment%20variable%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_3-1609360512201.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243522i1F69EFB72FAB45C4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_3-1609360512201.png%22%20alt%3D%22amvin87_3-1609360512201.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20all%20the%20required%20tools%20installed%20on%20the%20windows%20client%2C%20we%20need%20to%20merge%20the%20context%20of%20the%20AKS%20cluster%20with%20the%20kubectl%2C%20so%20when%20we%20run%20kubectl%20or%20helm%20commands%20the%20operation%20takes%20place%20on%20that%20specific%20AKS%20cluster.%20To%20merge%2C%20run%20the%20command%20as%20described%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fkubernetes-walkthrough%23connect-to-the-cluster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Econnect%20to%20aks%20cluster%3C%2FA%3E%20which%20is%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Eaz%20aks%20get-credentials%20--resource-group%20%3CRESOURCEGROUPNAME%3E%20--name%20%3CAKS%20clustername%3D%22%22%3E%3C%2FAKS%3E%3C%2FRESOURCEGROUPNAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_4-1609360512203.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243521iA07D37A01D175E4D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_4-1609360512203.png%22%20alt%3D%22amvin87_4-1609360512203.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20this%20is%20done%2C%20when%20you%20run%20a%20kubectl%20command%20the%20execution%20happens%20in%20the%20context%20of%20the%20aks%20cluster%20that%20we%20merged%20our%20tools%20with%20in%20the%20above%20step.%20An%20example%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_5-1609360512204.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243523i16495A76378763D6%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_5-1609360512204.png%22%20alt%3D%22amvin87_5-1609360512204.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20are%20now%20ready%20to%20deploy%20the%20SQL%20Server%20on%20AKS%20cluster%20via%20the%20helm%20chart.%20You%20can%20download%20the%20sample%20helm-chart%20from%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmssql-docker%2Ftree%2Fmaster%2Flinux%2Fsample-helm-chart%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Egithub%3C%2FA%3E%20location.%20Please%20go%20through%20the%20readme%20file%20to%20ensure%20you%20understand%20the%20options%20that%20you%20need%20or%20can%20change%20as%20per%20your%20requirement%20and%20customization.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20the%20helm%20chart%20and%20all%20its%20file%20download%20to%20your%20windows%20client%2C%20switch%20to%20the%20directory%20where%20you%20have%20downloaded%20and%20after%20you%20have%20done%20modification%20to%20the%20downloaded%20helm%20chart%20to%20ensure%20it%20is%20as%20per%20your%20requirement%20and%20customization%2C%20deploy%20SQL%20Server%20using%20the%20command%20as%20shown%20below%2C%20you%20can%20change%20the%20deployment%20name%20(%22mssql-latest-deploy%22)%20to%20anything%20that%20you'd%20like.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Ehelm%20install%20mssql-latest-deploy%20.%20--set%20ACCEPT_EULA.value%3DY%20--set%20MSSQL_PID.value%3DDeveloper%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20a%20example%20for%20reference%2C%20I%20have%20the%20chart%20and%20its%20files%20downloaded%20to%20the%20mssql-latest%20directory%20and%20this%20is%20how%20it%20looks%20and%20then%20I%20run%20the%20helm%20install%20command%20to%20deploy%20SQL%20Server.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_6-1609360512206.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243526i59FA5710B23D3562%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_6-1609360512206.png%22%20alt%3D%22amvin87_6-1609360512206.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20a%20few%20minutes%2C%20you%20should%20see%20SQL%20Server%20deployed%20and%20ready%20to%20be%20used%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_7-1609360512207.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243525i930917811C223623%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_7-1609360512207.png%22%20alt%3D%22amvin87_7-1609360512207.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1932042131%22%20id%3D%22toc-hId-1932042131%22%20id%3D%22toc-hId-1932042131%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-124587668%22%20id%3D%22toc-hId-124587668%22%20id%3D%22toc-hId-124587668%22%3EConnect%20to%20the%20SQL%20Server%20running%20on%20AKS%3A%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3EUsing%20any%20of%20the%20familiar%20SQL%20Server%20tools%20like%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fssms%2Fdownload-sql-server-management-studio-ssms%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESSMS%3C%2FA%3E%26nbsp%3B(SQL%20Server%20Management%20Studio)%20or%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Ftools%2Fsqlcmd-utility%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESQLCMD%3C%2FA%3E%26nbsp%3Bor%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fazure-data-studio%2Fdownload-azure-data-studio%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EADS%3C%2FA%3E%26nbsp%3B(Azure%20Data%20Studio)%2C%20etc.%20You%20can%20connect%20to%20the%20instance%20of%20the%20SQL%20Server%20using%20the%20External-IP%20address%20for%20the%20%22mssql-latest-deploy%22%20service.%20In%20this%20case%20it%20is%2020.40.0.145.%3C%2FLI%3E%0A%3CLI%3EThe%20sa_password%20is%20the%20value%20you%20provide%20to%20the%20Values.sa_password%20in%20the%20values.yaml%20file%20in%20the%20helm%20chart.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_8-1609360512209.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243524iD7A184A079053A5F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_8-1609360512209.png%22%20alt%3D%22amvin87_8-1609360512209.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_9-1609360512210.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243527i603F6E9755909FA4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_9-1609360512210.png%22%20alt%3D%22amvin87_9-1609360512210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1682866795%22%20id%3D%22toc-hId--1682866795%22%20id%3D%22toc-hId--1682866795%22%3EChanging%20the%20tempdb%20path%3A%3C%2FH2%3E%0A%3CP%3EAs%20you%20would%20have%20noticed%20in%20the%20helm%20chart%2C%20we%20provide%20a%20specific%20location%20for%20tempdb%20files%20to%20ensure%20that%20the%20tempdb%20files%20are%20stored%20in%20those%20specific%20location.%20Here%20are%20the%20steps%20you%20can%20follow%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ETo%20change%20the%20tempdb%20location%20to%20the%20specific%20path%20you%20can%20connect%20to%20the%20SQL%20Server%20instance%20and%20then%20run%20the%20below%20T-SQL%20queries%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3E--%20Get%20the%20tempdb%20specific%20files%0Aselect%20*%20from%20sysaltfiles%20where%20dbid%3D2%0A--We%20want%20to%20move%20the%20tempdb%20files%20to%20this%20specific%20location%20%3A%20%2Fvar%2Fopt%2Fmssql%2Ftempdb%2F%2C%20---so%20here%20are%20the%20commands%3A%0AALTER%20DATABASE%20tempdb%20%0AMODIFY%20FILE%20(NAME%20%3D%20tempdev%2C%20FILENAME%20%3D%20'%2Fvar%2Fopt%2Fmssql%2Ftempdb%2Ftempdb.mdf')%3B%0AGO%0AALTER%20DATABASE%20tempdb%20%0AMODIFY%20FILE%20(NAME%20%3D%20tempdev2%2C%20FILENAME%20%3D%20'%2Fvar%2Fopt%2Fmssql%2Ftempdb%2Ftempdb2.ndf')%3B%0AGO%0AALTER%20DATABASE%20tempdb%20%0AMODIFY%20FILE%20(NAME%20%3D%20templog%2C%20FILENAME%20%3D%20'%2Fvar%2Fopt%2Fmssql%2Ftempdb%2Ftemplog.ldf')%3B%0AGO%0A--check%20and%20confirm%20that%20the%20locations%20for%20tempdb%20files%20are%20updated%0Aselect%20*%20from%20sysaltfiles%20where%20dbid%3D2%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B2.%20Now%20for%20the%20change%20to%20take%20in%20affect%2C%20you%20will%20have%20to%20restart%20the%20SQL%20Server%20container%20and%20you%20can%20do%20the%20same%20using%20the%20commands%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Ekubectl%20scale%20deployment%20mssql-latest-deploy%20--replicas%3D0%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BOnce%20you%20run%20the%20above%20command%2C%20wait%20for%20the%20container%20to%20be%20deleted%20and%20once%20it%20is%2C%20run%20the%20below%20command%20for%20the%20new%20container%20to%20be%20deployed%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Ekubectl%20scale%20deployment%20mssql-latest-deploy%20--replicas%3D1%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BHere%20you%20can%20now%20connect%20to%20the%20pod%20and%20check%20the%20tempdb%20files%20are%20now%20located%20to%20the%20new%20location%20%3A%20%2Fvar%2Fopt%2Fmssql%2Ftempdb%2F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22amvin87_10-1609360512213.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243528iD6F3A5F0C8BFFED7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22amvin87_10-1609360512213.png%22%20alt%3D%22amvin87_10-1609360512213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20you%20enjoyed%20it%20!!%20Happy%20learning!!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAmit%20Khandelwal%3C%2FP%3E%0A%3CP%3ESr.%20Program%20Manager%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2023375%22%20slang%3D%22en-US%22%3E%3CP%3EA%26nbsp%3Bbrief%26nbsp%3Bsnapshot%26nbsp%3Bof%26nbsp%3Bthe%26nbsp%3Bconversation%26nbsp%3Bthat%26nbsp%3Bmy%26nbsp%3Bcolleague%26nbsp%3Band%26nbsp%3BI%26nbsp%3Bhad%20a%20couple%20of%20weeks%20ago%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EColleague%3C%2FSTRONG%3E%3A%26nbsp%3B%20%3CEM%3E%22I%20am%20new%20to%20Kubernetes%20and%20Linux%20world%20and%20was%20hoping%20if%20I%20could%20deploy%20SQL%20Server%20using%20helm%20chart%20from%20my%20Helm%20on%20my%20windows%20client%20and%20a%20managed%20kubernetes%20cluster%20service%20like%20Azure%20kubernetes%20service%20cluster%20(AKS)%3F%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EMe%3C%2FSTRONG%3E%3A%26nbsp%3B%20%3CEM%3E%22Yes%2C%20you%20can!%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EColleague%3C%2FSTRONG%3E%3A%20%3CEM%3E%22Great!%20Can%20you%20share%20articles%20or%20guidance%20to%20do%20that%20so%20I%20could%20follow%20those%3F%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EMe%3C%2FSTRONG%3E%3A%20%3CEM%3E%22hmm..%20For%20Helm%20refer%20this..%20for%20Kubernetes%20refer%20this..%20For%20SQL%20Server%20deployment%20using%20helm%20on%20kubernetes%20refer%20this..%20%22%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eand%20that's%20when%20I%20noticed%20there%20wasn't%20a%20single%20stop%20end%20to%20end%20guidance.%20This%20is%20what%20prompted%20me%20to%20write%20this%20blog.%20And%20I%20hope%20this%20helps%20anyone%20who%20is%20new%20to%20Kubernetes%2Fhelm%20charts%20or%20even%20SQL%20Server%20and%20want%20to%20get%20started%20with%20the%20deployment%20of%20SQL%20Server%20on%20Kubernetes.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2023375%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerAzureVM%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQLServerTiger%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2031869%22%20slang%3D%22en-US%22%3ERe%3A%20Deploy%20SQL%20Server%20on%20Azure%20Kubernetes%20Service%20cluster%20via%20Helm%20Charts%20-%20on%20a%20windows%20client%20mach%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2031869%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F825574%22%20target%3D%22_blank%22%3E%40amvin87%3C%2FA%3E%26nbsp%3B%20for%20Sharing%20with%20the%20Community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

A brief snapshot of the conversation that my colleague and I had a couple of weeks ago:

Colleague"I am new to Kubernetes and Linux world and was hoping if I could deploy SQL Server using helm chart from my Helm on my windows client and a managed kubernetes cluster service like Azure kubernetes service cluster (AKS)?"

Me"Yes, you can!"

Colleague: "Great! Can you share articles or guidance to do that so I could follow those?"

Me: "hmm.. For Helm refer this.. for Kubernetes refer this.. For SQL Server deployment using helm on kubernetes refer this.. "

and that's when I noticed there wasn't a single stop end to end guidance. This is what prompted me to write this blog. And I hope this helps anyone who is new to Kubernetes/helm charts or even SQL Server and want to get started with the deployment of SQL Server on Kubernetes.

 

By the end of this blog, you should have the SQL Server deployed via the helm charts on the managed kubernetes service which in this case is Azure Kubernetes Service (AKS). For more information on Kubernetes, Helm chart please refer to articles mentioned below to get you started.

  1. What is Kubernetes ?
  2. What is helm chart ?
  3. The sample helm chart that we will use for this SQL Server deployment is available here. Please go through the readme file, to understand the files and values that you can chance and customize for your SQL Server deployment.

With the pre-read done, now lets start with deployment.

 

The follow along plan-

 

Please deploy an AKS (Azure Kubernetes Service) cluster.  If you do not want to use AKS and want to create your custom kubernetes cluster you could do that as well.

 

On your windows client system, from where you will connect to the AKS cluster and deploy SQL Server using the helm chart below, the tools that need to be installed on the windows client are:

 

  • You first install "az", you can follow the steps documented here. From the link, download the current version of "az cli" exe and install the exe. If the installation is successful, you can type the command az in command prompt and if it is installed you should see output similar to the image shown below:

 

amvin87_0-1609360512193.png

 

  • Once you have the Azure CLI installed the next step is to install chocolatey, which is required to install helm on the windows client. To install chocolatey, follow the chocolatey install documentation. Follow the "Install with cmd.exe" section for a installation via the cmd.exe. Once the installation of the chocolatey is complete to confirm, open cmd.exe and run the command : choco as shown below:

 

amvin87_1-1609360512196.png

 

  • With chocolatey installed, it is now time to install helm. To install helm, open cmd.exe and run the command: 
    Choco install kubernetes-helm​

         Post the successful installation, when you run helm command in the cmd.exe you should see the output as shown below

 

amvin87_2-1609360512200.png

 

  • Now it is time to install the "kubectl" tool to interact and work with the kubernetes cluster, to install kubectl in the command prompt run the command
    az aks install-cli

         Post the successful install of "kubectl" you should add the path to "kubectl" as one of the  environment variables. In my case the path to kubectl is at "C:\Users\amitkh\.azure-kubectl" so I add the path to the environment variable as shown below:

 

amvin87_3-1609360512201.png

 

With all the required tools installed on the windows client, we need to merge the context of the AKS cluster with the kubectl, so when we run kubectl or helm commands the operation takes place on that specific AKS cluster. To merge, run the command as described in the connect to aks cluster which is:

 

 

az aks get-credentials --resource-group <resourcegroupname> --name <aks clustername>

 

 

amvin87_4-1609360512203.png

 

Once this is done, when you run a kubectl command the execution happens in the context of the aks cluster that we merged our tools with in the above step. An example shown below:

 

amvin87_5-1609360512204.png

 

You are now ready to deploy the SQL Server on AKS cluster via the helm chart. You can download the sample helm-chart from this github location. Please go through the readme file to ensure you understand the options that you need or can change as per your requirement and customization.

 

Once you have the helm chart and all its file download to your windows client, switch to the directory where you have downloaded and after you have done modification to the downloaded helm chart to ensure it is as per your requirement and customization, deploy SQL Server using the command as shown below, you can change the deployment name ("mssql-latest-deploy") to anything that you'd like.

 

 

helm install mssql-latest-deploy . --set ACCEPT_EULA.value=Y --set MSSQL_PID.value=Developer

 

 

Here is a example for reference, I have the chart and its files downloaded to the mssql-latest directory and this is how it looks and then I run the helm install command to deploy SQL Server.

 

amvin87_6-1609360512206.png

 

After a few minutes, you should see SQL Server deployed and ready to be used as shown below:

 

amvin87_7-1609360512207.png

 

Connect to the SQL Server running on AKS:

  1. Using any of the familiar SQL Server tools like the SSMS (SQL Server Management Studio) or SQLCMD or ADS (Azure Data Studio), etc. You can connect to the instance of the SQL Server using the External-IP address for the "mssql-latest-deploy" service. In this case it is 20.40.0.145.
  2. The sa_password is the value you provide to the Values.sa_password in the values.yaml file in the helm chart.

amvin87_8-1609360512209.png

 

amvin87_9-1609360512210.png

 

Changing the tempdb path:

As you would have noticed in the helm chart, we provide a specific location for tempdb files to ensure that the tempdb files are stored in those specific location. Here are the steps you can follow:

 

  1. To change the tempdb location to the specific path you can connect to the SQL Server instance and then run the below T-SQL queries:

 

 

-- Get the tempdb specific files
select * from sysaltfiles where dbid=2
--We want to move the tempdb files to this specific location : /var/opt/mssql/tempdb/, ---so here are the commands:
ALTER DATABASE tempdb 
MODIFY FILE (NAME = tempdev, FILENAME = '/var/opt/mssql/tempdb/tempdb.mdf');
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = tempdev2, FILENAME = '/var/opt/mssql/tempdb/tempdb2.ndf');
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = templog, FILENAME = '/var/opt/mssql/tempdb/templog.ldf');
GO
--check and confirm that the locations for tempdb files are updated
select * from sysaltfiles where dbid=2

 

 

     2. Now for the change to take in affect, you will have to restart the SQL Server container and you can do the same using the commands below:

 

 

kubectl scale deployment mssql-latest-deploy --replicas=0

 

 

         Once you run the above command, wait for the container to be deleted and once it is, run the below command for the new container to be deployed

 

 

kubectl scale deployment mssql-latest-deploy --replicas=1

 

 

         Here you can now connect to the pod and check the tempdb files are now located to the new location : /var/opt/mssql/tempdb/

 

amvin87_10-1609360512213.png

 

Hope you enjoyed it !! Happy learning!!

 

Amit Khandelwal

Sr. Program Manager 

1 Comment

Thanks @amvin87  for Sharing with the Community :cool: