Hands-on Lab·Kubernetes and Cloud Native Associate
PromQL Query Basics
Query Prometheus from a Pod instead of a port-forward. Four queries: how many targets exist, how many are down, which jobs they belong to, and how busy the cluster really is.
Observability Guide 37 of 46 Beginner
- Kubernetes1.36.4
- Chartkube-prometheus-stack 88.5.3
- Prometheus Operatorv0.93.1
- TimeAbout 20 min
- Reviewed22 August 2026
Written against the versions above. Metric names are stable across these versions; the numbers in the output are from this cluster and yours will differ.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
- kube-prometheus-stack running in a
monitoringnamespace. The install guide covers it. - No port-forward needed - every query here runs from a Pod inside the cluster.
-
A Pod to query from
-
How many targets, and how many are broken
-
Group them, because a count is not a diagnosis
-
Two queries that answer real questions