Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

StatusCheck allows you to check the health and status of services continuously or synchronously, typically used within workflows to verify system state.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: StatusCheck

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the StatusCheck resource.
metadata.namespace
string
Namespace of the StatusCheck resource. Defaults to default.

Spec Fields

spec
StatusCheckSpec
required
Defines the behavior of the status check.

StatusCheckSpec

mode
StatusCheckMode
default:"Synchronous"
Execution mode of the status check.Enum values:
  • Synchronous - Exit immediately after success or failure
  • Continuous - Continue until duration exceeded or failure threshold exceeded
mode: Continuous
type
StatusCheckType
default:"HTTP"
Type of status check to perform.Enum values:
  • HTTP - HTTP endpoint health check
Currently only HTTP is supported.
duration
*string
Duration of the status check if failure threshold is not exceeded.Available in both Synchronous and Continuous modes.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
duration: "5m"
timeoutSeconds
int
default:"1"
Number of seconds after which a status check execution times out.Minimum: 1
timeoutSeconds: 5
intervalSeconds
int
default:"10"
How often (in seconds) to perform a status check execution.Minimum: 1
intervalSeconds: 30
failureThreshold
int
default:"3"
Minimum consecutive failures for the status check to be considered failed.Minimum: 1
failureThreshold: 5
successThreshold
int
default:"1"
Minimum consecutive successes for the status check to be considered successful.Only works for Synchronous mode.Minimum: 1
successThreshold: 3
recordsHistoryLimit
int
default:"100"
Number of status check records to retain in history.Minimum: 1Maximum: 1000
recordsHistoryLimit: 200
http
*HTTPStatusCheck
HTTP status check configuration. Used when type is HTTP.

HTTPStatusCheck

url
string
required
HTTP endpoint URL to check.
url: "http://my-service:8080/health"
method
HTTPRequestMethod
default:"GET"
HTTP request method.Enum values:
  • GET
  • POST
method: GET
headers
http.Header
HTTP request headers.
headers:
  Content-Type:
    - "application/json"
  Authorization:
    - "Bearer token123"
body
string
HTTP request body (for POST requests).
body: '{"key": "value"}'
criteria
HTTPCriteria
required
Criteria to determine the result of the status check.

HTTPCriteria

statusCode
string
required
Expected HTTP status code(s).Can be:
  • Single code: "200"
  • Inclusive range: "200-400" (both 200 and 400 are included)
statusCode: "200"
or
statusCode: "200-299"

Status Fields

status
StatusCheckStatus
Most recently observed status of the status check.

StatusCheckStatus

startTime
*metav1.Time
Time when the status check started execution.
completionTime
*metav1.Time
Time when the status check was completed.
count
int64
Total number of status check executions.
conditions
[]StatusCheckCondition
Latest available observations of the StatusCheck’s current state.
records
[]StatusCheckRecord
History of status check execution records.

Examples

Synchronous HTTP Check

apiVersion: chaos-mesh.org/v1alpha1
kind: StatusCheck
metadata:
  name: http-check-sync
  namespace: chaos-mesh
spec:
  mode: Synchronous
  type: HTTP
  timeoutSeconds: 5
  intervalSeconds: 10
  successThreshold: 3
  failureThreshold: 3
  http:
    url: http://my-service.default.svc.cluster.local:8080/health
    method: GET
    criteria:
      statusCode: "200"

Continuous HTTP Check

apiVersion: chaos-mesh.org/v1alpha1
kind: StatusCheck
metadata:
  name: http-check-continuous
  namespace: chaos-mesh
spec:
  mode: Continuous
  type: HTTP
  duration: "5m"
  timeoutSeconds: 3
  intervalSeconds: 15
  failureThreshold: 5
  recordsHistoryLimit: 200
  http:
    url: http://api-gateway:8080/api/health
    method: GET
    headers:
      Authorization:
        - "Bearer secret-token"
    criteria:
      statusCode: "200-299"

HTTP POST Check with Body

apiVersion: chaos-mesh.org/v1alpha1
kind: StatusCheck
metadata:
  name: http-post-check
  namespace: chaos-mesh
spec:
  mode: Synchronous
  type: HTTP
  timeoutSeconds: 10
  intervalSeconds: 20
  successThreshold: 1
  failureThreshold: 3
  http:
    url: http://webhook-service:9000/validate
    method: POST
    headers:
      Content-Type:
        - "application/json"
    body: '{"status": "check"}'
    criteria:
      statusCode: "200"