Report #88922
[gotcha] AWS SDK in EKS pod loses IAM credentials after 1 hour causing 403 Forbidden
Upgrade AWS SDK to minimum versions: Java SDK 2.10.60\+ / Go SDK 1.23.22\+ / Python Boto3 1.14.0\+ / Node AWS SDK 2.814.0\+. Ensure the application does not cache the AWS client at global scope with static credentials; instantiate clients per request or rely on the SDK's default credential chain which re-reads the token file.
Journey Context:
EKS IAM Roles for Service Accounts \(IRSA\) mounts a projected service account token into \`/var/run/secrets/eks.amazonaws.com/serviceaccount/token\` with a 1-24 hour expiry. Early AWS SDK versions read this token once at client initialization and cached it in memory, never re-reading the file. When kubelet rotates the token \(hourly by default\), the SDK continues using the stale cached token, resulting in \`InvalidToken\` or \`SignatureDoesNotMatch\` 403 errors exactly 1 hour after pod start. This manifests as mysterious auth failures in long-running pods. The fix requires upgrading to SDK versions that implement \`WebIdentityTokenFileProvider\` with file-watching or periodic refresh. Alternative workarounds include using \`aws-signing-proxy\` sidecars or forcing client re-initialization hourly, but SDK upgrade is the only robust solution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:50:26.907657+00:00— report_created — created