Inside SQL Server Containers Bob Ward Principal Architect
Inside SQL Server Containers Bob Ward, Principal Architect, Microsoft https: //aka. ms/bobsql https: //aka. ms/bobwardms https: //aka. ms/bobsqldemos
Why Containers? Portable Run anywhere Docker is supported Container configuration Persisted storage Lightweight Reduced disk, CPU, and memory footprint Consistent image of SQL Server, scripts, and tools Efficient Faster deployment, reduced patching, and less downtime Switch for simple upgrades Container Database Container
Layered snapshot of a set of files structured in a filesystem Built with a Dockerfile using docker build or APIs Most built with a base image of an OS The base image OS must be the same kernel as host Container Image VM = emulate hardware and load entire OS Containers = isolation but cooperate with host kernel Runtime instance of an image Run as many you like based on the same image Isolated but can communicate with the “outside” Has access by default to all CPU and memory resources Each container has writeable layer but share read-only image layer Start and stop do not affect writeable layer Remove deletes writeable layer Volumes provide persistence on host
SQL Mac Challenge
OCI libcontainer Namespace • process, network, and other resource isolation Union File System (Union. FS) • layered file system Control Groups (cgroups) • accounting, governance, notifications
https: //hub. docker. com https: //access. redhat. com/containers SQL Server Engine preinstalled SQL Server tools preinstalled See here how to add other packages Database and application compatibility
environment variables
environment variables
SQL Server Docker Files on Git. Hub Dockerfile reference Dockerfile best practices
sqlservr forks sqlservr env variables used as startup parameters /var/opt/mssql structure created and populated System databases and files extracted from. sfp files Engine now runs as a process
Docker compose See here how to add other packages
1 Host Storage Volume 3 2 4
Getting Started Git. Hub repo http: //aka. ms/sqllinuxlabs talk Docker: Up and Running Managing Kubernetes K 8 s Training Course k 8 s https: //aka. ms/k 8 slearning Brendan’s whiteboard sessions on k 8 s
Questions? aka. ms/SQLBits 19
Container and k 8 s course https: //aka. ms/k 8 slearning
here minikube Kubeadm Red. Hat Open. Shift • Single node on your laptop • Install your own cluster • K 8 s platform private or public cloud Azure Kubernetes Service (AKS) Open. Shift on Azure (OSA) Other • Azure hosted k 8 s • Managed Open. Shift on Azure • Azure Stack • Windows Server
SQL Server - Shared storage HA in Kubernetes Built-in HADR orchestration with no clustering required Node Pod Kubernetes SQL Server Load Balancer Service SQL Server User Pod SQL Server Persistent Volume Storage
Availability groups on Kubernetes Pod Load balancer Operator AG Pod SQL Server primary secondary AG agent Load balancer Pod SQL Server primary secondary AG agent SQL Server secondary AG agent
- Slides: 30