Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Run Containerized Database SQL Server 2017 Linux

Run Containerized Database SQL Server 2017 Linux

The talk demonstrated the ease with which SQL Server 2017 running on Linux can be containerised. The demo application will showed a basic Web API interfacing with SQL Server 2017 running inside docker containers. The fully integrated API along with containerized database was deployed to managed Kubernetes cluster running on Azure using Azure Container Service (AKS). Persistent data management was handled using Azure Disk attached to Kubernetes cluster using the StatefulSets feature.

Nilesh Gule

June 30, 2018
Tweet

More Decks by Nilesh Gule

Other Decks in Technology

Transcript

  1. $whoami { “name” : “Nilesh Gule”, “title” : “Architect”, “website”

    : “https://www.HandsOnArchitect.com", “github” : “https://github.com/NileshGule" “twitter” : “@nileshgule”, “linkedin” : “https://www.linkedin.com/in/nileshgule”, “email” : “[email protected]", “likes” : “Technical Evangelism, Cricket” }
  2. Agenda - SQL Server 2017 Linux container - .Net Core

    Web API with containerized database - Container deployment to Azure Kubernetes Service (AKS) - State Management with Persistent Data Volumes
  3. Kubernetes cluster resources Resources - Network Security Group - Virtual

    Machine - Virtual Network - Public IP - Load balancer
  4. Kubernetes Open-source system for automating deployment, scaling, and management of

    containerized application across clusters of machines Basic Objects - Namespace - Pod - Volume - Service Controllers - ReplicaSet - Deployment - StatefulSet - DemonSet
  5. Kubernetes - Deployment - Desired state definitions for pods and

    replica sets - Defines - version of container images - Resource limits - volumes for data persistence - number of replicas - update strategy - Metadata to interact with resources
  6. Kubernetes - StatefulSet - Use StatefulSets when data loss is

    unacceptable - Useful when replicas are needed for availability or scalability, and the replicas need stable volume mounts across restarts - Often used when deploying database workloads that store their state on external storage providers - With StatefulSets a crash of pod or cluster does not result in data loss
  7. Persistent Volumes Node1 Node 2 Node 3 Node1 Node 2

    Node 3 Node1 Node 2 Node 3 Node1 Node 2 Node 3 Without PV With PV
  8. Persistent Volume - Storage class & PVC - StorageClass provides

    the specifications of the external persistent storage - PersistenceVolumeClaim (PVC) ensures that data is stored on an external storage device outside the Kubernetes cluster
  9. - AKS Cluster Kubernetes Service nileshgule/sqlclient nileshgule/techtalksapi microsoft/mssql-linux-server - nileshgule/sqlclient

    nileshgule/techtalksapi microsoft/mssql-linux-server Service Discovery External Communication - Loadbalancer Nodeport AKS Cluster
  10. Summary - Spin container - Interact using Web API &

    Postman - Persistent Storage - PVC - Deployment - StatefulSets - K8s secrets - 2 Node cluster
  11. References ✴ Demo code - https://github.com/NileshGule/DataDaySG-2018 ✴ SQL 2017 Supported

    features on Linux - https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-editions-and- components-2017?view=sql-server-linux-2017 ✴ SQL Server 2017 comparisons - https://www.microsoft.com/en-us/sql-server/sql-server-2017-comparison ✴ Unsupported features - https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes?view=sql-server- linux-2017#Unsupported ✴ Azure Kubernetes Service (AKS) - https://azure.microsoft.com/en-us/services/kubernetes-service/ ✴ Docker getting started - https://docs.docker.com/get-started/ ✴ Docker Compose V3 - https://docs.docker.com/compose/compose-file/#build ✴ Kubernetes Basics - https://kubernetes.io/docs/tutorials/kubernetes-basics/ ✴ Azure Kubernetes objects - https://msft.social/TIRUaN ✴ Kubernetes secrets - https://kubernetes.io/docs/concepts/configuration/secret/ ✴ https://www.handsonarchitect.com/2018/01/integrate-sql-server-2017-linux-with.html
  12. Q&A