Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Populate cloud.instance.id ECS field from k8s.node asset type #144

Closed
MichaelKatsoulis opened this issue May 2, 2023 · 2 comments · Fixed by #154
Closed

Populate cloud.instance.id ECS field from k8s.node asset type #144

MichaelKatsoulis opened this issue May 2, 2023 · 2 comments · Fixed by #154
Assignees

Comments

@MichaelKatsoulis
Copy link
Collaborator

MichaelKatsoulis commented May 2, 2023

In order to connect a kubernetes node with a cloud provider instance the best way is to take advantage of instance.id.

This information can be derived from kubernetes nodes labels and spec in case of aws and gcp cloud providers.

  1. AWS: From kubernetes node spec there is the providerId in the form of
providerID: aws:///us-east-2b/i-0699b78f46f0fa248

Last part of this url is the EC2 instance id.

  1. GCP: The providerID does not help much there as it is the form of gce://elastic-observability/us-central1-c/gke-michaliskatsoulis-te-default-pool-41126842-55kg.
    But all GKE nodes have an annotation like container.googleapis.com/instance_id: 5445971517456914360 which does the job.

In all cases the ECS field cloud.instance.id will be populated if the node is running in one of those CSPs.

This issue is tightly coupled with #146

@girodav
Copy link
Collaborator

girodav commented May 4, 2023

But all GKE nodes have an annotation like container.googleapis.com/instance_id: 5445971517456914360 which does the job.

I don't think this would work for GKE Autopilot. From a first quick look, it looks like the underlying Instance Groups are not accessible. Looks like we have a similar case to AWS EKS Fargate

@MichaelKatsoulis
Copy link
Collaborator Author

I don't think this would work for GKE Autopilot. From a first quick look, it looks like the underlying Instance Groups are not accessible. Looks like we have a similar case to AWS EKS Fargate

Related issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants