Slide 1

Slide 1 text

Tom Manville | April 25th, 2018 Data Management in Kubernetes Using Kanister

Slide 2

Slide 2 text

2

Slide 3

Slide 3 text

3

Slide 4

Slide 4 text

4

Slide 5

Slide 5 text

5 yes*

Slide 6

Slide 6 text

6 Database Operations in Kubernetes kanister.io

Slide 7

Slide 7 text

7 Agenda • Background • DB in a container • DB in Kubernetes • Kanister • Use Cases • Components • Walkthrough • Demo

Slide 8

Slide 8 text

8 whoami

Slide 9

Slide 9 text

9 DB in a Container $ docker run -d \ percona/percona-server:5.7

Slide 10

Slide 10 text

10 DB in a Container $ docker run -d \ –v /local/datadir:/var/lib/mysql \ percona/percona-server:5.7

Slide 11

Slide 11 text

11 Cloud Native • Container Package • Dynamically Managed • Micro-Services Oriented

Slide 12

Slide 12 text

12

Slide 13

Slide 13 text

13

Slide 14

Slide 14 text

14

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

16 DB in Kubernetes $ helm install stable/percona

Slide 17

Slide 17 text

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 text

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

Slide 19

Slide 19 text

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 text

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 text

21 Controller Blueprint Database

Slide 22

Slide 22 text

22 Controller Blueprint CLI Database

Slide 23

Slide 23 text

23 ActionSet Controller Blueprint CLI Database

Slide 24

Slide 24 text

24 ActionSet Controller Blueprint CLI Database

Slide 25

Slide 25 text

25 ActionSet Controller Blueprint CLI Database

Slide 26

Slide 26 text

26 ActionSet Controller Blueprint Action CLI Database

Slide 27

Slide 27 text

27 ActionSet Controller Blueprint Action CLI Database

Slide 28

Slide 28 text

28 ActionSet Controller Blueprint Action CLI Database

Slide 29

Slide 29 text

Demos Click to add text

Slide 30

Slide 30 text

30 An Abridged ActionSet spec: actions: - name: backup blueprint: mysql-blueprint object: kind: Deployment name: mysql-sakila namespace: video-store-app status: ...

Slide 31

Slide 31 text

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 text

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 text

33 Chaining ActionSets $ kanctl perform restore --from backup-mysql-04-23

Slide 34

Slide 34 text

34 Database Operations in Kubernetes kanister.io

Slide 35

Slide 35 text

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 text

Backup Slides Click to add text

Slide 37

Slide 37 text

37

Slide 38

Slide 38 text

38

Slide 39

Slide 39 text

39

Slide 40

Slide 40 text

40 Common Databases

Slide 41

Slide 41 text

41

Slide 42

Slide 42 text

42