KEMBAR78
Run Containerized Database SQL Server 2017 Linux | PDF
Running Containerized Database
SQL Server 2017 Linux
Nilesh Gule
$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” :“nileshgule@gmail.com",
“likes” :“Technical Evangelism, Cricket”
}
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
Application Overview
SQL Server
2017 Linux
Getting Started with SQL Server 2017 Linux container
Env variables
- ACCEPT_EULA
- SA_PASSWORD
Containerize
App
Docker-compose
Managed
Kubernetes
Cluster (AKS)
on Azure
Kubernetes cluster resources
Resources
- Network Security Group
- Virtual Machine
- Virtual Network
- Public IP
- Load balancer
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
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
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
State Management with
Persistent Volume
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
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
Demo - AKS Deployment
-
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
Summary
- Spin container - Interact using
Web API &
Postman
- Persistent
Storage
- PVC
- Deployment
- StatefulSets
- K8s secrets
- 2 Node cluster
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
Thank you
very much
https://github.com/NileshGule/DataDaySG-2018
Code with Passion and Strive for Excellence
Q&A

Run Containerized Database SQL Server 2017 Linux

  • 1.
    Running Containerized Database SQLServer 2017 Linux Nilesh Gule
  • 2.
    $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” :“nileshgule@gmail.com", “likes” :“Technical Evangelism, Cricket” }
  • 3.
    Agenda - SQL Server2017 Linux container - .Net Core Web API with containerized database - Container deployment to Azure Kubernetes Service (AKS) - State Management with Persistent Data Volumes
  • 4.
  • 5.
  • 6.
    Getting Started withSQL Server 2017 Linux container Env variables - ACCEPT_EULA - SA_PASSWORD
  • 7.
  • 8.
  • 9.
  • 10.
    Kubernetes cluster resources Resources -Network Security Group - Virtual Machine - Virtual Network - Public IP - Load balancer
  • 11.
    Kubernetes Open-source system forautomating deployment, scaling, and management of containerized application across clusters of machines Basic Objects - Namespace - Pod - Volume - Service Controllers - ReplicaSet - Deployment - StatefulSet - DemonSet
  • 12.
    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
  • 13.
    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
  • 14.
  • 15.
    Persistent Volumes Node1 Node2 Node 3 Node1 Node 2 Node 3 Node1 Node 2 Node 3 Node1 Node 2 Node 3 Without PV With PV
  • 16.
    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
  • 17.
    Demo - AKSDeployment
  • 18.
    - AKS Cluster Kubernetes Service nileshgule/sqlclient nileshgule/techtalksapimicrosoft/mssql-linux-server - nileshgule/sqlclient nileshgule/techtalksapi microsoft/mssql-linux-server Service Discovery External Communication - Loadbalancer Nodeport AKS Cluster
  • 19.
    Summary - Spin container- Interact using Web API & Postman - Persistent Storage - PVC - Deployment - StatefulSets - K8s secrets - 2 Node cluster
  • 20.
    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
  • 21.
  • 22.