forked from ruvnet/RuView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.yaml
More file actions
225 lines (217 loc) · 4.07 KB
/
service.yaml
File metadata and controls
225 lines (217 loc) · 4.07 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
apiVersion: v1
kind: Service
metadata:
name: wifi-densepose-service
namespace: wifi-densepose
labels:
app: wifi-densepose
component: api
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: "/metrics"
spec:
type: ClusterIP
ports:
- port: 8000
targetPort: 8000
protocol: TCP
name: http
- port: 8080
targetPort: 8080
protocol: TCP
name: metrics
selector:
app: wifi-densepose
component: api
sessionAffinity: None
---
apiVersion: v1
kind: Service
metadata:
name: postgres-service
namespace: wifi-densepose
labels:
app: wifi-densepose
component: postgres
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
protocol: TCP
name: postgres
selector:
app: wifi-densepose
component: postgres
sessionAffinity: None
---
apiVersion: v1
kind: Service
metadata:
name: redis-service
namespace: wifi-densepose
labels:
app: wifi-densepose
component: redis
spec:
type: ClusterIP
ports:
- port: 6379
targetPort: 6379
protocol: TCP
name: redis
selector:
app: wifi-densepose
component: redis
sessionAffinity: None
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: wifi-densepose
labels:
app: wifi-densepose
component: nginx
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
- port: 443
targetPort: 443
protocol: TCP
name: https
selector:
app: wifi-densepose
component: nginx
sessionAffinity: None
loadBalancerSourceRanges:
- 0.0.0.0/0
---
# Headless service for StatefulSet (if needed for database clustering)
apiVersion: v1
kind: Service
metadata:
name: postgres-headless
namespace: wifi-densepose
labels:
app: wifi-densepose
component: postgres
spec:
type: ClusterIP
clusterIP: None
ports:
- port: 5432
targetPort: 5432
protocol: TCP
name: postgres
selector:
app: wifi-densepose
component: postgres
---
# Internal service for monitoring
apiVersion: v1
kind: Service
metadata:
name: wifi-densepose-internal
namespace: wifi-densepose
labels:
app: wifi-densepose
component: internal
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: metrics
- port: 8000
targetPort: 8000
protocol: TCP
name: health
selector:
app: wifi-densepose
component: api
sessionAffinity: None
---
# Service for WebSocket connections
apiVersion: v1
kind: Service
metadata:
name: wifi-densepose-websocket
namespace: wifi-densepose
labels:
app: wifi-densepose
component: websocket
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "3600"
spec:
type: LoadBalancer
ports:
- port: 8000
targetPort: 8000
protocol: TCP
name: websocket
selector:
app: wifi-densepose
component: api
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 3600
---
# Service Monitor for Prometheus (if using Prometheus Operator)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: wifi-densepose-monitor
namespace: wifi-densepose
labels:
app: wifi-densepose
component: monitoring
spec:
selector:
matchLabels:
app: wifi-densepose
component: api
endpoints:
- port: metrics
interval: 30s
path: /metrics
scheme: http
- port: http
interval: 60s
path: /health
scheme: http
namespaceSelector:
matchNames:
- wifi-densepose
---
# Pod Monitor for additional pod-level metrics
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: wifi-densepose-pod-monitor
namespace: wifi-densepose
labels:
app: wifi-densepose
component: monitoring
spec:
selector:
matchLabels:
app: wifi-densepose
podMetricsEndpoints:
- port: metrics
interval: 30s
path: /metrics
- port: http
interval: 60s
path: /api/v1/status
namespaceSelector:
matchNames:
- wifi-densepose