> 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/pod-startup-time-check.md).

# Pod Startup Time Check

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

## Infrastructure type <a href="#infrastructure-type" id="infrastructure-type"></a>

* **Kubernetes**

## Use cases <a href="#use-cases" id="use-cases"></a>

Pod Startup Time Check probe helps you:

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

***

## Overview <a href="#overview" id="overview"></a>

This probe validates that pods start within a specified duration. It's useful for monitoring deployment performance and ensuring applications initialize quickly after pod creation or restart.

### Probe type <a href="#probe-type" id="probe-type"></a>

**Command Probe**

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Kubernetes cluster with chaos infrastructure installed
* Access to target namespace and pods
* Sufficient RBAC permissions to query pod status and events

***

## Probe properties <a href="#probe-properties" id="probe-properties"></a>

### Command <a href="#command" id="command"></a>

```
healthchecks -name validate-pod-startup-time
```

### Comparator <a href="#comparator" id="comparator"></a>

| Type   | Criteria | Value   |
| ------ | -------- | ------- |
| string | contains | \[Pass] |

The probe passes when the command output contains `[Pass]`, indicating all pods started within the specified duration.

### Environment variables <a href="#environment-variables" id="environment-variables"></a>

| Variable                  | Description                                                                   | Required | Default    |
| ------------------------- | ----------------------------------------------------------------------------- | -------- | ---------- |
| `TARGET_LABELS`           | Comma-separated list of target labels to filter pods.                         | No       | -          |
| `TARGET_NAMES`            | Comma-separated list of target pod names.                                     | No       | -          |
| `TARGET_NAMESPACE`        | Namespace of the target pods.                                                 | No       | -          |
| `TARGET_KIND`             | Kind of the target resource (e.g., `deployment`, `statefulset`, `daemonset`). | No       | deployment |
| `AGE_CRITERIA`            | Pods older than this age (in seconds) will be excluded from the check.        | No       | 300        |
| `STARTUP_DURATION_CUTOFF` | All pods should start within this duration (in seconds).                      | No       | 300        |
| `STATUS_CHECK_TIMEOUT`    | Maximum time in seconds to wait for status check.                             | No       | 180        |
| `STATUS_CHECK_DELAY`      | Delay in seconds between status checks.                                       | No       | 2          |

***

## Run properties <a href="#run-properties" id="run-properties"></a>

| Property          | Description                                                              | Type    | Default |
| ----------------- | ------------------------------------------------------------------------ | ------- | ------- |
| `timeout`         | Maximum time to wait for the probe to complete (e.g., `30s`, `1m`, `5m`) | String  | 180s    |
| `interval`        | Time between probe executions (e.g., `1s`, `5s`, `10s`)                  | String  | 1s      |
| `attempt`         | Number of retry attempts before marking the probe as failed              | Integer | 1       |
| `pollingInterval` | Time between retry attempts (e.g., `1s`, `5s`, `10s`)                    | String  | -       |
| `initialDelay`    | Initial delay before starting the probe (e.g., `0s`, `10s`, `30s`)       | String  | -       |
| `stopOnFailure`   | Stop the experiment if the probe fails                                   | Boolean | false   |
| `verbosity`       | Log verbosity level (`info`, `debug`, `trace`)                           | String  | -       |

***

## Probe definition <a href="#probe-definition" id="probe-definition"></a>

You can define this probe in your chaos experiment as follows:

### Using pod labels <a href="#using-pod-labels" id="using-pod-labels"></a>

```yaml
probe:
  - name: "startup-time-validation"
    type: "cmdProbe"
    mode: "Edge"
    cmdProbe/inputs:
      command: "healthchecks -name validate-pod-startup-time"
      comparator:
        type: "string"
        criteria: "contains"
        value: "[Pass]"
      env:
        - name: TARGET_LABELS
          value: "app=nginx"
        - name: TARGET_NAMESPACE
          value: "production"
        - name: STARTUP_DURATION_CUTOFF
          value: "120"
        - name: AGE_CRITERIA
          value: "600"
    runProperties:
      timeout: 180s
      interval: 1s
      attempt: 1
      stopOnFailure: false
```

### Using pod names <a href="#using-pod-names" id="using-pod-names"></a>

```yaml
probe:
  - name: "specific-pod-startup-check"
    type: "cmdProbe"
    mode: "Edge"
    cmdProbe/inputs:
      command: "healthchecks -name validate-pod-startup-time"
      comparator:
        type: "string"
        criteria: "contains"
        value: "[Pass]"
      env:
        - name: TARGET_NAMES
          value: "my-app-pod"
        - name: TARGET_NAMESPACE
          value: "default"
        - name: STARTUP_DURATION_CUTOFF
          value: "60"
    runProperties:
      timeout: 90s
      interval: 2s
      attempt: 3
```
