Skip to content

Commit 09d1817

Browse files
committed
fix: add kubectl wait before exec, increase pod crash and KEDA scaleout timeouts
1 parent 9543c75 commit 09d1817

7 files changed

Lines changed: 12 additions & 10 deletions

File tree

website/docs/fastpaths/developer/amazon-eks-pod-identity/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ carts-dynamodb-698674dcc6-hw2bg 1/1 Running 0 14m
1717
In the output above, the Pod `carts-dynamodb-698674dcc6-hw2bg` is our lightweight DynamoDB service. We can verify our `carts` application is using this by inspecting its environment:
1818

1919
```bash timeout=180
20+
$ kubectl wait --for=condition=Ready pods -l app.kubernetes.io/component=service -n carts --timeout=120s
2021
$ kubectl -n carts exec deployment/carts -- env | grep RETAIL_CART_PERSISTENCE_DYNAMODB_ENDPOINT
2122
RETAIL_CART_PERSISTENCE_DYNAMODB_ENDPOINT=http://carts-dynamodb:8000
2223
```

website/docs/fastpaths/developer/amazon-eks-pod-identity/tests/hook-pod-logs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ before() {
66

77
after() {
88
# The pod may need extra time to crash and have previous logs available
9-
# Retry up to 180s re-fetching logs until we find the expected error
9+
# Retry up to 240s re-fetching logs until we find the expected error
1010
LATEST_POD=$(kubectl get pods -n carts -l app.kubernetes.io/component=service --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
1111

12-
for i in $(seq 1 18); do
12+
for i in $(seq 1 24); do
1313
LOG_OUTPUT=$(kubectl logs -n carts -p "$LATEST_POD" 2>/dev/null || true)
1414
if [[ "$LOG_OUTPUT" == *"Unable to load credentials"* ]]; then
1515
echo "Found expected credential error in logs"

website/docs/fastpaths/developer/amazon-eks-pod-identity/understanding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ sidebar_position: 33
55

66
The first place to look for the issue is the logs of the `carts` service:
77

8-
```bash hook=pod-logs timeout=360
8+
```bash hook=pod-logs timeout=480
99
$ LATEST_POD=$(kubectl get pods -n carts -l app.kubernetes.io/component=service --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
10-
sleep 120
10+
sleep 180
1111
kubectl logs -n carts -p $LATEST_POD
1212
[...]
1313
software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])): Profile file contained no credentials for profile 'default': ProfileFile(sections=[]), ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Failed to load credentials from IMDS.]

website/docs/fastpaths/developer/keda/tests/hook-keda-pod-scaleout.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ before() {
77
after() {
88
EXIT_CODE=0
99

10-
timeout -s TERM 300 bash -c \
10+
timeout -s TERM 600 bash -c \
1111
'while [[ $(kubectl get pod -l app.kubernetes.io/instance=ui -n ui -o json | jq -r ".items | length") -lt 2 ]];\
1212
do sleep 30;\
1313
done' || EXIT_CODE=$?
1414

1515
if [ $EXIT_CODE -ne 0 ]; then
16-
>&2 echo "Pods did not scale within 300 seconds"
16+
>&2 echo "Pods did not scale within 600 seconds"
1717
exit 1
1818
fi
1919
}

website/docs/fastpaths/operator/amazon-eks-pod-identity/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ carts-dynamodb-698674dcc6-hw2bg 1/1 Running 0 14m
1717
In the output above, the Pod `carts-dynamodb-698674dcc6-hw2bg` is our lightweight DynamoDB service. We can verify our `carts` application is using this by inspecting its environment:
1818

1919
```bash timeout=180
20+
$ kubectl wait --for=condition=Ready pods -l app.kubernetes.io/component=service -n carts --timeout=120s
2021
$ kubectl -n carts exec deployment/carts -- env | grep RETAIL_CART_PERSISTENCE_DYNAMODB_ENDPOINT
2122
RETAIL_CART_PERSISTENCE_DYNAMODB_ENDPOINT=http://carts-dynamodb:8000
2223
```

website/docs/fastpaths/operator/amazon-eks-pod-identity/tests/hook-pod-logs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ before() {
66

77
after() {
88
# The pod may need extra time to crash and have previous logs available
9-
# Retry up to 180s re-fetching logs until we find the expected error
9+
# Retry up to 240s re-fetching logs until we find the expected error
1010
LATEST_POD=$(kubectl get pods -n carts -l app.kubernetes.io/component=service --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
1111

12-
for i in $(seq 1 18); do
12+
for i in $(seq 1 24); do
1313
LOG_OUTPUT=$(kubectl logs -n carts -p "$LATEST_POD" 2>/dev/null || true)
1414
if [[ "$LOG_OUTPUT" == *"Unable to load credentials"* ]]; then
1515
echo "Found expected credential error in logs"

website/docs/fastpaths/operator/amazon-eks-pod-identity/understanding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ sidebar_position: 33
55

66
The first place to look for the issue is the logs of the `carts` service:
77

8-
```bash hook=pod-logs timeout=360
8+
```bash hook=pod-logs timeout=480
99
$ LATEST_POD=$(kubectl get pods -n carts -l app.kubernetes.io/component=service --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:].metadata.name}')
10-
sleep 120
10+
sleep 180
1111
kubectl logs -n carts -p $LATEST_POD
1212
[...]
1313
software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])): Profile file contained no credentials for profile 'default': ProfileFile(sections=[]), ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Failed to load credentials from IMDS.]

0 commit comments

Comments
 (0)