Generated banner for Gke Alert Configuration
Generated logo for Gke Alert Configuration

Gke Alert Configuration

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Configures alerting policies in Terraform for Google Kubernetes Engine (GKE) clusters, workloads, and services using PromQL and Google Cloud Managed Service for Prometheus. Use when writing, analyzing, validating, or deploying Terraform alerting policies to monitor GKE service latency, traffic, error rates using Multi-Window Multi-Burn-Rate SLO alerts, memory saturation, and cluster health such as CrashLoopBackOff and Node NotReady conditions. Don't use for non-GKE compute runtimes such as standalone Compute Engine VMs or standalone Cloud Run services without GKE.
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to defining high-signal alerting policies for Google Kubernetes Engine (GKE) clusters and workloads. It leverages Google Cloud Managed Service for Prometheus and Terraform to monitor the 4 Golden Signals and critical cluster health metrics. The skill emphasizes cost-conscious monitoring by distinguishing between Tier 1 native metrics and Tier 2 kube-state-metrics (KSM), while enforcing best practices like Multi-Window Multi-Burn-Rate SLO alerts and dynamic resource grouping.

What it does

  • Generates Terraform HCL for Google Cloud Monitoring alert policies.
  • Implements Multi-Window Multi-Burn-Rate SLO alerts for error rates.
  • Configures cluster health alerts for CrashLoopBackOff and Node NotReady conditions.
  • Provides validation scripts to ensure PromQL grammar and configuration correctness.
  • Enforces cost-aware monitoring by identifying KSM-dependent metrics.
  • Ensures dynamic alerting coverage using grouping aggregations instead of hardcoded names.

When to use it

  • When you need to define GKE alerting policies as code using Terraform.
  • When implementing SLO-based alerting for GKE services.
  • When you need to monitor GKE cluster health and workload saturation.
  • When you want to ensure your alerting configuration follows SRE best practices for GKE.

Advantages

  • Reduces alert noise by using sophisticated burn-rate logic instead of static thresholds.
  • Promotes infrastructure-as-code consistency through reusable Terraform modules.
  • Provides clear cost guardrails for KSM-dependent metrics.
  • Ensures high-signal monitoring by focusing on the 4 Golden Signals.
  • Automates validation of alerting logic before deployment.

Usage examples

“Generate a Terraform alert policy for GKE service latency using PromQL.”
The agent will provide a google_monitoring_alert_policy resource block using condition_prometheus_query_language, configured with appropriate PromQL for P95 latency and dynamic labels.
“How do I monitor memory saturation for my GKE pods?”
The agent will provide a PromQL query comparing container_memory_working_set_bytes to container_spec_memory_limit_bytes, while warning that explicit memory limits must be set in pod manifests.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google/gke-alert-configuration/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip gke-alert-configuration.zip -d .agents/skills

Documentation by Google

GKE Alert Configuration

This skill provides guidelines and best practices for creating robust, high-signal alerting policies for Google Kubernetes Engine workloads using Google Cloud Managed Service for Prometheus and Terraform. It ensures comprehensive coverage of the 4 Golden Signals and key cluster health metrics while minimizing alert noise.


Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-alert-configuration)" and append agent-skills/1.0 (skill:gke-alert-configuration) to User-Agent headers.

Critical Rules

  • Negative Triggers and Scope Redirection for Non-GKE Standalone Runtimes:

    • This skill is strictly scoped to Google Kubernetes Engine (GKE) workloads, clusters, and services using PromQL and Google Cloud Managed Service for Prometheus.

    • Do not use for non-GKE compute runtimes, such as standalone Compute Engine virtual machines or standalone Cloud Run services without GKE.

    • STOP AND RESPOND DIRECTLY (Do Not Edit Files): When the user requests alert configuration for non-GKE compute infrastructure:

      1. Do not write, create, edit, or validate any Terraform files on disk.

      2. Immediately stop and respond directly to the user in chat:

        • Explicitly Clarify Out-of-Scope: State clearly that standalone Compute Engine virtual machine monitoring or standalone Cloud Run monitoring is out of scope for this GKE-specific PromQL alerting skill, which is designed specifically for GKE workloads using Google Cloud Managed Service for Prometheus and PromQL.

        • Do Not Generate GKE PromQL Alerts: Do not create or generate Kubernetes PromQL alert policies or fabricate Kubernetes container, pod, or node resources for non-GKE infrastructure.

        • Redirect the User: Guide and redirect the user to standard Google Cloud Monitoring metrics, such as compute.googleapis.com/instance/cpu/utilization or run.googleapis.com/request_latencies, using standard google_monitoring_alert_policy with condition_threshold or MQL, or recommend the relevant specialized Cloud observability skill.

  • Mandatory kube-state-metrics (KSM) Cost Guardrail:

    • Deploying open-source kube-state-metrics in Google Cloud Managed Service for Prometheus incurs billable metric ingestion costs.

    • STOP AND ASK PERMISSION FIRST (Do Not Edit Files): When a requested alert rule relies on Tier 2 KSM metrics (such as kube_cronjob_*, kube_pod_status_phase, kube_persistentvolume_*, kube_deployment_*, kube_statefulset_*, kube_job_*, or kube_daemonset_*), do not write, create, edit, or validate any Terraform files or generate alert policies before obtaining user approval.

    • Instead, you must immediately stop and respond directly to the user to:

      1. Alert the user that the requested alert requires kube-state-metrics.

      2. Explain the cost impact: Detail that kube-state-metrics incurs billable sample ingestion costs in Google Cloud Managed Service for Prometheus.

      3. Ask for explicit permission: Ask the user for explicit permission before assuming, enabling, or generating KSM-dependent alert configurations.

      4. Recommend filtering or allowlisting: Suggest and recommend filtering or allowlisting only the specific required metrics, such as using a PodMonitoring resource with metricRelabeling (action: keep) or KSM --metric-allowlist to minimize ingestion costs. Provide a concrete allowlist example.

    • Always prefer Non-KSM Native Alternatives (Tier 1 cAdvisor or native GKE metrics documented in metrics_and_alerts_catalog.md) whenever possible, such as using container_memory_working_set_bytes and container_spec_memory_limit_bytes instead of kube_pod_container_resource_limits.

    • Explicit Tier and Cost Surcharge Identification in Response: In every response where you generate or recommend an alerting policy, you must explicitly state its classification tier and cost impact:

      • Tier 1 native or standard metric (GKE built-in metrics, cAdvisor container_*, kubelet volume stats, kubelet node conditions, and control-plane metrics; see metrics_and_alerts_catalog.md): State that it is a Tier 1 native or standard metric with zero KSM cost surcharge.

      • Tier 2 KSM metric: State that it is a Tier 2 KSM-dependent metric and follow the permission and allowlisting guardrail above. (Tip: Generally, metrics with the kube_ prefix that represent resource state or metadata belong to Tier 2).

  • Plan-Validate-Execute Loop for Approved File Edits: When modifying, adding, or merging approved Terraform files on disk in a workspace, follow the three-phase workflow:

    1. Plan: Draft a structured change plan (changes.json) containing proposed policy resource names, PromQL expressions, grouping labels, and durations.

    2. Validate: Run the pre-edit validation script (python3 scripts/validate_config.py --plan changes.json) to verify PromQL grammar, lookback windows, duration rules, and ensure no duplicate signals exist.

    3. Execute: After the plan passes validation, apply or merge changes in-place into the target Terraform configuration (alerts.tf).

    4. Note: When answering questions or providing Terraform snippets directly in chat where no disk modification is requested, output the complete, valid Terraform HCL block in your response.

  • Configure the 4 Golden Signals and Cluster Health: Always ensure the target Kubernetes workload or service has the following alerting coverage:

    1. Latency (P95 response time)

    2. Errors (Multi-Window Multi-Burn-Rate SLO alerts, such as Fast Burn 1 hour / 5 minutes with factor 14.4, Slow Burn 6 hours / 30 minutes with factor 6.0; do not use simple static ratios)

    3. Traffic (Sudden drop or complete metric disappearance using absent() or default 0 syntax, or overload spikes)

    4. Saturation (Memory Limit Utilization Only): When describing or configuring alert policies for a cluster or project, include ONLY Memory Saturation (container_memory_working_set_bytes / container_spec_memory_limit_bytes). Do NOT include CPU saturation alerts or list container_cpu_usage_seconds_total as an alert metric because CPU is compressible and throttled by CFS quotas rather than causing uncompressible fatal termination (OOM).

    5. Cluster Health (Pod CrashLooping, Node NotReady)

  • PromQL Only (Managed Prometheus): You must use condition_prometheus_query_language with PromQL. Do NOT use MQL or standard condition_threshold unless explicitly requested. Google Cloud Managed Service for Prometheus is the standard telemetry ingestion path for GKE.

  • Terraform Only: Write the generated observability configuration ONLY as Terraform (.tf) files, such as alerts.tf and variables.tf.

  • Dynamic Multi-Resource Alerting (No Hardcoding): You must not hardcode specific pod names, node names, or service names in alerting conditions unless explicitly requested. Alerting policies must be written to cover resources dynamically:

    • Always use grouping aggregations (by (cluster, namespace, service, pod, container)) instead of filtering to a single instance. This allows a single alert policy to dynamically track each service or pod separately.

    • Always declare and use Terraform variables for project_id, cluster_name, and namespace (var.project_id, var.cluster_name, var.namespace) to make the configuration reusable across environments. Always define these variables in variables.tf (or within the configuration) and reference all three in policies or PromQL label matchers.

  • No Redundant Duration Windows on Lookbacks:

    • When PromQL expressions already use an aggregated lookback window (such as increase(...[15m]) > 3 or multi-window SLO burn rates), the query time window already smooths out transient spikes.

    • Adding a Terraform duration on top of a PromQL lookback window increases the Mean Time to Detect (MTTD) without providing additional smoothing benefits.

    • In these cases, set Terraform duration = "0s" (or "60s"). Do not enforce duration = "300s" on top of [15m], which delays critical crashloop alerts by up to 20 minutes total (15 minutes + 5 minutes).

    • Use duration = "300s" only on instantaneous gauge conditions, such as kube_node_status_condition == 0.

  • Use SLO Burn Rates Instead of Simple Ratios: For error rate alerting, always generate Multi-Window Multi-Burn-Rate (MWMBR) SLO alerts (such as 14.4x burn rate over 1 hour and 5 minute windows for a 99% SLO) rather than simple error rate ratios (rate(5xx)/rate(total) > 0.05), which produce excessive false alarms on low traffic.

  • Robust Traffic Drop Detection (absent() / default 0): When monitoring for traffic drops to zero, do not use rate(...) == 0 alone because Prometheus time series disappear completely when no requests occur (evaluating to an empty vector rather than 0). Use default 0 syntax, such as sum(rate(...[5m])) default 0 == 0, or absent(...) == 1.

  • Notification Channels: By default, never configure any notification channels without user input. If the user explicitly provides a notification channel, configure the alerts to use it. Otherwise, you must prompt the user in your response to ask if they would like to configure one.

  • Consult GKE Metrics and Open-Source Alerts Catalog: When designing or generating evaluation suites or alerting policies, consult metrics_and_alerts_catalog.md for public GKE metrics (kubernetes.io/) and open-source Kubernetes alerts (awesome-prometheus-alerts).

  • Plain English Response: You must include a plain English explanation for what the alerts do in your response. Explain what the alert measures, what the threshold represents, and what a trigger indicates.

  • User Labels: Include a user_labels block in all google_monitoring_alert_policy resources to track policies created by this skill:

    user_labels = {
      created-with-google-skill = "gke-alert-configuration"
    }

Alerting Policy Structure in Terraform

Alerting policies must be defined using the google_monitoring_alert_policy resource with condition_prometheus_query_language. Always declare variables in variables.tf for project_id, cluster_name, and namespace.

# variables.tf
variable "project_id" {
  type        = string
  description = "Google Cloud Project ID"
}

variable "cluster_name" {
  type        = string
  description = "GKE Cluster Name"
}

variable "namespace" {
  type        = string
  description = "Target Kubernetes Namespace"
  default     = "default"
}

variable "slo_target" {
  type        = number
  description = "SLO Target fraction (for example 0.99 for 99%)"
  default     = 0.99
}
# alerts.tf
# Example: Multi-Window Multi-Burn-Rate (MWMBR) SLO Alert (Fast Burn: 14.4x, 1h & 5m windows)
resource "google_monitoring_alert_policy" "k8s_service_error_rate_slo" {
  project      = var.project_id
  display_name = "[K8s] ${var.cluster_name} - Service Error Rate SLO Fast Burn"
  combiner     = "OR"

  conditions {
    display_name = "Error Budget Fast Burn (14.4x over 1h and 5m)"
    condition_prometheus_query_language {
      query    = <<-EOT
        (
          (
            sum(
              rate(
                http_requests_total{
                  cluster="${var.cluster_name}",
                  namespace="${var.namespace}",
                  status=~"5.."
                }[5m]
              )
            ) by (service, namespace, cluster)
            /
            sum(
              rate(
                http_requests_total{
                  cluster="${var.cluster_name}",
                  namespace="${var.namespace}"
                }[5m]
              )
            ) by (service, namespace, cluster)
          ) > (1 - ${var.slo_target}) * 14.4
        )
        and
        (
          (
            sum(
              rate(
                http_requests_total{
                  cluster="${var.cluster_name}",
                  namespace="${var.namespace}",
                  status=~"5.."
                }[1h]
              )
            ) by (service, namespace, cluster)
            /
            sum(
              rate(
                http_requests_total{
                  cluster="${var.cluster_name}",
                  namespace="${var.namespace}"
                }[1h]
              )
            ) by (service, namespace, cluster)
          ) > (1 - ${var.slo_target}) * 14.4
        )
      EOT
      duration = "0s"
    }
  }
}

Telemetry Metrics and PromQL Examples

For GKE metrics (kubernetes.io/), community open-source alerts (awesome-prometheus-alerts), KSM cost guardrails, and non-KSM native alternatives, you must read and follow:

For specific PromQL queries corresponding to each of the Golden Signals, you must read and follow:

For GKE cluster prerequisites, enabling Google Cloud Managed Service for Prometheus collection, configuring PodMonitoring custom scraping, and enabling control plane metrics collection (API Server, Controller Manager, Scheduler), you must read and follow:


Tooling Scripts and Validation Loop

Use the validate_config.py script to validate change plans and Terraform configurations when working in a repository:

  • Pre-Edit Plan Validation: Draft a changes.json plan specifying the proposed policies, queries, and durations, and validate it before editing:

    • Command: python3 scripts/validate_config.py --plan changes.json

  • Post-Edit and Directory Validation: Scan existing or modified Terraform files in a directory to ensure no duplicates or syntax errors exist:

    • Command: python3 scripts/validate_config.py --directory [TARGET_TF_DIR] --cluster-var "${var.cluster_name}"

    • Single file validation: python3 scripts/validate_config.py --file [PATH_TO_TF_FILE]


Technical Considerations and Gotchas

  • Lookback Windows versus Duration Buffers:

    • Do not add large duration = "300s" buffers to alerts that already use aggregated lookback windows like increase(...[15m]) or multi-window SLO rates.

    • The [15m] window in increase(...[15m]) > 3 already smooths spikes. Adding duration = "300s" increases MTTD by forcing the restart count to remain above 3 for an extra 5 continuous minutes, delaying alerts by up to 20 minutes total.

    • Use duration = "0s" or "60s" when using lookback window functions. Reserve duration = "300s" for raw instantaneous gauge conditions, such as kube_node_status_condition == 0.

  • Memory Saturation Only for Cluster Alerting:

    • Do not configure CPU saturation alerts for cluster or workload monitoring. CPU is compressible (throttled by the CFS scheduler), while memory is uncompressible (triggers OOMKills).

    • Configure Memory Saturation using container_memory_working_set_bytes / container_spec_memory_limit_bytes.

  • Missing Resource Limits Blind Spot (Mandatory Explanation): Saturation alerts that compare usage to limits (such as container_spec_memory_limit_bytes) will fail to resolve or return NaN if workloads do not have explicit Memory limits configured in their Kubernetes manifests.

    • Mandatory Instruction: Whenever you generate, discuss, or recommend any memory saturation alert comparing usage against limits (including non-KSM cAdvisor alternatives using container_spec_memory_limit_bytes), you must explicitly explain and warn the user in your response that container memory limits must be explicitly configured in the Kubernetes pod specs or manifests (resources.limits.memory) for the saturation query to resolve (and not return NaN or fail to resolve).

  • Linear Disk Predictions (predict_linear): When forecasting volume exhaustion using predict_linear(kubelet_volume_stats_available_bytes[6h:5m], 4 * 24 * 3600) < 0, explain that predict_linear uses linear regression over the recent lookback window (for example, 6 hours) to project when available disk will drop below 0 (for example, within 4 days). Identify kubelet_volume_stats_available_bytes as a Tier 1 native kubelet metric with zero KSM surcharge.

  • API Server Error and Client Metrics:

    • apiserver_request_total and rest_client_requests_total are Tier 1 Control Plane metrics with zero KSM cost surcharge. Explain that apiserver_request_total monitors 5xx HTTP error rates across API server endpoints, while rest_client_requests_total monitors 4xx and 5xx requests sent by REST clients communicating with the API server.

  • Traffic Disappearance Gotcha (absent() / default 0):

    • When traffic drops completely to zero, Prometheus and GMP stop emitting the http_requests_total time series.

    • sum(rate(...[5m])) == 0 evaluates to an empty vector, preventing the alert from triggering.

    • Always use sum(rate(...[5m])) default 0 == 0 or absent(...) == 1 to reliably detect total traffic loss.

  • CrashLooping versus Normal Restarts: A container restarting occasionally might be normal, for example job completion or a minor rolling update. Alert on frequent restarts (such as more than 3 restarts in 15 minutes with duration = "0s") using kube_pod_container_status_restarts_total rather than a single restart to avoid noise.

  • Node Upgrades: During GKE cluster upgrades, nodes are drained and restarted, which can trigger "Node NotReady" alerts. Warn the user that these alerts might fire during maintenance windows, or suggest configuring maintenance windows if supported.


Additional Resources

Files

references/metrics_and_alerts_catalog.md

Comprehensive GKE Metrics & Kubernetes Alerting Catalog

This catalog compiles public Google Kubernetes Engine (GKE) telemetry metrics from the Google Cloud Managed Service for Prometheus Documentation, the GKE Observability Documentation, and the Google Cloud Monitoring Pricing Documentation, along with critical alerting rules from the open-source Awesome Prometheus Alerts for Kubernetes catalog.

It serves as the reference catalog for the gke-alert-configuration skill when generating evaluation suites and production alerting policies in Google Cloud Managed Service for Prometheus and Cloud Monitoring.


Table of Contents

  • Telemetry Decision Hierarchy and KSM Cost Guardrails (~line 61)

    • Classification Tiers and Cost Optimization (~line 84)

    • Tier 2 Allowlist Template (PodMonitoring) (~line 92)

  • GKE Public Metrics Catalog (kubernetes.io/) (~line 119)

    • Container and Pod Core Metrics (~line 123)

    • Node and Infrastructure Core Metrics (~line 143)

    • Autoscaling and Hardware Accelerator Metrics (~line 157)

  • Open Source Kubernetes Alerts Catalog (awesome-prometheus-alerts) (~line 169)

    • Node Health and Capacity Alerts (~line 173)

    • Workload and Container Reliability Alerts (~line 184)

    • Jobs, CronJobs, and Storage Alerts (~line 199)

    • API Server and Control Plane Alerts (~line 210)

  • Non-KSM Native Alternative Implementations (~line 221)

    • Container Memory Saturation and OOM Risk (~line 227)

    • Pod CrashLoopBackOff and Restarts (~line 257)

    • Node Readiness and Health (~line 277)

    • Multi-Window Multi-Burn-Rate SLO Error Rate Alerts (~line 287)

    • Traffic Outage Detection (absent() / default 0) (~line 310)


Telemetry Decision Hierarchy and KSM Cost Guardrails

[!IMPORTANT] Cost Warning on kube-state-metrics (KSM): In Google Cloud Managed Service for Prometheus, billing is based on metric samples ingested. Deploying open-source kube-state-metrics unmodified scrapes state for every object across the cluster, generating high time-series volume and significant ingestion cost.

Mandatory Agent Guardrail: When a user requests an alert that requires kube-state-metrics, you must alert the user that the policy requires KSM, ask for explicit permission before assuming or enabling KSM ingestion, and prefer Non-KSM Native Alternatives where possible.

flowchart TD
    A[User Request for Alert Policy] --> B{Can alert be served via Native GKE or cAdvisor?}
    B -->|Yes - Tier 1| C[Use Native GKE / cAdvisor Metric with Zero KSM Surcharge]
    B -->|No - Requires KSM| D[Alert User on KSM Cost and Ask Permission]
    D --> E{User Approved KSM?}
    E -->|No| F[Fall back to closest Native API / cAdvisor Approximation]
    E -->|Yes - Tier 2| G[Generate KSM Alert Policy and Recommend Filtered PodMonitoring Allowlist]
Classification Tiers and Cost Optimization
  • Tier 1: Native GKE Built-ins / cAdvisor (Zero KSM Cost): Metrics collected natively by GKE or cAdvisor without kube-state-metrics.

  • Tier 2: Filtered KSM (Requires Consent & Allowlist): Rules requiring Kubernetes control-plane state (such as Deployment spec versus ready replicas) that require kube-state-metrics.

Tier 2 Allowlist Template (PodMonitoring with metricRelabeling)

When KSM is required and authorized, always recommend configuring a filtered PodMonitoring resource to scrape only the required metrics and drop all others:

apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
  name: kube-state-metrics-filtered
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: kube-state-metrics
  endpoints:
  - port: http-metrics
    interval: 30s
    metricRelabeling:
    - action: keep
      sourceLabels: [__name__]
      regex: "^(kube_deployment_.*|kube_statefulset_.*|kube_daemonset_.*|kube_cronjob_.*|kube_job_.*|kube_pod_status_phase|kube_pod_info|kube_pod_container_status_.*|kube_persistentvolume_status_phase)$"

GKE Public Metrics Catalog (kubernetes.io/)

Below are the public native GKE telemetry metrics available in Cloud Monitoring.

Container and Pod Core Metrics
Metric PathUnitDescriptionCost Tier
kubernetes.io/container/cpu/core_usage_timesCumulative CPU time consumed by the container.Tier 1 (Native)
kubernetes.io/container/cpu/limit_cores1CPU core limit configured for the container.Tier 1 (Native)
kubernetes.io/container/cpu/request_cores1CPU core request configured for the container.Tier 1 (Native)
kubernetes.io/container/memory/used_bytesByTotal memory currently used by the container.Tier 1 (Native)
kubernetes.io/container/memory/limit_bytesByMemory limit configured for the container.Tier 1 (Native)
kubernetes.io/container/memory/request_bytesByMemory request configured for the container.Tier 1 (Native)
kubernetes.io/container/memory/page_fault_count1Cumulative count of memory page faults.Tier 1 (Native)
kubernetes.io/container/restart_count1Number of times the container has restarted.Tier 1 (Native)
kubernetes.io/container/uptimesDuration the container has been running.Tier 1 (Native)
kubernetes.io/container/ephemeral_storage/used_bytesByLocal ephemeral storage used by container.Tier 1 (Native)
kubernetes.io/container/ephemeral_storage/limit_bytesByEphemeral storage limit for container.Tier 1 (Native)
kubernetes.io/pod/network/received_bytes_countByCumulative bytes received by pod network interface.Tier 1 (Native)
kubernetes.io/pod/network/sent_bytes_countByCumulative bytes sent by pod network interface.Tier 1 (Native)
kubernetes.io/pod/volume/used_bytesByPersistent volume storage used by pod.Tier 1 (Native)
kubernetes.io/pod/volume/total_bytesByTotal persistent volume storage capacity.Tier 1 (Native)
Node and Infrastructure Core Metrics
Metric PathUnitDescriptionCost Tier
kubernetes.io/node/cpu/allocatable_cores1Total allocatable CPU cores on the node.Tier 1 (Native)
kubernetes.io/node/cpu/total_cores1Total physical CPU cores on the node.Tier 1 (Native)
kubernetes.io/node/cpu/core_usage_timesCumulative CPU core seconds used across node.Tier 1 (Native)
kubernetes.io/node/memory/allocatable_bytesByTotal allocatable memory on the node.Tier 1 (Native)
kubernetes.io/node/memory/used_bytesByTotal memory currently used on the node.Tier 1 (Native)
kubernetes.io/node/status1Current operational status of the node.Tier 1 (Native)
kubernetes.io/node/status_condition1Condition status (Ready, MemoryPressure, DiskPressure).Tier 1 (Native)
kubernetes.io/node/ephemeral_storage/used_bytesByEphemeral storage bytes used on node filesystem.Tier 1 (Native)
kubernetes.io/node/pid_used / pid_limit1PIDs used vs. maximum PID limit on node.Tier 1 (Native)
Autoscaling and Hardware Accelerator Metrics
Metric PathUnitDescriptionCost Tier
kubernetes.io/autoscaler/container/cpu/per_replica_recommended_request_cores1VPA recommended CPU request per replica.Tier 1 (Native)
kubernetes.io/autoscaler/container/memory/per_replica_recommended_request_bytesByVPA recommended memory request per replica.Tier 1 (Native)
kubernetes.io/autoscaler/recommenders/horizontal/target_value1HPA target metric value for autoscaling.Tier 1 (Native)
kubernetes.io/container/accelerator/duty_cycle%GPU/TPU accelerator execution duty cycle.Tier 1 (Native)
kubernetes.io/container/accelerator/memory_usedByGPU/TPU accelerator memory allocated.Tier 1 (Native)

Open Source Kubernetes Alerts Catalog (awesome-prometheus-alerts)

Compiled from the open-source community catalog.

Node Health and Capacity Alerts
Alert NameOpen Source PromQL RuleSeverityKSM Required?Non-KSM Native Alternative Available?
Kubernetes Node not readykube_node_status_condition{condition="Ready",status="true"} == 0CriticalNo (Standard)Yes (Tier 1 PromQL / native node status)
Kubernetes Node scheduling disabledkube_node_spec_taint{key="node.kubernetes.io/unschedulable"} == 1WarningNo (Standard)Yes
Kubernetes Node memory pressurekube_node_status_condition{condition="MemoryPressure",status="true"} == 1CriticalNo (Standard)Yes
Kubernetes Node disk pressurekube_node_status_condition{condition="DiskPressure",status="true"} == 1CriticalNo (Standard)Yes
Kubernetes Node network unavailablekube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1CriticalNo (Standard)Yes
Kubernetes Node out of pod capacitysum by (node) ((kube_pod_status_phase{phase="Running"} == 1) + on(uid, instance) group_left(node) (0 * kube_pod_info{pod_template_hash=""})) / sum by (node) (kube_node_status_allocatable{resource="pods"}) * 100 > 90WarningYes (KSM)Yes (Approximate via cAdvisor pod count)
Workload and Container Reliability Alerts
Alert NameOpen Source PromQL RuleSeverityKSM Required?Non-KSM Native Alternative Available?
Kubernetes Pod crash loopingincrease(kube_pod_container_status_restarts_total[15m]) > 3WarningNo (cAdvisor)Yes (kubernetes.io/container/restart_count)
Kubernetes Pod not healthysum by (namespace, pod) (kube_pod_status_phase{phase=~"Pending|Unknown|Failed"}) > 0CriticalYes (KSM)Partial (Native pod availability checks)
Kubernetes Container OOMKiller(kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m >= 1) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}[10m]) == 1WarningYes (KSM)Yes (Memory usage > 95% of container limit)
Kubernetes Deployment replicas mismatchkube_deployment_spec_replicas != kube_deployment_status_replicas_availableWarningYes (KSM)No exact match without KSM (Control Plane state)
Kubernetes StatefulSet replicas mismatchkube_statefulset_status_replicas_ready != kube_statefulset_status_replicasWarningYes (KSM)No exact match without KSM
Kubernetes StatefulSet downkube_statefulset_replicas != kube_statefulset_status_replicas_ready > 0CriticalYes (KSM)No exact match without KSM
Kubernetes Deployment generation mismatchkube_deployment_status_observed_generation != kube_deployment_metadata_generationCriticalYes (KSM)Requires KSM
Kubernetes StatefulSet update not rolled outmax without (revision) (kube_statefulset_status_current_revision unless kube_statefulset_status_update_revision) * (kube_statefulset_replicas != kube_statefulset_status_replicas_updated)WarningYes (KSM)Requires KSM
Kubernetes DaemonSet rollout stuck(kube_daemonset_status_number_ready / kube_daemonset_status_desired_number_scheduled * 100 < 100) or (kube_daemonset_status_desired_number_scheduled - kube_daemonset_status_current_number_scheduled > 0)WarningYes (KSM)Requires KSM
Kubernetes DaemonSet misscheduledkube_daemonset_status_number_misscheduled > 0CriticalYes (KSM)Requires KSM
Jobs, CronJobs, and Storage Alerts
Alert NameOpen Source PromQL RuleSeverityKSM Required?Non-KSM Native Alternative Available?
Kubernetes Job failedkube_job_status_failed > 0WarningYes (KSM)Requires KSM
Kubernetes Job not startingkube_job_status_active == 0 and kube_job_status_failed == 0 and kube_job_status_succeeded == 0 and (time() - kube_job_status_start_time) > 600WarningYes (KSM)Requires KSM
Kubernetes CronJob failing(kube_cronjob_status_last_schedule_time > kube_cronjob_status_last_successful_time) AND (kube_cronjob_status_active == 0) AND (kube_cronjob_spec_suspend == 0)CriticalYes (KSM)Requires KSM
Kubernetes Volume out of disk spacekubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes * 100 < 10 and kubelet_volume_stats_capacity_bytes > 0WarningNo (Kubelet)Yes (kubernetes.io/pod/volume/...)
Kubernetes Volume full in four dayspredict_linear(kubelet_volume_stats_available_bytes[6h:5m], 4 * 24 * 3600) < 0CriticalNo (Kubelet)Yes
Kubernetes PersistentVolume errorkube_persistentvolume_status_phase{phase=~"Failed|Pending"} > 0CriticalYes (KSM)Requires KSM
API Server and Control Plane Alerts
Alert NameOpen Source PromQL RuleSeverityKSM Required?Non-KSM Native Alternative Available?
Kubernetes API server errorssum(rate(apiserver_request_total{job="apiserver",code=~"(?:5..)"}[1m])) by (instance, job) / sum(rate(apiserver_request_total{job="apiserver"}[1m])) by (instance, job) * 100 > 3 and sum(rate(apiserver_request_total{job="apiserver"}[1m])) by (instance, job) > 0CriticalNoYes (Native Control Plane PromQL)
Kubernetes API client errors(sum(rate(rest_client_requests_total{code=~"(4|5).."}[1m])) by (instance, job) / sum(rate(rest_client_requests_total[1m])) by (instance, job)) * 100 > 1 and sum(rate(rest_client_requests_total[1m])) by (instance, job) > 0CriticalNoYes (Native Control Plane PromQL)
Kubernetes client certificate expires soonapiserver_client_certificate_expiration_seconds_count{job="apiserver"} > 0 and on(job) histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job="apiserver"}[5m]))) < 24*60*60CriticalNoYes (Native Control Plane PromQL)
Kubernetes API server latencyhistogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{verb!~"(?:CONNECT|WATCHLIST|WATCH|PROXY)"}[10m])) WITHOUT (subresource)) > 1WarningNoYes (Native Control Plane PromQL)

Non-KSM Native Alternative Implementations

When a user requests open-source catalog alerts that normally rely on kube-state-metrics, the skill must first offer these Tier 1 (Non-KSM) equivalents to avoid customer ingestion costs:

Container Memory Saturation and OOM Risk (Primary Saturation Alert)

Instead of container_memory_working_set_bytes / kube_pod_container_resource_limits, use native cAdvisor limits:

sum(
  container_memory_working_set_bytes{
    cluster="${var.cluster_name}",
    namespace="${var.namespace}",
    container!=""
  }
) by (pod, container)
/
sum(
  container_spec_memory_limit_bytes{
    cluster="${var.cluster_name}",
    namespace="${var.namespace}",
    container!=""
  }
) by (pod, container) > 0.90

[!NOTE] Memory versus CPU Saturation: In Kubernetes, CPU is compressible and throttled by the CFS scheduler without killing containers. Memory is uncompressible and triggers fatal OOMKilled events. Therefore, cluster saturation alerting focuses on Memory Saturation, and CPU saturation alerts (and container_cpu_usage_seconds_total) are excluded from the recommended cluster alert suite.

Pod CrashLoopBackOff and Restarts (Non-KSM Alternative)

Use native GKE Cloud Monitoring metric kubernetes.io/container/restart_count or cAdvisor restart counter:

sum(
  increase(
    kube_pod_container_status_restarts_total{
      cluster="${var.cluster_name}",
      namespace="${var.namespace}"
    }[15m]
  )
) by (pod, container) > 3
  • Duration Rule: Set Terraform duration = "0s" (or "60s"). The [15m] lookback window already smooths transient spikes; adding duration = "300s" delays critical crashloop alerts by 20 minutes total.

Node Readiness and Health (Non-KSM Alternative)
kube_node_status_condition{
  cluster="${var.cluster_name}",
  condition="Ready",
  status="true"
} == 0
Multi-Window Multi-Burn-Rate (MWMBR) SLO Error Rate Alerts

For service error rate monitoring, use multi-window burn rate alerts instead of simple static ratios:

(
  (
    sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}", status=~"5.."}[5m])) by (service)
    /
    sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}"}[5m])) by (service)
  ) > (1 - 0.99) * 14.4
)
and
(
  (
    sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}", status=~"5.."}[1h])) by (service)
    /
    sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}"}[1h])) by (service)
  ) > (1 - 0.99) * 14.4
)
Traffic Outage Detection (absent() / default 0)

Avoid brittle == 0 checks. Use default 0 or absent() to detect total traffic loss:

(sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}"}[5m])) by (service) default 0) == 0
and
(sum(rate(http_requests_total{cluster="${var.cluster_name}", namespace="${var.namespace}"}[5m] offset 1w)) by (service)) > 1

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python, Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/gke-alert-configuration · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google or Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gke-alert-configuration.zip