-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathistory-app-deploy.yaml
62 lines (62 loc) · 1.67 KB
/
istory-app-deploy.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: istory
labels:
app: istory
spec:
selector:
matchLabels:
app: istory
replicas: 3
template:
metadata:
labels:
app: istory
spec:
initContainers:
- name: check-mysql-ready
image: mysql:8.0
env:
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: istory-db-secret
key: MYSQL_PASSWORD
command: ['sh',
'-c',
'until mysqladmin ping -u dangtong -p${MYSQL_PASSWORD} -h mysql-svc.default; do echo waiting for database; sleep 2; done;']
containers:
- name: istory
image: dangtong/istory:12
envFrom:
- configMapRef:
name: istory-app-config
env:
- name: spring.datasource.password
valueFrom:
secretKeyRef:
name: istory-db-secret
key: MYSQL_PASSWORD
- name: spring.datasource.username
valueFrom:
configMapKeyRef:
name: istory-db-config
key: MYSQL_USER
readinessProbe:
httpGet:
path: /actuator
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 3
successThreshold: 2
failureThreshold: 3
periodSeconds: 10
ports:
- containerPort: 3306
name: istory
volumes:
- name: application-config
configMap:
name: istory-app-config
restartPolicy: Always