-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat-service.yaml
80 lines (78 loc) · 1.74 KB
/
chat-service.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
apiVersion: v1
kind: Service
metadata:
name: chat-service
labels:
app: chat-service
spec:
type: NodePort
selector:
app: chat-service
ports:
- port: 8080
nodePort: 30161
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: chat-service-deploy
labels:
app: chat-service
spec:
replicas: 2
selector:
matchLabels:
app: chat-service
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 1
template:
metadata:
labels:
app: chat-service
spec:
containers:
- name: chat-service
image: chat-service:0.1.0-SNAPSHOT
imagePullPolicy: Never
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
cpu: 2000m
memory: 1024Mi
env:
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://db:3306/chat_service?createDatabaseIfNotExist=true
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
name: db-secrets
key: db-username
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: db-secrets
key: db-password
- name: JAVA_OPTS
value: -Xms128M -Xmx256M -XX:MaxMetaspaceSize=128M
ports:
- containerPort: 8080
name: http
readinessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 120
timeoutSeconds: 5