HTTP Probe
The HTTP Probe allows developers to specify a URL which the experiment uses to gauge health/service availability (or other custom conditions) as part of the entry/exit criteria. The received status code is mapped against an expected status. It supports HTTP Get and Post methods.
In HTTP Get method it sends a http GET
request to the provided url and matches the response code based on the given criteria(==
, !=
, oneOf
).
In HTTP Post method it sends a http POST
request to the provided url.
In the case of a complex POST request in which the body spans multiple lines, the bodyPath
attribute can be used to provide the path to a file consisting of the same. This file can be made available to the experiment pod via a ConfigMap resource, with the ConfigMap name being defined in the ChaosEngine or the ChaosExperiment CR. It can be defined at .spec.experiments[].spec.probe
inside ChaosEngine. Also, body
and bodyPath
attributes are mutually exclusive. Refer to the probe schema here.
Where to define
The probes can be defined at .spec.experiments[].spec.probe path inside Chaos Engine.
kind: Workflow
apiVersion: argoproj.io/v1alpha1
spec:
templates:
- inputs:
artifacts:
- raw:
data: |
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
spec:
experiments:
- spec:
probe:
####################################
Probes are defined here
####################################
Schema
Probe schema for HTTP Probe with common properties shared across all probes and properties unique to HTTP probe.
Field | Description | Type | Range | Notes |
name | Flag to hold the name of the probe | Mandatory | N/A type: string | The name holds the name of the probe. It can be set based on the usecase |
type | Flag to hold the type of the probe | Mandatory | httpProbe, k8sProbe, cmdProbe, promProbe | The type supports four types of probes. It can one of the httpProbe, k8sProbe, cmdProbe, promProbe |
mode | Flag to hold the mode of the probe | Mandatory | SOT, EOT, Edge, Continuous, OnChaos | The mode supports five modes of probes. It can one of the SOT, EOT, Edge, Continuous, OnChaos |
url | Flag to hold the URL for the httpProbe | Mandatory | N/A type: string | The url contains the URL which the experiment uses to gauge health/service availability (or other custom conditions) as part of the entry/exit criteria. |
insecureSkipVerify | Flag to hold the flag to skip certificate checks for the httpProbe | Optional | true, false | The insecureSkipVerify contains flag to skip certificate checks. |
responseTimeout | Flag to hold the flag to response timeout for the httpProbe | Optional | N/A type: integer | The responseTimeout contains flag to provide the response timeout for the http Get/Post request. |
Method
Probe properties for method GET and POST.
GET
Field | Description | Type | Range | Notes |
criteria | Flag to hold the criteria for the http get request | Mandatory | ==, !=, oneOf | The criteria contains criteria to match the http get request's response code with the expected responseCode, which need to be fulfill as part of httpProbe run |
responseCode | Flag to hold the expected response code for the get request | Mandatory | HTTP_RESPONSE_CODE | The responseCode contains the expected response code for the http get request as part of httpProbe run |
POST
Field | Description | Type | Range | Notes |
criteria | Flag to hold the criteria for the http post request | Mandatory | ==, !=, oneOf | The criteria contains criteria to match the http post request's response code with the expected responseCode, which need to be fulfill as part of httpProbe run |
responseCode | Flag to hold the expected response code for the post request | Mandatory | HTTP_RESPONSE_CODE | The responseCode contains the expected response code for the http post request as part of httpProbe run |
contentType | Flag to hold the content type of the post request | Mandatory | N/A type: string | The contentType contains the content type of the http body data, which need to be passed for the http post request |
body | Flag to hold the body of the http post request | Mandatory | N/A type: string | The body contains the http body, which is required for the http post request. It is used for the simple http body. If the http body is complex then use bodyPath field. |
bodyPath | Flag to hold the path of the http body, required for the http post request | Optional | N/A type: string | The bodyPath This field is used in case of complex POST request in which the body spans multiple lines, the bodyPath attribute can be used to provide the path to a file consisting of the same. This file can be made available to the experiment pod via a ConfigMap resource, with the ConfigMap name being defined in the ChaosEngine OR the ChaosExperiment CR. |
Run Properties
Probe run properties for HTTP Probe.
Field | Description | Type | Range | Notes |
probeTimeout | Flag to hold the timeout of the probe | Mandatory | N/A type: integer | The probeTimeout represents the time limit for the probe to execute the specified check and return the expected data |
retry | Flag to hold the retry count of the probe | Mandatory | N/A type: integer | The retry contains the number of times a check is re-run upon failure in the first attempt before declaring the probe status as failed. |
interval | Flag to hold the interval of the probe | Mandatory | N/A type: integer | The interval contains the interval for which probes waits between subsequent retries |
probePollingInterval | Flag to hold the polling interval for the probes (applicable for all modes) | Optional | N/A type: integer | The probePollingInterval contains the time interval for which continuous probe should be sleep after each iteration |
initialDelaySeconds | Flag to hold the initial delay interval for the probes | Optional | N/A type: integer | The initialDelaySeconds represents the initial waiting time interval for the probes. |
stopOnFailure | Flags to hold the stop or continue the experiment on probe failure | Optional | N/A type: boolean | The stopOnFailure can be set to true/false to stop or continue the experiment execution after probe fails |
Definition
probe:
- name: "check-frontend-access-url"
type: "httpProbe"
httpProbe/inputs:
url: "<url>"
insecureSkipVerify: false
responseTimeout: <value> # in milli seconds
method:
get:
criteria: == # supports == & != and oneof operations
responseCode: "<response code>"
mode: "Continuous"
runProperties:
probeTimeout: 5
interval: 5
retry: 1
probePollingInterval: 2