-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmysql-example.yml
76 lines (76 loc) · 1.75 KB
/
mysql-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apiVersion: v1
kind: Service
metadata:
labels:
app: mysql
name: mysql
spec:
ports:
- name: "3306"
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: mysql
sessionAffinity: None
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mysql
spec:
serviceName: "mysql"
replicas: 1
template:
metadata:
labels:
app: mysql
annotations:
pod.beta.kubernetes.io/init-containers: '[{
"name": "setup",
"image": "thenatureofsoftware/mc",
"args": ["mirror", "minio/store0", "/var/lib/mysql"],
"volumeMounts": [{
"mountPath": "/var/lib/mysql",
"name": "persistentdata"
}]
},
{
"name": "chown",
"image": "tobi312/rpi-mysql:5.6",
"command": ["chown", "-R", "mysql:mysql", "/var/lib/mysql"],
"volumeMounts": [{
"mountPath": "/var/lib/mysql",
"name": "persistentdata"
}]
}]'
spec:
containers:
- env:
- name: MYSQL_ROOT_PASSWORD
value: root
- name: MYSQL_DATABASE
value: test
image: tobi312/rpi-mysql:5.6
imagePullPolicy: Always
name: mysql
volumeMounts:
- mountPath: "/var/lib/mysql"
name: persistentdata
ports:
- containerPort: 3306
protocol: TCP
resources: {}
- image: thenatureofsoftware/mc-mirror:latest
imagePullPolicy: Always
name: mc-mirror
args:
- /var/lib/mysql
- minio/store0
volumeMounts:
- mountPath: "/var/lib/mysql"
name: persistentdata
restartPolicy: Always
volumes:
- name: persistentdata
emptyDir: {}