Skip to content

[processor/resourcedetection] Add OIDC issuer and token path checks for EKS detection#45885

Open
Aneurysm9 wants to merge 2 commits intoopen-telemetry:mainfrom
Aneurysm9:fix/isEKSDetection
Open

[processor/resourcedetection] Add OIDC issuer and token path checks for EKS detection#45885
Aneurysm9 wants to merge 2 commits intoopen-telemetry:mainfrom
Aneurysm9:fix/isEKSDetection

Conversation

@Aneurysm9
Copy link
Member

EKS changed the gitVersion format in Kubernetes 1.35 (platform version eks.3), removing the -eks- identifier that the detector relied on. This adds multiple fallback detection methods before the gitVersion check:

  1. IRSA token path - AWS_WEB_IDENTITY_TOKEN_FILE contains "eks.amazonaws.com"
  2. Pod Identity token path - AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE contains "eks-pod-identity"
  3. OIDC issuer - API server /.well-known/openid-configuration issuer contains "oidc.eks."
  4. Fallback: gitVersion contains "-eks-" (existing check)

Each positive signal is reasonably conclusive. Errors in earlier checks gracefully fall through to subsequent checks.

Fixes #45866

Description

Link to tracking issue

Fixes

Testing

Documentation

Copy link
Member

@paulojmdias paulojmdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we should open an issue to extend the current E2E tests to validate this change.

Please take a look into the CI errors

…or EKS detection

EKS changed the `gitVersion` format in Kubernetes 1.35 (platform version eks.3),
removing the `-eks-` identifier that the detector relied on. This adds multiple
fallback detection methods before the `gitVersion` check:

1. IRSA token path - `AWS_WEB_IDENTITY_TOKEN_FILE` contains "eks.amazonaws.com"
2. Pod Identity token path - `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE` contains "eks-pod-identity"
3. OIDC issuer - API server `/.well-known/openid-configuration` issuer contains "oidc.eks."
4. Fallback: `gitVersion` contains "-eks-" (existing check)

Each positive signal is reasonably conclusive. Errors in earlier checks
gracefully fall through to subsequent checks.

Fixes open-telemetry#45866

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
@Aneurysm9
Copy link
Member Author

Fixed the lint issues. The unit test failure seems to be a flake in groupbytraceprocessor tests unrelated to this change.

@paulojmdias
Copy link
Member

Yeah, just comment /rerun for the pipeline be retried.

Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processor/resourcedetection] AWS EKS resource detector check returns false for new EKS platform versions

3 participants