Docs
Metrics setup
SkoposIDE draws its CPU, memory, disk, network and control plane charts from what the cluster already runs: metrics-server, or a Prometheus-compatible API such as Prometheus or Grafana Mimir. This page lists the settings, the metrics each chart reads and how to check them.
Where metrics show
- The cluster overview: CPU, memory and Pods against the cluster's capacity, the top namespaces and Pods, and the control plane charts.
- The Metrics tab of the details drawer, for Pods, workloads such as Deployments and StatefulSets, Nodes and PersistentVolumeClaims. Pick 1h, 6h, 24h or 7d, as a chart or a table.
- The CPU and Memory columns of the Pods and Nodes lists.
Each panel names its source on its first line, for example Prometheus observability/prometheus-operated:9090, autodetected, through the API server proxy, so you can see which backend answered.
Pick a source
Each cluster has one metrics source, chosen in its settings under Metrics. The default, Detect, finds one by itself.
| Choice | What it reads | What you get |
|---|---|---|
| Detect | A Prometheus Service in the cluster, else the metrics.k8s.io API | Whatever it finds, as below |
| Prometheus or Mimir in the cluster | A Service you name, queried through the Kubernetes API server's service proxy | Every chart, with history from 1 hour to 7 days |
| Prometheus-compatible URL | An HTTP API outside the cluster, such as Mimir or Grafana Cloud, reached directly | Every chart, with history |
| metrics-server only | The metrics.k8s.io API of metrics-server | Current CPU and memory only, sampled every 15 s while the panel is open; no history, disk, network or control plane |
| None | Nothing | No metrics for this cluster |
How Detect chooses
- It lists the Services of every namespace you can read. When listing across namespaces is forbidden, it lists each namespace you can access.
- It keeps the Prometheus candidates, best first:
- label
app=kube-prometheus-stack-prometheus, porthttp-web(kube-prometheus-stack); - label
operated-prometheus=true, portweb(the Prometheus Operator'sprometheus-operated); - labels
app.kubernetes.io/name=prometheusandapp.kubernetes.io/component=server, porthttp(theprometheusHelm chart); - label
app.kubernetes.io/name=prometheusalone.
monitoringnamespace comes first. Without the tier's port name it takes a port namedweb,httporhttp-web, then port 9090, then the first port. - label
- It asks each candidate
/api/v1/query?query=upthrough the service proxy and takes the first one that answers within 5 s. - With no Prometheus answering, it uses metrics-server when the API server serves
/apis/metrics.k8s.io/v1beta1. Otherwise the cluster has no metrics.
The choice is kept for 10 minutes. Retry in the Metrics panel, or reconnecting the cluster, detects again. Detect never finds a URL outside the cluster: choose Prometheus-compatible URL for that.
The cluster's metrics settings
Open a cluster's settings from its row menu in the catalog (Settings), or with the Cluster settings button that metrics notes show. The settings stay in SkoposIDE, in clusters.json in its configuration folder; your kubeconfig is not changed. Passwords and tokens go to the operating system's keychain, never to that file.
Prometheus or Mimir in the cluster
| Field | What to enter |
|---|---|
| Namespace | The Service's namespace, a lowercase DNS label such as monitoring. |
| Service | The Service's name, such as prometheus-operated or kube-prometheus-stack-prometheus. |
| Port | The Service port, 1 to 65535, such as 9090. |
| Scheme | HTTP or HTTPS: how the API server's proxy talks to the Service. |
| Path prefix | Empty for Prometheus. /prometheus for Mimir and other APIs served under a path. It starts with /. |
| Tenant | Sent as the X-Scope-OrgID header, for Mimir and other multi-tenant APIs. Empty for none. Up to 150 letters, digits and ! - _ . * ' ( ). |
| Cluster label | A label name and value, such as cluster = prod, added to every query. Set it when one backend holds the metrics of several clusters. Both or neither. |
Queries go to /api/v1/namespaces/<namespace>/services/[<scheme>:]<service>:<port>/proxy<path prefix>/api/v1/query_range on the API server, with your own kubeconfig credentials. You need get on services/proxy in that namespace, and create too for very long queries, which go as a POST.
Prometheus-compatible URL
| Field | What to enter |
|---|---|
| URL | The API's base, the part before /api/v1, such as https://mimir.example.com/prometheus. http or https with a host, without a user name, query or fragment. |
| Tenant | As above, sent as X-Scope-OrgID. |
| Cluster label | As above. Usually needed here, since a shared backend holds many clusters. |
| Authentication | None, Basic (username and password), Bearer (token) or Client certificate (certificate and key files). Basic and Bearer need https, except to localhost; a client certificate always needs https. |
| CA file | A PEM file to trust for a private certificate authority. Optional. |
Certificate, key and CA files are absolute paths to PEM files, read when you save.
The metrics each chart reads
With Prometheus or a URL, the charts read these series. They come from the usual exporters: cAdvisor through the kubelet, kube-state-metrics, node-exporter and the API server. kube-prometheus-stack, and the prometheus chart with its default subcharts, scrape all of them.
| Chart | Series | Exported by |
|---|---|---|
| Pod and workload CPU | container_cpu_usage_seconds_total | kubelet (cAdvisor) |
| Pod and workload memory | container_memory_working_set_bytes | kubelet (cAdvisor) |
| Pod network | container_network_receive_bytes_total, container_network_transmit_bytes_total | kubelet (cAdvisor) |
| Pod filesystem | container_fs_reads_bytes_total, container_fs_writes_bytes_total, container_fs_usage_bytes | kubelet (cAdvisor) |
| Requests and limits | kube_pod_container_resource_requests, kube_pod_container_resource_limits, kube_pod_status_phase | kube-state-metrics |
| Cluster and Node CPU | node_cpu_seconds_total | node-exporter |
| Cluster and Node memory | node_memory_MemTotal_bytes, node_memory_MemAvailable_bytes | node-exporter |
| Disk | node_filesystem_size_bytes, node_filesystem_avail_bytes for /, else /var | node-exporter |
| Which Node a series is from | node_uname_info (its nodename label) | node-exporter |
| Capacity and Pods | kube_node_status_allocatable, kube_node_status_capacity, kube_pod_info | kube-state-metrics |
| Volume usage | kubelet_volume_stats_used_bytes, kubelet_volume_stats_capacity_bytes | kubelet |
| API requests and latency | apiserver_request_total, apiserver_request_duration_seconds_bucket | API server |
| etcd latency and size | etcd_request_duration_seconds_bucket, apiserver_storage_size_bytes or etcd_db_total_size_in_bytes | API server |
- Container series need the labels
namespace,podandcontainer; kube-state-metrics series neednamespace,podandnode. Node series are matched to their Node through theinstancelabel they share withnode_uname_info. - Ranges: 1h at a 1 minute step, 6h at 5 minutes, 24h at 15 minutes, 7d at 1 hour. Rates use a window of 2 minutes or the step, whichever is longer, so scrape at least every minute.
- A chart without its series shows "No samples in this range." The other charts still draw.
Install a source
Any one of these is enough. Detect finds each of them with no settings. SkoposIDE can install the charts from its Helm screens too.
metrics-server: current CPU and memory
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
On clusters whose kubelets have self-signed serving certificates, such as kind, add --kubelet-insecure-tls to the metrics-server container's arguments.
kube-prometheus-stack: every chart
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace
Grafana Mimir or another shared backend
Have each cluster's Prometheus or agent add an external label such as cluster: prod to what it sends. Then choose Prometheus-compatible URL, or Prometheus or Mimir in the cluster with Path prefix /prometheus, and set Tenant and Cluster label to match.
Check the cluster
Run these with the same kubeconfig context SkoposIDE uses. Replace monitoring, the Service and the port with yours.
metrics-server
kubectl get apiservice v1beta1.metrics.k8s.io # AVAILABLE must be True
kubectl top nodes
kubectl top pods -A
Prometheus through the API server
kubectl get services -A -l app.kubernetes.io/name=prometheus
kubectl auth can-i get services/proxy -n monitoring
kubectl get --raw '/api/v1/namespaces/monitoring/services/kube-prometheus-stack-prometheus:9090/proxy/api/v1/query?query=up'
The answer is JSON with "status":"success". Then ask for one series of each exporter; an empty result means that exporter is missing or not scraped:
…/proxy/api/v1/query?query=count(container_cpu_usage_seconds_total)
…/proxy/api/v1/query?query=count(kube_pod_container_resource_requests)
…/proxy/api/v1/query?query=count(node_cpu_seconds_total)
…/proxy/api/v1/query?query=count(apiserver_request_total)
A URL with a tenant and a cluster label
curl -H 'X-Scope-OrgID: team-a' \
'https://mimir.example.com/prometheus/api/v1/query?query=count(up%7Bcluster%3D%22prod%22%7D)'
Messages and what to check
| The panel says | Check |
|---|---|
| No metrics provider answers in ‹cluster›: there is no Prometheus Service and the metrics.k8s.io API is not served. | Install metrics-server or Prometheus, or choose a source in the settings. |
| Metrics are off: the metrics provider is None in the cluster settings. | Choose another source under Metrics. |
| Reading Prometheus needs permission to get services/proxy in namespace ‹namespace› | Ask for get and create on services/proxy in that namespace. |
| Mimir needs a tenant: set Tenant in this cluster's metrics settings. | Set Tenant. |
| ‹host› has no Prometheus API at ‹URL›: check the path. | The URL or Path prefix, often /prometheus. |
| ‹host› refused the credentials (HTTP 401). | Authentication: the username, password, token or certificate. |
| Prometheus did not answer within 15s | The Service, port and scheme; the Pods behind the Service. |
| the service answered, but not like Prometheus | The port or Path prefix points at something else. |
| No samples for tenant ‹tenant› with ‹label›: check the tenant and the cluster label in the cluster settings. | Tenant and Cluster label must match what the backend stores. |
| Pods, disk and control plane history need Prometheus: metrics-server reports only the current CPU and memory. | Expected with metrics-server. Install Prometheus for history. |
| Collecting samples: metrics-server is read every 15 s, the next sample arrives in ‹n› s. | Nothing: the chart fills while it is open. |