Component
Detector: AWS EKS
Describe the issue you're facing
The EKS detector determines that it's running in EKS by fetching the aws-auth ConfigMap in the kube-system namespace:
|
// Make HTTP GET request |
|
awsAuth, err := utils.getConfigMap(ctx, authConfigmapNS, authConfigmapName) |
|
if err != nil { |
|
return false, fmt.Errorf("isEks() error retrieving auth configmap: %w", err) |
|
} |
This is unfortunate for a couple reasons:
- This ConfigMap is actually not required in EKS clusters and is in fact deprecated, so is not a reliable signal.
- It requires workloads to have read access to an object in privileged namespace (despite not using any of the data).
Expected behavior
- EKS detector uses a reliable/non-deprecated approach to detecting an EKS cluster
- EKS detector does not require special in-cluster RBAC
I'm not sure if IMDS is a good fallback since that's often blocked within Pods.
It's also worth noting that I'm not sure what the expected error behavior is here. If the detector determines it's not running in an EKS cluster, it returns gracefully. However, if the detector runs into an RBAC limitation here (which means the configmap might not even exist because it might not actually be running in an EKS cluster), it does return an error.
Steps to Reproduce
- Add the EKS detector
- Launch in an K8s cluster (of any kind!) but do not allow the Pod to read that ConfigMap.
error detecting resource: isEks() error retrieving auth configmap: failed to retrieve ConfigMap kube-system/aws-auth: configmaps "aws-auth" is forbidden: User "system:serviceaccount:my-namespace:my-service-account" cannot get resource "configmaps" in API group "" in the namespace "kube-system"
Operating System
Linux
Device Architecture
ARM64
Go Version
1.25
Component Version
detectors/aws/eks v1.41.0
Component
Detector: AWS EKS
Describe the issue you're facing
The EKS detector determines that it's running in EKS by fetching the
aws-authConfigMap in thekube-systemnamespace:opentelemetry-go-contrib/detectors/aws/eks/detector.go
Lines 121 to 125 in db30b79
This is unfortunate for a couple reasons:
Expected behavior
I'm not sure if IMDS is a good fallback since that's often blocked within Pods.
It's also worth noting that I'm not sure what the expected error behavior is here. If the detector determines it's not running in an EKS cluster, it returns gracefully. However, if the detector runs into an RBAC limitation here (which means the configmap might not even exist because it might not actually be running in an EKS cluster), it does return an error.
Steps to Reproduce
Operating System
Linux
Device Architecture
ARM64
Go Version
1.25
Component Version
detectors/aws/eks v1.41.0