Top Banner
47

Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Jan 22, 2018

Download

Technology

Travis Wright
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 2: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 3: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

The New Reality

3

Data and Agility are the only hope of survival

Page 4: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

4https://www.innosight.com/insight/corporate-longevity-turbulence-ahead-for-large-organizations/

https://www2.deloitte.com/us/en/pages/mergers-and-acquisitions/articles/ma-trends-report.html

Longevity is not a given anymore

Page 5: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Disruption happens practically overnight

5

Page 6: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Nature of Software Delivery Has Changed

Page 7: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

DevOps Principles in Focus

7

Page 8: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

9

Page 9: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Container Benefits

9

This is not a fad!

Page 10: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

…but wait…

10

Page 11: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Docker Databases

11

Most of the most popular images are databases

Postgres: 10M+ pulls

Mysql: 10M+ pulls

Redis: 10M+ pulls

Mongo: 10M+ pulls

SQL Server on Linux has had ~2M+ pulls in the first 10 months

Page 12: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Persisting Storage

12

Mount a volume to the host

Local storage

Remote storage

Mount a container volume

docker run … -v /my/host/dir:/my/container/dir …

docker create -v /mydata --name mydatacontainer …docker run --volumes-from mydatacontainer …

Read this!

https://docs.docker.com/engine/tutorials/dockervolumes/

Page 13: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Build & Test Locally in Dev Environment

13

Build locally on Windows, Linux, or macOS

Windows

Linux Docker containers using Docker for Windows

Windows containers on Windows 10 Anniversary Edition+

macOS

Linux Docker containers using Docker for Mac

Linux

Use Docker Engine natively

There are other container engines like LXC

Use for demo today

Page 14: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Application Deployment Patterns Using Containers

14

SQL Server

App 1 App 2

SQL Server

App 1

SQL Server

+

App 1

Centralized SQL Server Docker Compose Monolithic App or

Microservice

Page 15: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 16: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 17: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 18: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Real World Example – SQL Server Team

18

SQL Server Engineering Team uses Kubernetes in Azure VMs for

automated testing of SQL Server on Linux

Automated build process creates the container image

Extended existing test system to handle provisioning and test

execution/targeting

~700 containers per test run, usually once per day

150 VM hosts in Azure; 128 GB/8 cores

20+ containers/VM in some cases

High density, each SQL Server container listens on a different

port

Page 19: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Real World Example – DV01

https://customers.microsoft.com/en-us/story/dv01

Page 20: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 21: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 22: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 23: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

NETWORKING

Page 24: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Container to Container on the Same Host

2

4

OVS PACKET FLOW

NODE

POD 1veth0

10.1.15.2/24

br0

10.1.15.1/24

192.168.0.100

eth0

POD 2veth1

10.1.15.3/24

vxlan0

Page 25: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

NODE 2

NODE 1

2

5

OVS PACKET FLOW

POD 1veth0

10.1.15.2/24

br0

10.1.15.1/24vxlan0

POD 2veth0

10.1.20.2/24

br0

10.1.20.1/24vxlan0

192.168.0.100

eth0

192.168.0.200

eth0

Container to Container on the Different Hosts

Page 26: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Container Connects to External Host

Container to Container on Different Hosts

2

6

OVS PACKET FLOW

NODE 1

POD 1veth0

10.1.15.2/24

br0

10.1.15.1/24tun0

192.168.0.100

External

Hosteth0

Page 27: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

SERVICE

POD POD

ROUTER

POD

EXTERNAL TRAFFIC

INTERNAL TRAFFIC

ROUTE EXPOSES SERVICES EXTERNALLY

Page 28: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

ROUTE SPLIT TRAFFIC

SERVICE A

App A App A

SERVICE B

App B App B

ROUTE

10%

traffic

90% traffic

Split Traffic Between

Multiple Services For A/B

Testing, Blue/Green and

Canary Deployments

Page 29: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 30: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

“For which workloads or application use cases have you used/do you anticipate touse containers?”

DataApps

77%CloudApps

71%Systems of

Engagement

62%

Systems of

Record

62%

Web andCommerce

Software

57%MobileApps

52%SocialApps

46%

Scalable, Cost Effective, Distributed Storage for Containers

\

Page 31: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

● Persistent Volume are tied to a piece of network storage

● Provisioned by an administrator either statically or dynamically

● Allows admins to describe storage and users to request storage

PERSISTENT STORAGE

NFS GlusterFSOpenStack

CinderCeph

RBD

Azure

BlobFibre

ChannelAzure

File

Azure

DiskiSCSI

Page 32: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

PROJECT

POOL OF PERSISTENT VOLUMES

PERSISTENT STORAGE

NFS

PV

iSCS

I

PV

NFS

PV

Admin

User

register PV

create claim

NFS

PVGlusterFS

PV

Pod

claim

Pod

claim

Pod

claim

Ceph

RBD

PV

Page 33: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

3

3

DYNAMIC VOLUME PROVISIONING

Admin

User

define StorageClass

create claim: Fastest

SlowAzure-Disk

FastAWS-SSD

FastestNetApp-Flash

NetApp

Provisioner

AWS

Provisioner

Pod

claim

PV

OpenShift

PV Controller

provision

Azure

Provisioner

bound

Page 34: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

NODENODENODE

CONTAINER-NATIVE STORAGE

NODE

POD POD POD POD POD POD POD

POD POD POD

RHG

S

RHG

S

RHG

S

POD POD POD

MASTER

Page 35: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 36: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

NODE

MASTER● Secure mechanism for holding sensitive

data e.g.

○ Passwords and credentials

○ SSH Keys

○ Certificates

● Secrets are made available as

○ Environment variables

○ Volume mounts

○ Interaction with external systems

● Encrypted in transit

● Never rest on the nodes3

6

SECRET MANAGEMENT

Container

Distributed Store

Container

Page 37: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Secret Example

Page 38: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 39: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 40: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 41: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 42: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 43: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

https://hub.docker.com/r/microsoft/mssql-server-linux/

https://www.openshift.com/dedicated/test-drive.html

https://github.com/twright-msft/example-voting-app

https://github.com/twright-msft/mssql-server-rhel

https://github.com/twright-msft/contoso-u

https://github.com/twright-msft/contoso-u DevOps: CI/CD with Microsoft SQL Server 2017

Tomorrow at 12:30 – 1:45, Hyatt International

Page 44: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift
Page 45: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Key Docker Terminology and Commands

45

Image – A definition. Defines what software is included and how it runs.

Container – A running instance based on the image.

docker pull – download an image from a Docker respository

docker run – create a container from an image

docker ps – list all locally running containers

docker images – list all locally cached images

You do not “install” a Docker container!

Page 46: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift

Master.mdfContosoUniversity.ldf

ContosoUniversity.mdf

db-prod:latest

Page 47: Microsoft Ignite 2017 - SQL Server on Kubernetes, Swarm, and Open Shift