Skip to content

Commit 17053ff

Browse files
committed
Remove calls to STS
1 parent 265ec49 commit 17053ff

File tree

3 files changed

+16
-38
lines changed

3 files changed

+16
-38
lines changed

tests/assets/eks-pod-identity/pod-default.yaml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,10 @@ spec:
8181
sleep "$SLEEP_TIME"
8282
done
8383
84-
PIA_ROLE_PREFIX=$CLUSTER_NAME-pia-role
85-
STS_MAX_RETRIES=5
86-
STS_RETRY_DELAY=1
87-
STS_SUCCESS=0
88-
89-
# call sts to check on associated role
90-
for ((j=1; j<=STS_MAX_RETRIES; j++)); do
91-
ARN=$(aws sts get-caller-identity --query Arn --output text 2>/dev/null)
92-
if [[ $? -eq 0 && -n "$ARN" ]]; then
93-
if [[ "$ARN" == *"$PIA_ROLE_PREFIX"* ]]; then
94-
echo "ARN contains role name prefix '$PIA_ROLE_PREFIX': $ARN"
95-
STS_SUCCESS=1
96-
break
97-
else
98-
echo "ARN does not contain expected role name prefix '$PIA_ROLE_PREFIX': $ARN"
99-
exit 1
100-
fi
101-
fi
102-
echo "Attempt $i failed to get caller identity. Retrying in $STS_RETRY_DELAY seconds..."
103-
sleep $STS_RETRY_DELAY
104-
done
105-
106-
if [[ $STS_SUCCESS -ne 1 ]]; then
107-
echo "Failed to retrieve matching caller identity after $STS_MAX_RETRIES attempts."
108-
exit 1
109-
fi
84+
# it is noted that a Pod with host network will fallback to Node role permissions that includes this s3 access
85+
# however, in our test case, we are not using host network
86+
# https://github.com/awslabs/kubernetes-iteration-toolkit/blob/main/tests/assets/eks_node_role.json
87+
# the main reason we are not doing an STS get identity verification is about the quota of STS APIs with scale tests
11088
11189
# s3 api call
11290
while ! aws s3 ls; do

tests/tekton-resources/pipelines/eks/awscli-cl2-load-with-addons-slos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ spec:
9797
description: "default metric period"
9898
default: "300"
9999
- name: timeout-pia-pod-creation
100-
default: "20m"
100+
default: "80s"
101101
- name: timeout-pia-pod-startup
102-
default: "5m"
102+
default: "60s"
103103
- name: launch-template-ami
104104
default: ""
105105
description: "Launch template ImageId value, which may be an AMI ID or resolve:ssm reference. By default resolve to the lates AL2023 ami for cluster version"

tests/tekton-resources/tasks/generators/clusterloader/load-pod-identity.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ spec:
228228
--start-time "$START_TIME" \
229229
--end-time "$END_TIME" \
230230
--period "$PERIOD" \
231-
--extended-statistics p50 p90 p99 \
231+
--extended-statistics p50 p99 p99.95 \
232232
--output json)
233233
234-
# extract p50 p90 p99 of credential fetching
234+
# extract p50 p99 p99.95 of credential fetching
235235
latest=$(echo "$response" | jq -r '.Datapoints | sort_by(.Timestamp) | last')
236236
p50=$(echo "$latest" | jq -r '."ExtendedStatistics"."p50" // "N/A"')
237-
p90=$(echo "$latest" | jq -r '."ExtendedStatistics"."p90" // "N/A"')
238237
p99=$(echo "$latest" | jq -r '."ExtendedStatistics"."p99" // "N/A"')
238+
p9995=$(echo "$latest" | jq -r '."ExtendedStatistics"."p99.95" // "N/A"')
239239
240240
response=$(aws cloudwatch get-metric-statistics \
241241
--region "$REGION" \
@@ -259,22 +259,22 @@ spec:
259259
"total_samples": $total_samples,
260260
"rate": $rate,
261261
"p50": $p50,
262-
"p90": $p90,
263-
"p99": $p99
262+
"p99": $p99,
263+
"p99.95": $p9995
264264
}
265265
EOF
266266
267267
# we expect to see all files from loadtest that clusterloader2 outputs here in this dir
268268
ls -larth
269269
aws s3 cp . s3://$S3_RESULT_PATH/ --recursive
270270
271-
# if p99 is equal to or more than 2 seconds, exit with failure
272-
int_p99=$(echo "$p99" | awk '{printf "%d", $1}')
273-
if [ "$int_p99" -lt 2 ]; then
274-
echo "p99 is less than 2"
271+
# if p99.95 is equal to or more than 1 second, exit with failure
272+
int_p9995=$(echo "$p9995" | awk '{printf "%d", $1}')
273+
if [ "$int_p9995" -lt 1 ]; then
274+
echo "p99.95 is less than 1 second"
275275
echo "1" | tee $(results.datapoint.path)
276276
else
277-
echo "p99 is 2 or more"
277+
echo "p99.95 is 1 second or more"
278278
echo "0" | tee $(results.datapoint.path)
279279
exit 1
280280
fi

0 commit comments

Comments
 (0)