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

feat: link kubernetes LB services to AWS ELB #705

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

adityathebe
Copy link
Member

@adityathebe adityathebe commented Jul 8, 2024

## fix source vertex not found error by namespacing all look ups to the scraper.

The source vertex not found error would occur only in cases where multiple clusters were being scraped. The lookups needed to be scoped to the given scraper.

Example: When forming a Namespace default -> Deployment Nginx relationship for cluster A, the lookup for external id Kubernetes/Namespace//default would return the ID of the default namespace from cluster B. This would cause failure when forming the graph as the edge couldn't be inserted since there's no source vertex in the graph.

resolves: #703

@adityathebe adityathebe force-pushed the feat/lb-service-to-elb branch 2 times, most recently from c2b5d44 to 3d1d3fc Compare July 8, 2024 14:14
@adityathebe adityathebe requested a review from moshloop July 8, 2024 14:49
@moshloop
Copy link
Member

moshloop commented Jul 8, 2024

@adityathebe - Not sure we can force this - There will be instances of cross-scraper relationships

e.g

  • a Flux object in a management cluster creating resources in a target cluster without a flux relationship
  • A change being detected in 1 scraper being assigned to a config scraped elsewhere

I think the problem is using Kubernetes/Namespace/%s as an ExternalID - which it shouldn't be - external ids should be globally unique - ideally even across all config types e.g. with a FQDN or a UID.

I think we just need to change https://github.com/flanksource/config-db/blob/main/scrapers/kubernetes/kubernetes.go#L438 to use the resourceIdMap

@adityathebe
Copy link
Member Author

I think we just need to change https://github.com/flanksource/config-db/blob/main/scrapers/kubernetes/kubernetes.go#L438 to use the resourceIdMap

The problem is that on incremental scrapes, the resource id map is nil. Or at least, we cannot guarantee that the namespace or possibly other parents as well are going to be in the resource id map.

I'll create a separate issue for this.

@adityathebe adityathebe force-pushed the feat/lb-service-to-elb branch from 3d1d3fc to 9fb9593 Compare July 9, 2024 05:17
@moshloop moshloop enabled auto-merge (rebase) July 9, 2024 05:25
@moshloop moshloop merged commit 9090d06 into main Jul 9, 2024
7 checks passed
@moshloop moshloop deleted the feat/lb-service-to-elb branch July 9, 2024 05:25
Copy link

github-actions bot commented Jul 9, 2024

🎉 This PR is included in version 0.0.372 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Link K8s Services to Load Balancers
2 participants