Open
Description
zot version
2.1.2
Describe the bug
Problem
I’m running Zot in EKS with IRSA configured via a properly annotated Kubernetes service account. When using the S3 storageDriver, everything works perfectly via IRSA. However, when enabling the dynamodb cacheDriver, Zot fails to authenticate with AWS STS and crashes with the following error:
operation error DynamoDB: CreateTable, get identity: get credentials:
failed to refresh cached credentials, failed to retrieve credentials,
operation error STS: AssumeRoleWithWebIdentity, https response error StatusCode: 404,
RequestID: ..., api error UnknownError: UnknownError
This only occurs when using the cacheDriver. With the same config and IRSA role, the S3 driver works without issues.
Verified
- EKS IRSA is correctly set up
- ServiceAccount has eks.amazonaws.com/role-arn and eks.amazonaws.com/audience: sts.amazonaws.com annotations
- Token audience is sts.amazonaws.com
- IAM trust policy allows the sub and aud from the token
- aws sts get-caller-identity works from a debug pod using the same zot-sa ServiceAccount
- The projected token decodes correctly:
"aud": ["sts.amazonaws.com"],
"sub": "system:serviceaccount:phoenix:zot-sa",
"iss": "https://oidc.eks.us-east-2.amazonaws.com/id/..."
To reproduce
- Create an IAM role with the appropriate trust policy
- Attach a policy that allows S3 and DynamoDB access (including CreateTable on DynamoDB).
- Create a Kubernetes ServiceAccount with the appropriate annotations.
- Deploy Zot with the following configuration:
"storage": {
"storageDriver": {
"name": "s3",
"region": "eu-central-1",
"bucket": "<bucket-name>",
"secure": true
},
"cacheDriver": {
"name": "dynamodb",
"region": "eu-central-1",
"endpoint": "https://dynamodb.eu-central-1.amazonaws.com",
"cachetablename": "<cacheTableName>"
}
}
- Observe failure at startup. Logs will show:
operation error STS: AssumeRoleWithWebIdentity,
https response error StatusCode: 404, api error UnknownError: UnknownError
- Remove the cacheDriver section → Zot works perfectly with S3 alone.
Expected behavior
Zot should initialize the DynamoDB client using the same AWS SDK credential chain that works for S3, including support for IRSA via web identity token.
Screenshots
No response
Additional context
No response