Kubernetes

Kubernetes is an open-source container-orchestration system for automating deployment, scaling and management of containerized applications. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation.

Available solutions

Zabbix version 8.0
Download

Kubernetes Cluster by HTTP

Overview

The template to monitor Kubernetes Cluster. It works without external scripts and uses the script item to make HTTP requests to the Kubernetes API.

Template Kubernetes Cluster by HTTP - collects metrics by HTTP agent from kube-state-metrics endpoint and Kubernetes API.

Don't forget to change macros {$KUBE.API.URL} and {$KUBE.API.TOKEN}. Also, see the Macros section for a list of macros used to set trigger values.

Note: Some metrics may not be collected depending on your Kubernetes version and configuration.

Requirements

Zabbix version: 8.0 and higher.

Tested versions

This template has been tested on:

  • Kubernetes v1.32.6

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Install the Zabbix Helm Chart in your Kubernetes cluster. Internal service metrics are collected from kube-state-metrics endpoint.

Template needs to use authorization via API token.

Set the {$KUBE.API.URL} such as <scheme>://<host>:<port>.

Get the service account name (if a specific release name is used):

kubectl get serviceaccounts -n monitoring

Get the generated service account token using the command:

kubectl get secret zabbix-zabbix-helm-chart -n monitoring -o jsonpath={.data.token} | base64 -d

Then set it to the macro {$KUBE.API.TOKEN}.

Note: Some metrics may not be collected depending on your Kubernetes version and configuration.

Also, see the Macros section for a list of macros used to set trigger values.

Set up the fields to filter the metrics of discovered node by names:

  • {$KUBE.LLD.FILTER.NODE.MATCHES}
  • {$KUBE.LLD.FILTER.NODE.NOT_MATCHES}

Set up macros to filter metrics by namespace:

  • {$KUBE.LLD.FILTER.NAMESPACE.MATCHES}
  • {$KUBE.LLD.FILTER.NAMESPACE.NOT_MATCHES}

Note: If you have a large cluster, it is highly recommended to set a filter in values of the chart Zabbix Helm Chart to get only the necessary metrics in raw data before they go into Zabbix.

Use the metricLabelsAllowlist and metricAnnotationsAllowList fields in KSM for advanced filtering by labels and annotations.

You can also set up evaluation periods for replica mismatch triggers (Deployments, ReplicaSets, StatefulSets) with the macro {$KUBE.REPLICA.MISMATCH.EVAL_PERIOD}, which supports context and regular expressions. For example, you can create the following macros:

  • Set the evaluation period for the Deployment "nginx-deployment" in the namespace "default" to the 3 last values:

{$KUBE.REPLICA.MISMATCH.EVAL_PERIOD:"deployment:default:nginx-deployment"} = #3

  • Set the evaluation period for all Deployments to the 10 last values:

{$KUBE.REPLICA.MISMATCH.EVAL_PERIOD:regex:"deployment:.*:.*"} = #10 or {$KUBE.REPLICA.MISMATCH.EVAL_PERIOD:regex:"^deployment.*"} = #10

  • Set the evaluation period for Deployments, ReplicaSets and StatefulSets in the namespace "default" to 15 minutes:

{$KUBE.REPLICA.MISMATCH.EVAL_PERIOD:regex:".*:default:.*"} = 15m

Note: that different context macros with regular expressions matching the same string can be applied in an undefined order, and simple context macros (without regular expressions) have higher priority. Read the Important notes section in Zabbix documentation for details.

Macros used

Name Description Default
{$KUBE.API.TOKEN}

Service account bearer token.

{$KUBE.API.URL}

Kubernetes API endpoint URL in the format ://:.

https://kubernetes.default.svc
{$KUBE.HTTP.PROXY}

Sets the HTTP proxy to http_proxy value. If this parameter is empty, then no proxy is used.

{$HTTP.TLS.VERIFY}

TLS certificate verification for script items and JavaScript preprocessing: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "Kubernetes Cluster", e.g. {$HTTP.TLS.VERIFY:"Kubernetes Cluster"}.

full
{$KUBE.NODE.EXPORTER.PORT}

Kubernetes prometheus-node-exporter metrics endpoint port.

9100
{$KUBE.LLD.FILTER.NAMESPACE.MATCHES}

Filter of discoverable metrics by namespace.

.*
{$KUBE.LLD.FILTER.NAMESPACE.NOT_MATCHES}

Filter to exclude discovered metrics by namespace.

CHANGE_IF_NEEDED
{$KUBE.LLD.FILTER.NODE.MATCHES}

Filter of discoverable nodes by nodename.

.*
{$KUBE.LLD.FILTER.NODE.NOT_MATCHES}

Filter to exclude discovered nodes by nodename.

CHANGE_IF_NEEDED
{$KUBE.LLD.FILTER.PV.MATCHES}

Filter of discoverable persistent volumes by name.

.*
{$KUBE.LLD.FILTER.PV.NOT_MATCHES}

Filter to exclude discovered persistent volumes by name.

CHANGE_IF_NEEDED
{$KUBE.REPLICA.MISMATCH.EVAL_PERIOD}

The evaluation period range which is used for calculation of expressions in trigger prototypes (time period or value range). Can be used with context.

#5
{$KUBE.CLUSTER.CPU.UTIL.WARN}

The threshold of CPU usage in percent.

70
{$KUBE.CLUSTER.MEMORY.UTIL.WARN}

The threshold of memory usage in percent.

70
{$KUBE.CLUSTER.CPU.UTIL.CRIT}

The threshold of CPU usage in percent.

80
{$KUBE.CLUSTER.MEMORY.UTIL.CRIT}

The threshold of memory usage in percent.

80
{$KUBE.NODE.NUMBER.THRESHOLD}

The number of nodes in the cluster used in triggers.

2
{$KUBE.CLUSTER.POD.PENDING.THRESHOLD}

The number of pending pods used in triggers.

5
{$KUBE.CLUSTER.POD.FAILED.THRESHOLD}

The number of failed pods used in triggers.

5
{$KUBE.NAMESPACE.POD.PENDING.THRESHOLD}

The number of pending pods used in triggers.

3

Items

Name Description Type Key and additional info
Get state metrics

Collecting Kubernetes metrics from kube-state-metrics.

Script kube.state.metrics
Get resource metrics

Collecting metrics from kubelet in /metrics/resource.

Dependent item kube.resource.metrics

Preprocessing

  • Prometheus to JSON: kube_node_info

  • JSON Path: $..labels.node

    ⛔️Custom on fail: Set error to: Failed to get Nodes. Check debug log for more information.

  • JavaScript: The text is too long. Please see the template.

Get readyz HTTP agent kube.get.readyz

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Get livez HTTP agent kube.get.livez

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Get state metrics check

Check that the kube-state-metrics data has been received correctly.

Dependent item kube.state.metrics.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to

  • Discard unchanged with heartbeat: 3h

Namespace count

The number of namespaces.

Dependent item kube.namespace.count

Preprocessing

  • Prometheus pattern: COUNT(kube_namespace_created)

    ⛔️Custom on fail: Discard value

CronJob count

The number of cronjobs.

Dependent item kube.cronjob.count

Preprocessing

  • Prometheus pattern: COUNT(kube_cronjob_created)

    ⛔️Custom on fail: Discard value

Job count

Number of jobs (generated by cronjob + job).

Dependent item kube.job.count

Preprocessing

  • Prometheus pattern: COUNT(kube_job_created)

    ⛔️Custom on fail: Discard value

Endpoint count

The number of endpoints.

Dependent item kube.endpoint.count

Preprocessing

  • Prometheus pattern: COUNT(kube_endpoint_created)

    ⛔️Custom on fail: Discard value

Deployment count

The number of deployments.

Dependent item kube.deployment.count

Preprocessing

  • Prometheus pattern: COUNT(kube_deployment_created)

    ⛔️Custom on fail: Discard value

Service count

The number of services.

Dependent item kube.service.count

Preprocessing

  • Prometheus pattern: COUNT(kube_service_created)

    ⛔️Custom on fail: Discard value

StatefulSet count

The number of statefulsets.

Dependent item kube.statefulset.count

Preprocessing

  • Prometheus pattern: COUNT(kube_statefulset_created)

    ⛔️Custom on fail: Discard value

Node count

The number of nodes.

Dependent item kube.node.count

Preprocessing

  • Prometheus pattern: COUNT(kube_node_created)

    ⛔️Custom on fail: Discard value

Node Ready count

The number of Ready nodes.

Dependent item kube.node.ready.count

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Node Not Ready count

The number of Not Ready nodes.

Dependent item kube.node.not_ready.count

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Configmap count

The number of configmaps.

Dependent item kube.configmap.count

Preprocessing

  • Prometheus pattern: COUNT(kube_configmap_created)

    ⛔️Custom on fail: Discard value

PVC count

The number of PVC.

Dependent item kube.persistentvolumeclaim.count

Preprocessing

  • Prometheus pattern: COUNT(kube_persistentvolumeclaim_created)

    ⛔️Custom on fail: Discard value

PV count

The number of PV.

Dependent item kube.persistentvolume.count

Preprocessing

  • Prometheus pattern: COUNT(kube_persistentvolume_created)

    ⛔️Custom on fail: Discard value

Secret count

The number of secrets.

Dependent item kube.secret.count

Preprocessing

  • Prometheus pattern: COUNT(kube_secret_created)

    ⛔️Custom on fail: Discard value

Memory allocatable

The memory allocatable in the cluster calculated as a sum of allocatable memory on all nodes.

Dependent item kube.cluster.memory_allocatable

Preprocessing

  • Prometheus pattern: SUM(kube_node_status_allocatable{resource="memory"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Memory limits

The memory limits in the cluster calculated as a sum of memory limits on all pods.

Dependent item kube.cluster.memory_limits

Preprocessing

  • Prometheus pattern: SUM(kube_pod_container_resource_limits{resource="memory"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Memory requests

The memory requests in the cluster calculated as a sum of memory requests on all pods.

Dependent item kube.cluster.memory_requests

Preprocessing

  • Prometheus pattern: SUM(kube_pod_container_resource_requests{resource="memory"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Memory usage

The memory usage in the cluster calculated as a sum of working set memory on all nodes.

Dependent item kube.cluster.memory_usage

Preprocessing

  • Prometheus pattern: SUM(node_memory_working_set_bytes)

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Memory utilization

Cluster memory utilization calculated as a percentage of used memory from total memory.

Calculated kube.cluster.memory_utilization
CPU allocatable

The CPU allocatable in the cluster calculated as a sum of allocatable CPU on all nodes.

Dependent item kube.cluster.cpu_allocatable

Preprocessing

  • Prometheus pattern: SUM(kube_node_status_allocatable{resource="cpu"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

CPU limits

The CPU limits in the cluster calculated as a sum of CPU limits on all pods.

Dependent item kube.cluster.cpu_limits

Preprocessing

  • Prometheus pattern: SUM(kube_pod_container_resource_limits{resource="cpu"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

CPU requests

The CPU requests in the cluster calculated as a sum of CPU requests on all pods.

Dependent item kube.cluster.cpu_requests

Preprocessing

  • Prometheus pattern: SUM(kube_pod_container_resource_requests{resource="cpu"})

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

CPU usage

The CPU usage in the cluster calculated as a sum of CPU seconds on all nodes.

Dependent item kube.cluster.cpu_usage

Preprocessing

  • Prometheus pattern: SUM(node_cpu_usage_seconds_total)

    ⛔️Custom on fail: Discard value

  • Change per second
CPU utilization

The CPU utilization in the cluster calculated as a percentage of used CPU from allocatable CPU.

Calculated kube.cluster.cpu_utilization
Running pods

The number of running pods.

Dependent item kube.pod.running

Preprocessing

  • Prometheus pattern: SUM(kube_pod_status_phase{phase="Running"})

    ⛔️Custom on fail: Discard value

Pod pending

The number of pods in pending state.

Dependent item kube.pod.pending

Preprocessing

  • Prometheus pattern: SUM(kube_pod_status_phase{phase="Pending"})

    ⛔️Custom on fail: Discard value

Pod failed

The number of pods in failed state.

Dependent item kube.pod.failed

Preprocessing

  • Prometheus pattern: SUM(kube_pod_status_phase{phase="Failed"})

    ⛔️Custom on fail: Discard value

Containers running

The number of running containers in the cluster.

Dependent item kube.pod.containers_running

Preprocessing

  • Prometheus pattern: SUM(kube_pod_container_status_running)

    ⛔️Custom on fail: Discard value

ReplicaSets count

The number of ReplicaSets in the cluster.

Dependent item kube.pod.replicaset_count

Preprocessing

  • Prometheus pattern: COUNT(kube_replicaset_owner)

    ⛔️Custom on fail: Discard value

Daemonset count

The number of DaemonSets in the cluster.

Dependent item kube.pod.daemonset_count

Preprocessing

  • Prometheus pattern: COUNT(kube_daemonset_labels)

    ⛔️Custom on fail: Discard value

Ingress count

The number of Ingresses in the cluster.

Dependent item kube.pod.ingress_count

Preprocessing

  • Prometheus pattern: COUNT(kube_ingress_info)

    ⛔️Custom on fail: Discard value

Triggers

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: Readyz is unhealthy count(/Kubernetes Cluster by HTTP/kube.get.readyz,#2,"ne","1")=2 and length(last(/Kubernetes Cluster by HTTP/kube.get.readyz))>0 Average
Kubernetes Cluster: Livez is unhealthy count(/Kubernetes Cluster by HTTP/kube.get.livez,#2,"ne","1")=2 and length(last(/Kubernetes Cluster by HTTP/kube.get.livez))>0 Average
Kubernetes Cluster: Failed to get kube-state-metrics data

Failed to get kube-state-metrics.

length(last(/Kubernetes Cluster by HTTP/kube.state.metrics.check))>0 Warning
Kubernetes Cluster: No Ready nodes

There are no Ready nodes in the cluster.

last(/Kubernetes Cluster by HTTP/kube.node.ready.count)=0 and last(/Kubernetes Cluster by HTTP/kube.node.count)>0 High
Kubernetes Cluster: Low number of Ready nodes

The number of Ready nodes in the cluster is less than {$KUBE.NODE.NUMBER.THRESHOLD}.

last(/Kubernetes Cluster by HTTP/kube.node.ready.count)< {$KUBE.NODE.NUMBER.THRESHOLD} and last(/Kubernetes Cluster by HTTP/kube.node.count)>0 High Depends on:
  • Kubernetes Cluster: No Ready nodes
Kubernetes Cluster: High memory utilization

The cluster memory utilization has exceeded {$KUBE.CLUSTER.MEMORY.UTIL.CRIT}%.

min(/Kubernetes Cluster by HTTP/kube.cluster.memory_utilization,5m) > {$KUBE.CLUSTER.MEMORY.UTIL.CRIT} Average
Kubernetes Cluster: High memory utilization

The cluster memory utilization has exceeded {$KUBE.CLUSTER.MEMORY.UTIL.WARN}%.

min(/Kubernetes Cluster by HTTP/kube.cluster.memory_utilization,5m) > {$KUBE.CLUSTER.MEMORY.UTIL.WARN} Warning Depends on:
  • Kubernetes Cluster: High memory utilization
Kubernetes Cluster: High cpu utilization

Cluster CPU utilization has exceeded {$KUBE.CLUSTER.CPU.UTIL.CRIT}%. The cluster might be slow to respond.

min(/Kubernetes Cluster by HTTP/kube.cluster.cpu_utilization,5m) > {$KUBE.CLUSTER.CPU.UTIL.CRIT} Average
Kubernetes Cluster: High cpu utilization

Cluster CPU utilization is too high. The cluster might be slow to respond.

min(/Kubernetes Cluster by HTTP/kube.cluster.cpu_utilization,5m) > {$KUBE.CLUSTER.CPU.UTIL.WARN} Warning Depends on:
  • Kubernetes Cluster: High cpu utilization
Kubernetes Cluster: Pod pending high

The number of pending pods is high {$KUBE.CLUSTER.POD.PENDING.THRESHOLD}.

last(/Kubernetes Cluster by HTTP/kube.pod.pending) > {$KUBE.CLUSTER.POD.PENDING.THRESHOLD} Warning
Kubernetes Cluster: Pod failed high

The number of failed pods is high {$KUBE.CLUSTER.POD.FAILED.THRESHOLD}.

last(/Kubernetes Cluster by HTTP/kube.pod.failed) > {$KUBE.CLUSTER.POD.FAILED.THRESHOLD} Warning

LLD rule Namespace discovery

Name Description Type Key and additional info
Namespace discovery Dependent item kube.namespace.discovery

Preprocessing

  • Prometheus to JSON: kube_namespace_created

  • Discard unchanged with heartbeat: 1h

Item prototypes for Namespace discovery

Name Description Type Key and additional info
Namespace [{#NAMESPACE}]: CPU: Total usage

The total CPU usage in the namespace calculated as a sum of non-idle CPU seconds on all containers in the namespace.

Dependent item kube.namespace.cpu_total[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Namespace [{#NAMESPACE}]: CPU: Limits

The CPU limits in the namespace calculated as a sum of CPU limits on all pods in the namespace.

Dependent item kube.namespace.limits.cpu[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: CPU: Requests

The number of requested CPU cores by a container.

Dependent item kube.pod.containers.requests.cpu[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: CPU: Usage, %

The CPU usage in the namespace calculated as a percentage of used CPU from allocatable CPU in the cluster.

Calculated kube.namespace.cpu_usage[{#NAMESPACE}]
Namespace [{#NAMESPACE}]: Memory: Total usage

The total memory usage in bytes in the namespace calculated as a sum of used memory on all containers in the namespace.

Dependent item kube.namespace.memory_usage[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

Namespace [{#NAMESPACE}]: Memory: Usage, %

The memory usage in the namespace calculated as a percentage of used memory from allocatable memory in the cluster.

Calculated kube.namespace.memory_usage_percentage[{#NAMESPACE}]
Namespace [{#NAMESPACE}]: Memory: Limits

The memory limits in the namespace calculated as a sum of memory limits on all pods in the namespace.

Dependent item kube.namespace.limits.memory[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: Memory: Requests

The memory requests in the namespace calculated as a sum of memory requests on all pods in the namespace.

Dependent item kube.namespace.requests.memory[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: Pods: Running

The number of pods in running state in the namespace.

Dependent item kube.namespace.pod.running[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: Pods: Pending

Pod is in pending state.

Dependent item kube.namespace.pod.pending[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: Pods: Failed

Pod is in failed state.

Dependent item kube.namespace.pod.failed[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}]: Status phase

The current status phase of the namespace.

Dependent item kube.namespace.status_phase[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

Trigger prototypes for Namespace discovery

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: Namespace [{#NAMESPACE}]: Pods pending high last(/Kubernetes Cluster by HTTP/kube.namespace.pod.pending[{#NAMESPACE}]) > {$KUBE.NAMESPACE.POD.PENDING.THRESHOLD:"{#NAMESPACE}"} High
Kubernetes Cluster: Namespace [{#NAMESPACE}]: Terminated count(/Kubernetes Cluster by HTTP/kube.namespace.status_phase[{#NAMESPACE}],2m,,2)>=2 Warning

LLD rule Deployment discovery

Name Description Type Key and additional info
Deployment discovery Dependent item kube.deployment.discovery[{#NAMESPACE}]

Preprocessing

  • Prometheus to JSON: The text is too long. Please see the template.

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Item prototypes for Deployment discovery

Name Description Type Key and additional info
Deployment [{#DEPLOYMENT}]: CPU: Total usage

The total CPU usage in the deployment calculated as a sum of non-idle CPU seconds on all containers in the deployment.

Dependent item kube.deployment.cpu_total[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Deployment [{#DEPLOYMENT}]: CPU: Limits

The CPU limits in the deployment calculated as a sum of CPU limits on all pods in the deployment.

Dependent item kube.deployment.limits.cpu[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: CPU: Requests

The number of requested CPU cores by a container.

Dependent item kube.deployment.requests.cpu[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: CPU: Usage, %

The CPU usage in the deployment calculated as a percentage of used CPU from allocatable CPU in the cluster.

Calculated kube.deployment.cpu_usage[{#NAMESPACE}/{#DEPLOYMENT}]
Deployment [{#DEPLOYMENT}]: Memory: Total usage

The total memory usage in bytes in the deployment calculated as a sum of used memory on all containers in the deployment.

Dependent item kube.deployment.memory_usage[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

Deployment [{#DEPLOYMENT}]: Memory: Usage, %

The memory usage in the deployment calculated as a percentage of used memory from allocatable memory in the cluster.

Calculated kube.deployment.memory_usage_percentage[{#NAMESPACE}/{#DEPLOYMENT}]
Deployment [{#DEPLOYMENT}]: Memory: Limits

The memory limits in the deployment calculated as a sum of memory limits on all pods in the deployment.

Dependent item kube.deployment.containers.limits.memory[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: Memory: Requests

The memory requests in the deployment calculated as a sum of memory requests on all pods in the deployment.

Dependent item kube.deployment.containers.requests.memory[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: Replicas desired

Number of desired pods for a deployment.

Dependent item kube.deployment.replicas_desired[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: Replicas available

The number of available replicas per deployment.

Dependent item kube.deployment.replicas_available[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Deployment [{#DEPLOYMENT}]: Replicas mismatched

The number of available replicas not matching the desired number of replicas.

Dependent item kube.deployment.replicas_mismatched[{#NAMESPACE}/{#DEPLOYMENT}]

Preprocessing

  • Prometheus to JSON: The text is too long. Please see the template.

  • JavaScript: The text is too long. Please see the template.

Trigger prototypes for Deployment discovery

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: Deployment [{#DEPLOYMENT}]: Deployment replicas mismatch

Deployment has not matched the expected number of replicas during the specified trigger evaluation period.

min(/Kubernetes Cluster by HTTP/kube.deployment.replicas_mismatched[{#NAMESPACE}/{#DEPLOYMENT}],{$KUBE.REPLICA.MISMATCH.EVAL_PERIOD:"deployment:{#NAMESPACE}:{#DEPLOYMENT}"})>0 and last(/Kubernetes Cluster by HTTP/kube.deployment.replicas_desired[{#NAMESPACE}/{#DEPLOYMENT}])>=0 and last(/Kubernetes Cluster by HTTP/kube.deployment.replicas_available[{#NAMESPACE}/{#DEPLOYMENT}])>=0 Warning

LLD rule PVC discovery

Name Description Type Key and additional info
PVC discovery Dependent item kube.pvc.discovery

Preprocessing

  • Prometheus to JSON: kube_persistentvolumeclaim_info

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Item prototypes for PVC discovery

Name Description Type Key and additional info
Namespace [{#NAMESPACE}] PVC [{#NAME}] Status phase

The current status phase of the persistent volume claim.

Dependent item kube.pvc.status_phase[{#NAMESPACE}/{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

Namespace [{#NAMESPACE}] PVC [{#NAME}] Requested storage

The capacity of storage requested by the persistent volume claim.

Dependent item kube.pvc.requested.storage[{#NAMESPACE}/{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}] PVC status phase: Bound, sum

The total amount of persistent volume claims in the Bound phase.

Dependent item kube.pvc.status_phase.bound.sum[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}] PVC status phase: Lost, sum

The total amount of persistent volume claims in the Lost phase.

Dependent item kube.pvc.status_phase.lost.sum[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Namespace [{#NAMESPACE}] PVC status phase: Pending, sum

The total amount of persistent volume claims in the Pending phase.

Dependent item kube.pvc.status_phase.pending.sum[{#NAMESPACE}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Trigger prototypes for PVC discovery

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: NS [{#NAMESPACE}] PVC [{#NAME}]: PVC is pending count(/Kubernetes Cluster by HTTP/kube.pvc.status_phase[{#NAMESPACE}/{#NAME}],2m,,5)>=2 Warning

LLD rule PV discovery

Name Description Type Key and additional info
PV discovery Dependent item kube.pv.discovery

Preprocessing

  • Prometheus to JSON: The text is too long. Please see the template.

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 3h

Item prototypes for PV discovery

Name Description Type Key and additional info
PV [{#NAME}] Status phase

The current status phase of the persistent volume.

Dependent item kube.pv.status_phase[{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

PV [{#NAME}] Capacity bytes

A capacity of the persistent volume in bytes.

Dependent item kube.pv.capacity.bytes[{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

PV status phase: Pending, sum

The total amount of persistent volumes in the Pending phase.

Dependent item kube.pv.status_phase.pending.sum[{#SINGLETON}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

PV status phase: Available, sum

The total amount of persistent volumes in the Available phase.

Dependent item kube.pv.status_phase.available.sum[{#SINGLETON}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

PV status phase: Bound, sum

The total amount of persistent volumes in the Bound phase.

Dependent item kube.pv.status_phase.bound.sum[{#SINGLETON}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

PV status phase: Released, sum

The total amount of persistent volumes in the Released phase.

Dependent item kube.pv.status_phase.released.sum[{#SINGLETON}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

PV status phase: Failed, sum

The total amount of persistent volumes in the Failed phase.

Dependent item kube.pv.status_phase.failed.sum[{#SINGLETON}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Trigger prototypes for PV discovery

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: PV [{#NAME}]: PV has failed count(/Kubernetes Cluster by HTTP/kube.pv.status_phase[{#NAME}],2m,,3)>=2 Warning

LLD rule Pod discovery

Name Description Type Key and additional info
Pod discovery Dependent item kube.pod.discovery

Preprocessing

  • Prometheus to JSON: kube_pod_info

Item prototypes for Pod discovery

Name Description Type Key and additional info
Namespace [{#NAMESPACE}] Pod [{#NAME}]: Status phase

Pod status phases.

Dependent item kube.pod.status_phase[{#NAMESPACE}/{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

Namespace [{#NAMESPACE}] Pod [{#NAME}]: Containers restarts

The number of container restarts.

Dependent item kube.pod.containers_restarts[{#NAMESPACE}/{#NAME}]

Preprocessing

  • Prometheus pattern: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Trigger prototypes for Pod discovery

Name Description Expression Severity Dependencies and additional info
Kubernetes Cluster: Namespace [{#NAMESPACE}] Pod [{#NAME}]: Pod failed phase

Pod failed state.

count(/Kubernetes Cluster by HTTP/kube.pod.status_phase[{#NAMESPACE}/{#NAME}],2m,,3)>=2 Average
Kubernetes Cluster: Namespace [{#NAMESPACE}] Pod [{#NAME}]: Pod pending phase

Pod pending state.

count(/Kubernetes Cluster by HTTP/kube.pod.status_phase[{#NAMESPACE}/{#NAME}],2m,,1)>=2 Warning
Kubernetes Cluster: Namespace [{#NAMESPACE}] Pod [{#NAME}]: Pod unknown phase

Pod unknown state.

count(/Kubernetes Cluster by HTTP/kube.pod.status_phase[{#NAMESPACE}/{#NAME}],2m,,4)>=2 Warning
Kubernetes Cluster: Namespace [{#NAMESPACE}] Pod [{#NAME}]: Pod is crash looping

Containers of the pod keep restarting. This most likely indicates that the pod is in the CrashLoopBackOff state.

(last(/Kubernetes Cluster by HTTP/kube.pod.containers_restarts[{#NAMESPACE}/{#NAME}])-min(/Kubernetes Cluster by HTTP/kube.pod.containers_restarts[{#NAMESPACE}/{#NAME}],15m))>1 Warning

LLD rule Node discovery

Name Description Type Key and additional info
Node discovery Dependent item kube.node.discovery

Preprocessing

  • Prometheus to JSON: kube_node_info

Não encontrou a integração que vocá precisa?