-
Notifications
You must be signed in to change notification settings - Fork 1
/
pxc.yaml
103 lines (103 loc) · 2.44 KB
/
pxc.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
apiVersion: v1
kind: Service
metadata:
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: pxccluster1
labels:
app: percona-xtradb-cluster
spec:
ports:
- port: 3306
name: mysql-port
clusterIP: None
selector:
app: percona-xtradb-cluster
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: pxcnode
spec:
selector:
matchLabels:
app: percona-xtradb-cluster
serviceName: "pxccluster1"
replicas: 3
template:
metadata:
labels:
app: percona-xtradb-cluster
spec:
containers:
- name: mysql
image: perconalab/pxc-openshift
imagePullPolicy: Always
ports:
- containerPort: 3306
name: mysql
- containerPort: 4444
name: sst
- containerPort: 4567
name: replication
- containerPort: 4568
name: ist
readinessProbe:
exec:
command:
- /usr/bin/clustercheck.sh
initialDelaySeconds: 15
timeoutSeconds: 15
periodSeconds: 30
failureThreshold: 5
livenessProbe:
exec:
command:
- /usr/bin/clustercheck.sh
initialDelaySeconds: 300
timeoutSeconds: 5
periodSeconds: 10
volumeMounts:
- name: datadir
mountPath: /var/lib/mysql
subPath: mysql
- name: config-volume
mountPath: /etc/mysql/conf.d/
env:
- name: MYSQL_FORCE_INIT
value: "1"
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwords
key: root
- name: XTRABACKUP_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwords
key: xtrabackup
- name: MONITOR_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwords
key: monitor
- name: CLUSTERCHECK_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-passwords
key: clustercheck
volumes:
- name: config-volume
configMap:
name: mysql
optional: true
volumeClaimTemplates:
- metadata:
name: datadir
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi