forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdestination-rules.yaml
More file actions
183 lines (164 loc) · 5.14 KB
/
Copy pathdestination-rules.yaml
File metadata and controls
183 lines (164 loc) · 5.14 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
---
# ──────────────────────────────────────────────────────────────────────────────
# GistPin — Destination Rules
#
# Configures:
# - Load balancing algorithm per service
# - Connection pool limits (circuit breaker)
# - Outlier detection (automatic pod ejection)
# - Subsets (stable / canary) matching pod labels
# - TLS mode for mTLS between sidecars
# ──────────────────────────────────────────────────────────────────────────────
# ── Backend API ───────────────────────────────────────────────────────────────
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: backend
namespace: gistpin
spec:
host: backend
trafficPolicy:
loadBalancer:
# LEAST_CONN distributes to the pod with fewest active connections;
# better than ROUND_ROBIN for variable-latency API handlers.
simple: LEAST_CONN
connectionPool:
tcp:
maxConnections: 100
connectTimeout: 5s
tcpKeepalive:
time: 7200s
interval: 75s
http:
http1MaxPendingRequests: 64
http2MaxRequests: 1000
maxRequestsPerConnection: 10
maxRetries: 3
outlierDetection:
# Eject pods returning 5xx errors for increasing intervals
consecutiveGatewayErrors: 5
consecutive5xxErrors: 5
interval: 30s
baseEjectionTime: 30s
maxEjectionPercent: 50
minHealthPercent: 30
tls:
mode: ISTIO_MUTUAL # Enforce mTLS; pairs with PeerAuthentication STRICT
subsets:
- name: stable
labels:
version: stable
trafficPolicy:
loadBalancer:
simple: LEAST_CONN
- name: canary
labels:
version: canary
trafficPolicy:
loadBalancer:
# During canary, use RANDOM to spread across a small pod set
simple: RANDOM
---
# ── Frontend ──────────────────────────────────────────────────────────────────
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: frontend
namespace: gistpin
spec:
host: frontend
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN # Stateless SSR; round-robin is fine
connectionPool:
tcp:
maxConnections: 50
connectTimeout: 3s
http:
http1MaxPendingRequests: 32
http2MaxRequests: 500
maxRequestsPerConnection: 0 # Keep-alive
outlierDetection:
consecutiveGatewayErrors: 5
interval: 30s
baseEjectionTime: 15s
maxEjectionPercent: 30
tls:
mode: ISTIO_MUTUAL
subsets:
- name: stable
labels:
version: stable
- name: canary
labels:
version: canary
---
# ── Analytics ─────────────────────────────────────────────────────────────────
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: analytics
namespace: gistpin
spec:
host: analytics
trafficPolicy:
loadBalancer:
# LEAST_CONN suits the mixed workload (fast ingest + slow queries)
simple: LEAST_CONN
connectionPool:
tcp:
maxConnections: 200
connectTimeout: 5s
http:
http1MaxPendingRequests: 128
http2MaxRequests: 2000
maxRequestsPerConnection: 0
outlierDetection:
consecutiveGatewayErrors: 10
interval: 60s
baseEjectionTime: 60s
maxEjectionPercent: 25
tls:
mode: ISTIO_MUTUAL
subsets:
- name: stable
labels:
version: stable
---
# ── Istio Egress Gateway ──────────────────────────────────────────────────────
# TLS origination for HTTPS egress to Stellar endpoints.
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: stellar-rpc-egress-tls
namespace: gistpin
spec:
host: istio-egressgateway.istio-system.svc.cluster.local
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
portLevelSettings:
- port:
number: 443
tls:
mode: ISTIO_MUTUAL
---
# ── ServiceEntry — allow mesh egress to Stellar RPC hosts ────────────────────
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: stellar-rpc
namespace: gistpin
spec:
hosts:
- horizon.stellar.org
- soroban-testnet.stellar.org
ports:
- number: 443
name: https
protocol: HTTPS
- number: 80
name: http
protocol: HTTP
location: MESH_EXTERNAL
resolution: DNS