Data Management in Kubernetes Using Kanister T om Manville | April - - PowerPoint PPT Presentation

data management in kubernetes using kanister
SMART_READER_LITE
LIVE PREVIEW

Data Management in Kubernetes Using Kanister T om Manville | April - - PowerPoint PPT Presentation

Data Management in Kubernetes Using Kanister T om Manville | April 25th, 2018 2 3 4 yes* 5 Database Operations in Kubernetes kanister.io 6 Agenda Background DB in a container DB in Kubernetes Kanister Use


slide-1
SLIDE 1

T

  • m Manville | April 25th, 2018

Data Management in Kubernetes Using Kanister

slide-2
SLIDE 2

2

slide-3
SLIDE 3

3

slide-4
SLIDE 4

4

slide-5
SLIDE 5

5

yes*

slide-6
SLIDE 6

6

Database Operations in Kubernetes

kanister.io

slide-7
SLIDE 7

7

Agenda

  • Background
  • DB in a container
  • DB in Kubernetes
  • Kanister
  • Use Cases
  • Components
  • Walkthrough
  • Demo
slide-8
SLIDE 8

8

whoami

slide-9
SLIDE 9

9

DB in a Container

$ docker run -d \ percona/percona-server:5.7

slide-10
SLIDE 10

10

DB in a Container

$ docker run -d \ –v /local/datadir:/var/lib/mysql \ percona/percona-server:5.7

slide-11
SLIDE 11

11

Cloud Native

  • Container Package
  • Dynamically Managed
  • Micro-Services Oriented
slide-12
SLIDE 12

12

slide-13
SLIDE 13

13

slide-14
SLIDE 14

14

slide-15
SLIDE 15

15

Requirements

https://kubernetes.io/ https://github.com/kubernetes/kubernetes https://www.helm.sh/ https://github.com/kubernetes/helm

slide-16
SLIDE 16

16

DB in Kubernetes

$ helm install stable/percona

slide-17
SLIDE 17

17

Application Centric Use Cases

  • Portability between cloud providers
  • Testing on real data
  • Filtering
  • Masking
  • Backup/Recover
  • Distributed point-in-time consistency
  • Incremental backups
slide-18
SLIDE 18

18

Install Kanister

$ helm install stable/kanister-operator $ helm repo add kanister http://charts.kanister.io

slide-19
SLIDE 19

19

Kanister DB Charts

$ helm install kanister/kanister-mysql \

  • -set kanister.s3_bucket="mysql-backup-bucket"

\

  • -set kanister.s3_api_key="${AWS_ACCESS_KEY_ID}"

\

  • -set kanister.s3_api_secret="${AWS_SECRET_ACCESS_KEY}" \
slide-20
SLIDE 20

20

Kanister Components

API Objects

  • ActionSet
  • Blueprints
  • Profiles (coming soon!)
  • Locations
  • Credentials

Controller

  • Watches for new API objects
  • Launches actions
  • Creates events / logs status
slide-21
SLIDE 21

21

Controller Blueprint Database

slide-22
SLIDE 22

22

Controller Blueprint CLI Database

slide-23
SLIDE 23

23

ActionSet Controller Blueprint CLI Database

slide-24
SLIDE 24

24

ActionSet Controller Blueprint CLI Database

slide-25
SLIDE 25

25

ActionSet Controller Blueprint CLI Database

slide-26
SLIDE 26

26

ActionSet Controller Blueprint Action CLI Database

slide-27
SLIDE 27

27

ActionSet Controller Blueprint Action CLI Database

slide-28
SLIDE 28

28

ActionSet Controller Blueprint Action CLI Database

slide-29
SLIDE 29

Demos

Click to add text

slide-30
SLIDE 30

30

An Abridged ActionSet

spec: actions:

  • name: backup

blueprint: mysql-blueprint

  • bject:

kind: Deployment name: mysql-sakila namespace: video-store-app status: ...

slide-31
SLIDE 31

31

backup: phases:

  • func: KubeExec

args:

  • "{{ .Deployment.Namespace }}"
  • "{{ index .Deployment.Pods 0 }}"
  • kanister-sidecar
  • bash
  • -c
  • |

s3_path="s3://${S3_BUCKET}/{{ .ArtifactsOut.mysqlCloudDump.path }}" s3_cmd=(aws "${S3_VERIFY_SSL}" s3 cp - "${s3_path}") mysqldump --password="${MYSQL_ROOT_PASSWORD}" | gzip - | ${s3_cmd[@]}

Blueprint: Backup

slide-32
SLIDE 32

32

restore: phases:

  • func: KubeExec

args:

  • "{{ .Deployment.Namespace }}"
  • "{{ index .Deployment.Pods 0 }}"
  • kanister-sidecar
  • bash
  • -c
  • |

s3_path="s3://${S3_BUCKET}/{{ .ArtifactsIn.mysqlCloudDump.path }}" s3_cmd=(aws "${S3_VERIFY_SSL}" s3 cp "${s3_path}" -) ${s3_cmd[@]} | gunzip -c - | mysql --password="${MYSQL_ROOT_PWD}"

Blueprint: Restore

slide-33
SLIDE 33

33

Chaining ActionSets

$ kanctl perform restore --from backup-mysql-04-23

slide-34
SLIDE 34

34

Database Operations in Kubernetes

kanister.io

slide-35
SLIDE 35

35

Try Kanister Today!

  • Site: https://kanister.io/
  • Github: https://github.com/kanisterio/kanister
  • Docs: https://docs.kanister.io/
  • Slack: https://kasten.typeform.com/to/QBcw8T
slide-36
SLIDE 36

Backup Slides

Click to add text

slide-37
SLIDE 37

37

slide-38
SLIDE 38

38

slide-39
SLIDE 39

39

slide-40
SLIDE 40

40

Common Databases

slide-41
SLIDE 41

41

slide-42
SLIDE 42

42