kubernetes-sigs / custom-metrics-apiserver

Framework for implementing custom metrics support for Kubernetes
Apache License 2.0
504 stars 176 forks source link

Multiple adapters in cluster? #59

Closed zroubalik closed 4 years ago

zroubalik commented 4 years ago

Is there a way how to deploy multiple adapters in a cluster? Eg. there's already deployed custom metrics server Foo and I need to deploy my own implementation Bar which provides different set of metrics.

If I understand it correctly, to be able to provide custome/external metrics API, the adapter needs to deploy cluster wide APIService with a specific name. Deploying second adapter in the cluster will results in reconfiguring the original APIService object.

apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
  name: v1beta1.custom.metrics.k8s.io
spec:
  service:
    name: custom-metrics-apiserver
    namespace: custom-metrics
  group: custom.metrics.k8s.io
  version: v1beta1
  insecureSkipTLSVerify: true
  groupPriorityMinimum: 100
  versionPriority: 100
markusthoemmes commented 4 years ago

This is a duplicate of https://github.com/kubernetes-incubator/custom-metrics-apiserver/issues/3 I think.

ecordell commented 4 years ago

I think #3 would have been a solution to the problem, but I like that this issue states the problem rather than the solution.

Have any other solutions been discussed before? Is there a reason, for example, that all custom metrics must share the same apigroup?

s-urbaniak commented 4 years ago

@ecordell i don't know if the question is still relevant, but just to give another potential solution is to solve it in the underlying monitoring system. Probably it is not applicable to all adapters out there, but in the Prometheus ecosystem this can easily be achieved using a Thanos based setup, see [1] and [2].

[1] https://github.com/DirectXMan12/k8s-prometheus-adapter/issues/267 [2] https://www.youtube.com/watch?v=qTxunwzYO0g

zroubalik commented 4 years ago

@s-urbaniak I'd like to kindly ask why is this issue closed? Prometheus adapter is not the only usecase, from my POV this problem is still relevant. Thanks!