Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] add instance ID to the logs #2362

Closed
FernandoMiguel opened this issue Aug 25, 2022 · 5 comments
Closed

[Feature Request] add instance ID to the logs #2362

FernandoMiguel opened this issue Aug 25, 2022 · 5 comments
Labels
feature New feature or request

Comments

@FernandoMiguel
Copy link
Contributor

Tell us about your request
What do you want us to build?
show aws ec2 instance ID in the logs

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.
Right now the logs show something like
2022-08-25T13:01:34.069Z INFO controller.termination Deleted node {"commit": "639756a", "node": "ip-10-24-25-63.ec2.internal"}
when using multiple ENIs on ec2, this IP format does not really help locate the instance.
Having the instance ID would allow for a 1:1 mapping and easier finding

Are you currently working around this issue?
How are you currently solving this problem?
haven't found an easy solution for 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.)

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
@FernandoMiguel FernandoMiguel added the feature New feature or request label Aug 25, 2022
@bwagner5
Copy link
Contributor

bwagner5 commented Aug 25, 2022

We could add more to the log there, but curious if you have looked into instance-id based node names instead of using the IP address? This was released a while back and hopefully will become the default node name for K8s nodes: aws/containers-roadmap#1723 .

@FernandoMiguel
Copy link
Contributor Author

@bwagner5 nothing in the delete actions log is something i can search on the AWS console to match it to an existing

 2022-08-25T13:22:39.182Z    INFO    controller.termination    Deleted node    {"commit": "639756a", "node": "ip-10-24-26-90.ec2.internal"}                                                                                                                                                                                                                                                                                                                                                             │
│ 2022-08-25T13:23:16.449Z    INFO    controller.consolidation    Consolidating via Delete, terminating 1 nodes ip-10-24-27-43.ec2.internal/c6a.4xlarge    {"commit": "639756a"}                                                                                                                                                                                                                                                                                                                         │
│ 2022-08-25T13:23:16.498Z    INFO    controller.termination    Cordoned node    {"commit": "639756a", "node": "ip-10-24-27-43.ec2.internal"}                                                                                                                                                                                                                                                                                                                                                            │
│ 2022-08-25T13:23:19.253Z    INFO    controller.termination    Deleted node    {"commit": "639756a", "node": "ip-10-24-27-43.ec2.internal"}                                                                                                                                                                                                                                                                                                                                                             │
│ 2022-08-25T13:23:32.209Z    DEBUG    controller.aws.launchtemplate    Deleted launch template Karpenter-fernando-concrete-dogfish-9536383601972843217 (lt-042837ca07f79056a)    {"commit": "639756a"}                                                                                                                                                                                                                                                                                                  

even that IP is not useful cause there are multiple ENIs with /28 CIDRs attached to them

@bwagner5
Copy link
Contributor

The node name in your case is the IP-based DNS name of the root ENI attached to the instance. You should be able to query it for a specific node with this command:

NODE_NAME=ip-10-24-26-90.ec2.internal
aws ec2 describe-instances --filters Name=private-dns-name,Values=${NODE_NAME}

The Private DNS Name filter also exists in the EC2 console search.

But I was suggesting that moving to instance-id based host named might be more clear for lookups. If you switched to resource based DNS names your node name would look like this: i-0123456789abcdef.ec2.internal

@FernandoMiguel
Copy link
Contributor Author

thanks for the link. i'll go over the docs and see the impact on our accounts

@FernandoMiguel
Copy link
Contributor Author

i think my main issue here is that once the instance is terminated, the ENI is detached so there is nothing to look up by the IP name.
Running instance are searchable tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants