-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql_replica_set.yaml
54 lines (54 loc) · 1.42 KB
/
mysql_replica_set.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
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: mysql
# labels so that we can bind a Service to this Pod
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: database
image: mysql:5.7
# use this on ARM:
# image: biarms/mysql:5.7
resources:
limits:
memory: 512Mi
requests:
memory: 256Mi
args:
# We need this to prevent mysql from throwing up -- our DO volume will be mounted here
- "--ignore-db-dir=lost+found"
# A nice way to get a whole bunch of values from a k8s secret into a container's environment variables
envFrom:
- secretRef:
name: wp-db-secrets
## The old way (one for each value):
# env:
# # Use a secret, avoid having plaintext passwords all over your configs
# - name: MYSQL_ROOT_PASSWORD
# valueFrom:
# secretKeyRef:
# name: wp-db-secrets
# key: MYSQL_ROOT_PASSWORD
livenessProbe:
tcpSocket:
port: 3306
ports:
- containerPort: 3306
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql
volumes:
- name: mysql-data
persistentVolumeClaim:
claimName: mysql-volume