Skip to content

Commit d59facb

Browse files
committed
fix: KEDA wait=120 for CloudWatch metrics, fluent-bit hook checks all pods with retries
1 parent 3119fae commit d59facb

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

website/docs/fastpaths/developer/keda/test-keda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The command below will run the load generator with:
1111
- Sending 5 queries per second each
1212
- Running for a maximum of 10 minutes
1313

14-
```bash hook=keda-pod-scaleout hookTimeout=660
14+
```bash hook=keda-pod-scaleout hookTimeout=660 wait=120
1515
$ export ALB_HOSTNAME=$(kubectl get ingress ui-auto -n ui -o yaml | yq .status.loadBalancer.ingress[0].hostname)
1616
$ kubectl run load-generator \
1717
--image=williamyeh/hey:latest \
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
set -e
1+
set -Eeuo pipefail
22

33
before() {
44
echo "noop"
55
}
66

77
after() {
8-
sleep 10
9-
echo "fluent-bit log in progress"
10-
if [[ $TEST_OUTPUT != *"Created log stream"* ]]; then
11-
echo "Failed to match expected output"
12-
echo $TEST_OUTPUT
13-
exit 1
14-
fi
8+
# Check all fluent-bit pods for "Created log stream" messages
9+
# Some pods may not have created streams yet depending on which node they're on
10+
for i in $(seq 1 6); do
11+
for pod in $(kubectl get pods -n amazon-cloudwatch -l app.kubernetes.io/name=aws-for-fluent-bit -o jsonpath='{.items[*].metadata.name}'); do
12+
LOG_OUTPUT=$(kubectl logs -n amazon-cloudwatch "$pod" 2>/dev/null || true)
13+
if [[ "$LOG_OUTPUT" == *"Created log stream"* ]]; then
14+
echo "Found 'Created log stream' in pod $pod"
15+
return 0
16+
fi
17+
done
18+
echo "Attempt $i: 'Created log stream' not found in any pod, waiting..."
19+
sleep 10
20+
done
21+
22+
echo "Failed to find 'Created log stream' in any fluent-bit pod"
23+
exit 1
1524
}
1625

17-
"$@"
26+
"$@"

0 commit comments

Comments
 (0)