T
- m Manville | April 25th, 2018
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
T
2
3
4
5
6
kanister.io
7
8
9
$ docker run -d \ percona/percona-server:5.7
10
$ docker run -d \ –v /local/datadir:/var/lib/mysql \ percona/percona-server:5.7
11
12
13
14
15
https://kubernetes.io/ https://github.com/kubernetes/kubernetes https://www.helm.sh/ https://github.com/kubernetes/helm
16
$ helm install stable/percona
17
18
$ helm install stable/kanister-operator $ helm repo add kanister http://charts.kanister.io
19
$ helm install kanister/kanister-mysql \
\
\
20
API Objects
Controller
21
Controller Blueprint Database
22
Controller Blueprint CLI Database
23
ActionSet Controller Blueprint CLI Database
24
ActionSet Controller Blueprint CLI Database
25
ActionSet Controller Blueprint CLI Database
26
ActionSet Controller Blueprint Action CLI Database
27
ActionSet Controller Blueprint Action CLI Database
28
ActionSet Controller Blueprint Action CLI Database
Click to add text
30
spec: actions:
blueprint: mysql-blueprint
kind: Deployment name: mysql-sakila namespace: video-store-app status: ...
31
backup: phases:
args:
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[@]}
32
restore: phases:
args:
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}"
33
$ kanctl perform restore --from backup-mysql-04-23
34
kanister.io
35
Click to add text
37
38
39
40
41
42