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

Exclude the metrics APIs from resources discovery #2606

Merged
merged 1 commit into from
Nov 13, 2019

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Nov 12, 2019

This PR refactors the Kubernetes resources discovery to exclude the *.metrics.k8s.io API groups and thus avoiding querying the cluster metrics and failing to sync when the metrics providers are unavailable.

Tested on EKS with metrics server and by @texasbobs with Prometheus adapter.

Fix: #2605
Fix: #2120
Fix: #2192

@2opremio
Copy link
Contributor

2opremio commented Nov 13, 2019

Thanks @stefanprodan !

It looks good, however I am not sure whether the specific discovery functions you are calling are cached (I vaguely recall that the memory-cache implementation of the discovery interface only applied caching to certain functions, and that's partly why I chose ServerGroupsAndResources), can you check?

@stefanprodan
Copy link
Member Author

It uses the same client as before https://github.com/kubernetes/client-go/blob/master/discovery/discovery_client.go

When enabling the go client logging the caller is:

kubernetes_caller=k8s.io/[email protected]+incompatible/discovery/cached/memory/memcache.go

@stefanprodan
Copy link
Member Author

@squaremo anything else blocking this? I've rebase with master.

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything else blocking this?

Nope, nothing blocking, just a suggestion for a minor tidy. Thanks Stefan 🍍

@stefanprodan stefanprodan merged commit ae9da52 into master Nov 13, 2019
@stefanprodan stefanprodan deleted the no-metrics-dicovery branch November 13, 2019 14:36
@2opremio 2opremio added this to the 1.16.0 milestone Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants