-
Notifications
You must be signed in to change notification settings - Fork 70
/
5_medilab-db-statefulset.yml
55 lines (52 loc) · 1.32 KB
/
5_medilab-db-statefulset.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: medilab-db-deployment
namespace: medilab-db-ns
labels:
type: db
env: dev
spec:
replicas: 3
serviceName: medilab-db-service
selector:
matchLabels:
app: medilab-app-db
template:
metadata:
labels:
app: medilab-app-db
spec:
volumes:
- name: medilab-app-data
persistentVolumeClaim:
claimName: medilab-mysql-pvc
containers:
- name: medilab-app-db-container
image: mysql
ports:
- containerPort: 3306
resources:
limits:
cpu: 500m
requests:
cpu: 200m
volumeMounts:
- name: medilab-app-data
mountPath: /var/lib/mysql
env:
- name: MYSQL_DATABASE
#value: medilab-app-schema
valueFrom:
configMapKeyRef:
key: MEDILAB_DB_SCHEMA_NAME
name: medilab-config-map
#- name: MYSQL_USER
# value: root
- name: MYSQL_ROOT_PASSWORD
value: root
#valueFrom:
#secretKeyRef:
# name: medilab-config-secret
# key: medilab-db-password
restartPolicy: Always