Prometheus Adapter for Kubernetes Metrics APIs

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

The Prometheus adapter is a Kubernetes Aggregation Layer extension.

Metrics and Autoscaling PrometheusAdapter.png

Helm Installation

https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-adapter

Install Prometheus first. Then:

kubectl create ns prometheus-adapter

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm search repo prometheus-community

helm install -n prometheus-adapter prometheus-adapter prometheus-community/prometheus-adapter

Test installation:

kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 | jq
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "custom.metrics.k8s.io/v1beta1",
  "resources": []
}

Configuration

https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-adapter#configuration

Use the following prometheus-adapter-overlay.yaml:

helm show values prometheus-community/prometheus-adapter > ~/tmp/prometheus-adapter-overlay.yaml

Troubleshooting

tail the logs, Prometheus connection refused is reported there.