Skip to content

Commit 27228b3

Browse files
author
Yuriy Bezsonov
committed
fix(perf-platform): simplify NLB setup by removing analyzer service
1 parent db612e7 commit 27228b3

1 file changed

Lines changed: 6 additions & 39 deletions

File tree

infra/scripts/setup/perf-platform.sh

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,11 @@ log_success "RBAC applied"
208208
# Internal NLB (two annotated LoadBalancer Services sharing one NLB)
209209
# =============================================================================
210210

211-
log_info "Provisioning internal NLB for ECS reachability..."
212-
# Apply sequentially: AWS Load Balancer Controller shares one NLB across two
213-
# Services via `aws-load-balancer-name` only if the second Service sees the
214-
# NLB already exists. A single concurrent `kubectl apply` makes both reconcile
215-
# loops race — both try to CreateLoadBalancer and the second hits
216-
# DuplicateLoadBalancerName and gets stuck.
211+
log_info "Provisioning internal NLB for ECS Fargate reachability..."
212+
# Single NLB fronts Pyroscope. ECS Fargate collectors use it to reach
213+
# Pyroscope from outside the cluster. The analyzer is never called from
214+
# outside the cluster — developers invoke it via `kubectl run` + cluster
215+
# DNS, Grafana's webhook uses cluster DNS too, so it needs no NLB.
217216
kubectl apply -f - <<EOF
218217
apiVersion: v1
219218
kind: Service
@@ -236,7 +235,7 @@ spec:
236235
protocol: TCP
237236
EOF
238237

239-
log_info "Waiting for pyroscope-nlb to provision the shared NLB..."
238+
log_info "Waiting for pyroscope-nlb to provision..."
240239
NLB_DNS=""
241240
for i in {1..60}; do
242241
NLB_DNS=$(kubectl get svc pyroscope-nlb -n "${NAMESPACE}" \
@@ -252,38 +251,6 @@ if [[ -z "${NLB_DNS}" ]]; then
252251
exit 1
253252
fi
254253

255-
log_info "Attaching perf-analyzer listener to the same NLB..."
256-
kubectl apply -f - <<EOF
257-
apiVersion: v1
258-
kind: Service
259-
metadata:
260-
name: perf-analyzer-nlb
261-
namespace: ${NAMESPACE}
262-
annotations:
263-
service.beta.kubernetes.io/aws-load-balancer-type: external
264-
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
265-
service.beta.kubernetes.io/aws-load-balancer-scheme: internal
266-
service.beta.kubernetes.io/aws-load-balancer-name: perf-platform-internal
267-
spec:
268-
type: LoadBalancer
269-
selector:
270-
app: perf-analyzer
271-
ports:
272-
- name: analyzer
273-
port: 8080
274-
targetPort: 8080
275-
protocol: TCP
276-
EOF
277-
278-
for i in {1..30}; do
279-
ANALYZER_NLB_DNS=$(kubectl get svc perf-analyzer-nlb -n "${NAMESPACE}" \
280-
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo "")
281-
if [[ -n "${ANALYZER_NLB_DNS}" ]]; then
282-
break
283-
fi
284-
sleep 5
285-
done
286-
287254
aws ssm put-parameter \
288255
--name "perf-platform-internal-nlb" \
289256
--value "${NLB_DNS}" \

0 commit comments

Comments
 (0)