@@ -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.
217216kubectl apply -f - << EOF
218217apiVersion: v1
219218kind: Service
@@ -236,7 +235,7 @@ spec:
236235 protocol: TCP
237236EOF
238237
239- log_info " Waiting for pyroscope-nlb to provision the shared NLB ..."
238+ log_info " Waiting for pyroscope-nlb to provision..."
240239NLB_DNS=" "
241240for 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
253252fi
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-
287254aws ssm put-parameter \
288255 --name " perf-platform-internal-nlb" \
289256 --value " ${NLB_DNS} " \
0 commit comments