> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-engineering/use-chaos-engineering/probes/probe-templates/kubernetes/index.md).

# Kubernetes Command Probe Templates

Pre-built Command Probe templates for validating Kubernetes resource health and status during chaos experiments. These templates help you quickly set up probes to monitor pods, nodes, containers, and other Kubernetes resources.

Here are Kubernetes probe templates that you can use in your chaos experiments.

<table data-view="cards"><thead><tr><th></th><th></th><th><select multiple><option value="0JDpEpTw" label="container" color="blue"></option><option value="r6_Kv6QU" label="restart" color="blue"></option><option value="iqufeYfV" label="pod" color="blue"></option><option value="FXh3W6vg" label="health-check" color="blue"></option><option value="ivdJ5kaT" label="node" color="blue"></option><option value="JLqtvwwh" label="status" color="blue"></option><option value="EdXSMNe_" label="cluster" color="blue"></option><option value="XrLGyuRm" label="replica" color="blue"></option><option value="cD5XVMEM" label="deployment" color="blue"></option><option value="qUnEUWjZ" label="availability" color="blue"></option><option value="FWygA6W7" label="resource" color="blue"></option><option value="ik2FMe-u" label="cpu" color="blue"></option><option value="xvnbNAju" label="memory" color="blue"></option><option value="HF5-mqv3" label="startup" color="blue"></option><option value="Vr7OuF0e" label="performance" color="blue"></option><option value="G_jSJ16D" label="timing" color="blue"></option><option value="Cbvfz6oG" label="health" color="blue"></option><option value="TEsxM7k1" label="running" color="blue"></option><option value="7peG5crX" label="warnings" color="blue"></option><option value="V0bX6St5" label="events" color="blue"></option><option value="f61-35sE" label="monitoring" color="blue"></option></select></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Container Restart Check</strong></td><td>Container restart check validates the restart count of a container.</td><td><span data-option="0JDpEpTw">container, </span><span data-option="r6_Kv6QU">restart, </span><span data-option="iqufeYfV">pod, </span><span data-option="FXh3W6vg">health-check</span></td><td><a href="#container-restart-check">#container-restart-check</a></td></tr><tr><td><strong>Node Status Check</strong></td><td>Node status check validates the current state of Kubernetes nodes.</td><td><span data-option="ivdJ5kaT">node, </span><span data-option="JLqtvwwh">status, </span><span data-option="EdXSMNe_">cluster, </span><span data-option="FXh3W6vg">health-check</span></td><td><a href="#node-status-check">#node-status-check</a></td></tr><tr><td><strong>Pod Replica Count Check</strong></td><td>Pod replica count check validates the current replica count of Kubernetes pods.</td><td><span data-option="iqufeYfV">pod, </span><span data-option="XrLGyuRm">replica, </span><span data-option="cD5XVMEM">deployment, </span><span data-option="qUnEUWjZ">availability</span></td><td><a href="#pod-replica-count-check">#pod-replica-count-check</a></td></tr><tr><td><strong>Pod Resource Utilisation Check</strong></td><td>Pod resource utilisation check validates the current resource utilisation metrics of Kubernetes pods.</td><td><span data-option="iqufeYfV">pod, </span><span data-option="FWygA6W7">resource, </span><span data-option="ik2FMe-u">cpu, </span><span data-option="xvnbNAju">memory</span></td><td><a href="#pod-resource-utilisation-check">#pod-resource-utilisation-check</a></td></tr><tr><td><strong>Pod Startup Time Check</strong></td><td>Pod startup time check validates the startup time of Kubernetes pods.</td><td><span data-option="iqufeYfV">pod, </span><span data-option="HF5-mqv3">startup, </span><span data-option="Vr7OuF0e">performance, </span><span data-option="G_jSJ16D">timing</span></td><td><a href="#pod-startup-time-check">#pod-startup-time-check</a></td></tr><tr><td><strong>Pod Status Check</strong></td><td>Pod status check validates the current state of Kubernetes pods.</td><td><span data-option="iqufeYfV">pod, </span><span data-option="JLqtvwwh">status, </span><span data-option="Cbvfz6oG">health, </span><span data-option="TEsxM7k1">running</span></td><td><a href="#pod-status-check">#pod-status-check</a></td></tr><tr><td><strong>Pod Warnings Check</strong></td><td>Pod warnings check checks for warnings in the pod events.</td><td><span data-option="iqufeYfV">pod, </span><span data-option="7peG5crX">warnings, </span><span data-option="V0bX6St5">events, </span><span data-option="f61-35sE">monitoring</span></td><td><a href="#pod-warnings-check">#pod-warnings-check</a></td></tr></tbody></table>

### Container Restart Check <a href="#container-restart-check" id="container-restart-check"></a>

Container restart check validates the restart count of a container.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter pods
* `TARGET_NAMES`: Comma-separated list of target pod names
* `TARGET_NAMESPACE`: Namespace of the target pods
* `TARGET_CONTAINER`: Name of the container to check restart count
* `CONTAINER_RESTART`: Maximum allowed restart count

<details>

<summary>Use cases</summary>

* Verify containers don't restart excessively during chaos experiments
* Monitor container stability during resource stress
* Validate application resilience to failures
* Ensure pods maintain healthy restart counts

</details>

### Node Status Check <a href="#node-status-check" id="node-status-check"></a>

Node status check validates the current state of Kubernetes nodes.

**Required Environment Variables:**

* `TARGET_NODE`: Comma-separated list of nodes to be checked
* `TARGET_NODES`: Comma-separated list of nodes to be checked
* `NODE_LABEL`: Node label to filter nodes (e.g., `node-role.kubernetes.io/worker=`)

<details>

<summary>Use cases</summary>

* Verify nodes remain healthy during chaos experiments
* Validate node recovery after failures
* Monitor cluster health during node-level chaos

</details>

### Pod Replica Count Check <a href="#pod-replica-count-check" id="pod-replica-count-check"></a>

Pod replica count check validates the current replica count of Kubernetes pods.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter resources
* `TARGET_NAMES`: Comma-separated list of target resource names
* `TARGET_NAMESPACE`: Namespace of the target resources
* `TARGET_KIND`: Kind of the target resource (e.g., deployment, statefulset)
* `MINIMUM_HEALTHY_REPLICA_COUNT`: Minimum healthy replica count for the target

<details>

<summary>Use cases</summary>

* Verify deployments maintain desired replica count
* Validate auto-scaling behavior during load chaos
* Monitor application availability during pod failures
* Ensure high availability during chaos experiments

</details>

### Pod Resource Utilisation Check <a href="#pod-resource-utilisation-check" id="pod-resource-utilisation-check"></a>

Pod resource utilisation check validates the current resource utilisation metrics of Kubernetes pods.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter pods
* `TARGET_NAMES`: Comma-separated list of target pod names
* `TARGET_NAMESPACE`: Namespace of the target pods
* `METRIC_TYPE`: Metric type to check (cpu or memory)
* `CPU_LIMIT`: CPU usage limit in millicores
* `MEMORY_LIMIT`: Memory usage limit in MB

<details>

<summary>Use cases</summary>

* Monitor resource usage during stress chaos experiments
* Verify resource limits are respected
* Validate application performance under load
* Ensure pods don't exceed resource thresholds

</details>

### Pod Startup Time Check <a href="#pod-startup-time-check" id="pod-startup-time-check"></a>

Pod startup time check validates the startup time of Kubernetes pods.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter pods
* `TARGET_NAMES`: Comma-separated list of target pod names
* `TARGET_NAMESPACE`: Namespace of the target pods
* `STARTUP_DURATION_CUTOFF`: All pods should start within this duration (in seconds)

<details>

<summary>Use cases</summary>

* Validate pods start within acceptable timeframes
* Monitor deployment performance during rollouts
* Detect slow startup issues during chaos experiments
* Ensure application readiness times are optimal

</details>

### Pod Status Check <a href="#pod-status-check" id="pod-status-check"></a>

Pod status check validates the current state of Kubernetes pods.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter pods
* `TARGET_NAMES`: Comma-separated list of target pod names
* `TARGET_NAMESPACE`: Namespace of the target pods

<details>

<summary>Use cases</summary>

* Verify pods remain in Running state during chaos experiments
* Validate pod health after failures and restarts
* Monitor application availability continuously
* Ensure pods recover to healthy state after disruptions

</details>

### Pod Warnings Check <a href="#pod-warnings-check" id="pod-warnings-check"></a>

Pod warnings check checks for warnings in the pod events.

**Required Environment Variables:**

* `TARGET_LABELS`: Comma-separated list of target labels to filter pods
* `TARGET_NAMES`: Comma-separated list of target pod names
* `TARGET_NAMESPACE`: Namespace of the target pods

<details>

<summary>Use cases</summary>

* Monitor pod health indicators during chaos experiments
* Detect configuration issues during experiments
* Validate application behavior under stress
* Identify potential problems before they become critical

</details>
