containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[EKS] [request]: add "cluster name" to metadata endpoint

Open jicowan opened this issue 5 years ago • 9 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request What do you want us to build? A metadata endpoint for EKS clusters that allow applications running within the cluster to get information about a cluster without querying an AWS API. The downward API only provides information about the pod.

Which service(s) is this request for? EKS

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now? What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem. I am trying to get the name of the cluster that a pod in running on from within the pod itself.

Are you currently working around this issue? How are you currently solving this problem? I am still debating how to tackle this.

Additional context Anything else we should know?

Attachments If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)

jicowan avatar Jan 09 '20 15:01 jicowan

@jicowan do you imagine more data than just the cluster name being exposed?

tabern avatar Jan 10 '20 00:01 tabern

Yes, @tabern. It might be useful to include other attributes of the cluster, e.g. region, subnets, control plane security group id, etc.

jicowan avatar Jan 11 '20 02:01 jicowan

why it is not getting attention here ? this may be useful for us to operate deployment on EKS gathering this kind of details through EC2 METADATA, is there a different way today to gather this information when i am running on the EKS node ?

aviorma avatar Jun 25 '21 17:06 aviorma

Hi @tabern, any plans/updates on this issue?

tetianakravchenko avatar Feb 22 '22 09:02 tetianakravchenko

any update? this would help for multi-cluster monitoring

venom02 avatar Apr 20 '22 13:04 venom02

Hi!

Any updates on whether this is getting priority in the near future?

ottramst avatar Sep 17 '22 13:09 ottramst

+1

Elasticjustin avatar Nov 02 '22 12:11 Elasticjustin

Hey y'all, this request may or may not be implemented, but you may be able to achieve the desired outcome by querying IMDS to get the tags associated with the EC2 instance in order to derive the cluster name.

For example:

$ curl http://169.254.169.254/latest/meta-data/tags/instance/aws:eks:cluster-name
foo

Just be sure to:

  • Enable exposing instance tags on the instances (disabled by default)
  • Watch out for this issue if you use / characters in your tag keys. I changed mine to use the KubernetesCluster = {cluster-name} tags instead of kubernetes.io/cluster/{cluster-name} = owned. You need to be careful not to mess up the tags on the subnets and security groups in the EKS VPC or you might break your setup.

TonyLovesDevOps avatar Jul 10 '23 20:07 TonyLovesDevOps

Moving to coming soon

mikestef9 avatar Apr 11 '24 22:04 mikestef9