-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccounts-service-deployment.yaml
More file actions
85 lines (85 loc) · 2.72 KB
/
accounts-service-deployment.yaml
File metadata and controls
85 lines (85 loc) · 2.72 KB
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
81
82
83
84
85
apiVersion: apps/v1
kind: Deployment
metadata:
name: accounts-service
namespace: banking-app
labels:
app.kubernetes.io/name: banking-app
app.kubernetes.io/component: microservice
app.kubernetes.io/service: accounts-service
spec:
replicas: 1
selector:
matchLabels:
app: accounts-service
app.kubernetes.io/name: banking-app
app.kubernetes.io/component: microservice
template:
metadata:
labels:
app: accounts-service
app.kubernetes.io/name: banking-app
app.kubernetes.io/component: microservice
app.kubernetes.io/service: accounts-service
spec:
serviceAccountName: banking-app-sa
containers:
- name: accounts-service
image: ghcr.io/speedscale/microsvc/accounts-service:v1.4.0
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args: ["exec java $JAVA_OPTS org.springframework.boot.loader.launch.JarLauncher"]
ports:
- containerPort: 8080
name: http
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: accounts-service-password
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: jwt-secret
key: secret
- name: JAVA_OPTS
value: "-Xms64m -Xmx192m -XX:MaxMetaspaceSize=96m -XX:ReservedCodeCacheSize=32m -XX:MaxDirectMemorySize=16m -XX:+UseSerialGC -XX:+UseStringDeduplication -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom -Dspring.main.lazy-initialization=true"
envFrom:
- configMapRef:
name: app-config
- configMapRef:
name: accounts-service-config
resources:
requests:
memory: "128Mi"
cpu: "50m"
limits:
memory: "256Mi"
cpu: "150m"
startupProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 24
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
initContainers:
- name: wait-for-postgres
image: postgres:15-alpine
command: ['sh', '-c', 'echo "[accounts-service] Waiting for PostgreSQL..."; until pg_isready -h postgres -p 5432 -q; do sleep 1; done; echo "[accounts-service] PostgreSQL ready!"']