Skip to main content

Description

The k8s_mon probe monitors Kubernetes resources: Deployment, DaemonSet, StatefulSet (replicas), Pod (readiness, restarts), Node (readiness), and Service (existence). Optional CPU/memory via metrics-server. Build tag vms_heavy. Uses in-cluster config + ServiceAccount. Requires RBAC get/list on the target resource.

Config fields

FieldTypeRequiredDefaultDescription
typestringYesMust be "k8s_mon"
namespacestringNo"default"Kubernetes namespace
workloadKindstringYesResource kind: "Node", "Pod", "Deployment", "DaemonSet", "StatefulSet", "Service"
workloadNamestring*Specific resource name. One of workloadName or labelSelector required
labelSelectorstring*Label selector (e.g. "app=core-api")
collectStatsboolNofalseCollect CPU/memory per pod via metrics-server

Metrics

Deployment / DaemonSet / StatefulSet

MetricTypeLabels
vms.k8s_mon.statusstatuskind, namespace, workload
vms.k8s_mon.workload.availablegaugekind, namespace, workload
vms.k8s_mon.workload.desiredgaugekind, namespace, workload

Pod

MetricTypeLabels
vms.k8s_mon.pod.readygaugekind, namespace, pod
vms.k8s_mon.restart_countcounterkind, namespace, pod

Stats (collectStats = true)

MetricTypeUnitLabels
vms.k8s_mon.cpu_millicoresgaugemillicoreskind, namespace, pod
vms.k8s_mon.memory_bytesgaugebyteskind, namespace, pod

Example config

{
  "type": "k8s_mon",
  "namespace": "core",
  "workloadKind": "Deployment",
  "workloadName": "core-api",
  "collectStats": true
}

Notes

  • Max 100 pods/nodes emitted per run.
  • Missing RBAC → unknown status with vms.agent.permission_missing{capability=kubernetes_rbac}.
  • collectStats requires metrics-server installed. If absent, stats are silently skipped.
  • Build tag vms_heavy — not in default agent package.