-
Notifications
You must be signed in to change notification settings - Fork 299
/
mysql.yml
76 lines (76 loc) · 1.73 KB
/
mysql.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: extensions/v1beta1
kind: Deployment
metadata:
name: mysql-k8s-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: mysql-k8s
group: artifactory-k8s-demo
spec:
containers:
- name: db-mysql-k8s
image: docker.bintray.io/mysql:5.6.35
env:
- name: MYSQL_DATABASE
value: artdb
- name: MYSQL_USER
value: artifactory
- name: MYSQL_PASSWORD
value: password
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
volumeMounts:
- mountPath: "/var/lib/mysql"
name: db-volume
resources:
requests:
memory: "500Mi"
cpu: "100m"
limits:
memory: "1Gi"
cpu: "500m"
livenessProbe:
exec:
command:
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
exec:
command:
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
volumes:
- name: db-volume
persistentVolumeClaim:
claimName: mysql-claim
---
apiVersion: v1
kind: Service
metadata:
name: mysql-k8s-service
labels:
app: mysql-k8s-service
group: artifactory-k8s-demo
spec:
ports:
- port: 3306
protocol: TCP
selector:
app: mysql-k8s