How to access Kube state metrics service metrics on custom URL using ingress controller

6/16/2020

I have one central cluster on which my promethus and grafana Dashboard are configured. The idea is to use this central cluster and export metrics from different clusters and view it on central cluster. Each application has its own grafana dashboard. So my idea is to install kube-state-metrics and node_exporter on my kubernetes clusters and export in metrics using ingress controller.

And i am able to do it if i use one exporter at a time. But my idea to use both exporter. The problem is Kube state metrics service exposes all the metrics on /metrics URI and node_exporter also exposes all the metrics on /metrics URI.

Now is the an way in which i can customize kube-state-metrics endpoint to use it in my ingress controller.

E.G.

    http:
        paths:
          - path: /kube/metric/metrics
            backend:
              serviceName: kube-state-metrics
              servicePort: 8080
          - path: /metrics
            backend:
              serviceName: node-exporter
              servicePort: 9100
-- Vikram Pathania
grafana
kube-state-metrics
kubernetes
kubernetes-ingress
prometheus-node-exporter

0 Answers