-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference-data-service-deployment.yaml
More file actions
172 lines (172 loc) · 3.67 KB
/
reference-data-service-deployment.yaml
File metadata and controls
172 lines (172 loc) · 3.67 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
---
apiVersion: v1
kind: ConfigMap
metadata:
name: reference-data-service-config
namespace: cloudhealthoffice
data:
ASPNETCORE_ENVIRONMENT: "Production"
ASPNETCORE_URLS: "http://+:8080"
---
apiVersion: v1
kind: Secret
metadata:
name: reference-data-service-secret
namespace: cloudhealthoffice
type: Opaque
stringData:
POSTGRES_PASSWORD: "CloudHealthOffice2026!"
---
# PostgreSQL StatefulSet
apiVersion: v1
kind: Service
metadata:
name: postgres-service
namespace: cloudhealthoffice
spec:
ports:
- port: 5432
targetPort: 5432
clusterIP: None
selector:
app: postgres
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: cloudhealthoffice
spec:
serviceName: postgres-service
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
env:
- name: PGDATA
value: "/var/lib/postgresql/data/pgdata"
- name: POSTGRES_DB
value: "referencedata"
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: reference-data-service-secret
key: POSTGRES_PASSWORD
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"
volumeClaimTemplates:
- metadata:
name: postgres-storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi
---
# Reference Data Service Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: reference-data-service
namespace: cloudhealthoffice
spec:
replicas: 1
selector:
matchLabels:
app: reference-data-service
template:
metadata:
labels:
app: reference-data-service
spec:
containers:
- name: reference-data-service
image: ghcr.io/aurelianware/cloudhealthoffice-reference-data-service:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: reference-data-service-config
- secretRef:
name: reference-data-service-secret
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health/live
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /health/live
port: 8080
initialDelaySeconds: 10
timeoutSeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: reference-data-service
namespace: cloudhealthoffice
spec:
selector:
app: reference-data-service
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: reference-data-service-hpa
namespace: cloudhealthoffice
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: reference-data-service
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80