fix: mode and value

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
This commit is contained in:
Yue Yang 2021-11-11 11:59:24 +08:00
parent 33f942b5a8
commit 1dd9367b02
41 changed files with 588 additions and 591 deletions

View File

@ -1,5 +1,6 @@
{ {
"semi": false, "semi": false,
"singleQuote": true, "singleQuote": true,
"printWidth": 120 "printWidth": 120,
"proseWrap": "never"
} }

View File

@ -154,10 +154,10 @@ Before you create an experiment using Chaos Dashboard, make sure the following r
The following table shows the fields in the YAML configuration file. The following table shows the fields in the YAML configuration file.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. Only ec2-stop, ec2-restore, and detain-volume are supported. | ec2-stop | Yes | ec2-stop | | action | string | Indicates the specific type of faults. Only ec2-stop, ec2-restore, and detain-volume are supported. | ec2-stop | Yes | ec2-stop |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| secretName | string | Specifies the name of the Kubernetes Secret that stores the AWS authentication information. | None | No | cloud-key-secret | | secretName | string | Specifies the name of the Kubernetes Secret that stores the AWS authentication information. | None | No | cloud-key-secret |
| awsRegion | string | Specifies the AWS region. | None | Yes | us-east-2 | | awsRegion | string | Specifies the AWS region. | None | Yes | us-east-2 |
| ec2Instance | string | Specifies the ID of the EC2 instance. | None | Yes | your-ec2-instance-id | | ec2Instance | string | Specifies the ID of the EC2 instance. | None | Yes | your-ec2-instance-id |

View File

@ -85,11 +85,11 @@ Make sure that the Pod status is `Running`.
### Configuration Description ### Configuration Description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| :-------- | :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :------- | :------------------------------------------- | | :-- | :-- | :-- | :-- | :-- | :-- |
| action | string | Defines the behavior of DNS fault. The value can be `random` or `error`. When the value is `random`, DNS service will return a random IP address; when the value is `error`, DNS service will return an error. | None | Yes | `random` or `error` | | action | string | Defines the behavior of DNS fault. The value can be `random` or `error`. When the value is `random`, DNS service will return a random IP address; when the value is `error`, DNS service will return an error. | None | Yes | `random` or `error` |
| patterns | String array | Selects a domain template that matches faults. Placeholder `?` and wildcard are supported. `*` | [] | No | `google.com`, `chaos-mesh.org`, `github.com` | | patterns | String array | Selects a domain template that matches faults. Placeholder `?` and wildcard are supported. `*` | [] | No | `google.com`, `chaos-mesh.org`, `github.com` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | |
:::note :::note

View File

@ -161,10 +161,10 @@ Before you create an experiment using Chaos Dashboard, make sure the following r
The following table shows the fields in the YAML configuration file. The following table shows the fields in the YAML configuration file.
| Parameter | Type | Descpription | Default value | Required | Example | | Parameter | Type | Descpription | Default value | Required | Example |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. The available fault types include node-stop, node-reset, and disk-loss. | node-stop | Yes | node-stop | | action | string | Indicates the specific type of faults. The available fault types include node-stop, node-reset, and disk-loss. | node-stop | Yes | node-stop |
| mode | string | Indicates the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` | | mode | string | Indicates the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of pods. | None | No | 1 |
| secretName | string | Indicates the name of the Kubernetes secret that stores the GCP authentication information. | None | No | cloud-key-secret | | secretName | string | Indicates the name of the Kubernetes secret that stores the GCP authentication information. | None | No | cloud-key-secret |
| project | string | Indicates the name of GCP project. | None | Yes | your-project | | project | string | Indicates the name of GCP project. | None | Yes | your-project |
| zone | string | Indicates the region of GCP instance. | None | Yes | us-central1-a | | zone | string | Indicates the region of GCP instance. | None | Yes | us-central1-a |

View File

@ -58,12 +58,12 @@ You can create experiments using either Chaos Dashboard or the YAML configuratio
The fields in the YAML configuration file are described in the following table: The fields in the YAML configuration file are described in the following table:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ----------- | | --- | --- | --- | --- | --- | --- |
| duration | string | Specifies the duration of the experiment. | None | Yes | `30s` | | duration | string | Specifies the duration of the experiment. | None | Yes | `30s` |
| stressors | [Stressors](#stressors) | Specifies the stress of CPU or memory | None | No | | | stressors | [Stressors](#stressors) | Specifies the stress of CPU or memory | None | No | |
| stressngStressors | string | Specifies the stres-ng parameter to reach richer stress injection | None | No | `--clone 2` | | stressngStressors | string | Specifies the stres-ng parameter to reach richer stress injection | None | No | `--clone 2` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides a parameter for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | `2` | | value | string | Provides a parameter for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | |
@ -84,6 +84,6 @@ The fields in the YAML configuration file are described in the following table:
##### CPUStressor ##### CPUStressor
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ---- | -------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| workers | int | Specifies the number of threads that apply memory stress | | Yes | `1` | | workers | int | Specifies the number of threads that apply memory stress | | Yes | `1` |
| load | int | Specifies the percentage of CPU occupied0 means sleep and no load; 100 means full load | | No | `50` | | load | int | Specifies the percentage of CPU occupied0 means sleep and no load; 100 means full load | | No | `50` |

View File

@ -111,9 +111,9 @@ Currently, Chaos Mesh only supports using YAML configuration files to create HTT
Common fields are meaningful when the `target` of fault injection is `Request` or `Response`. Common fields are meaningful when the `target` of fault injection is `Request` or `Response`.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random pod), `all` (selecting all eligible pods), `fixed` (selecting a specified number of eligible pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible pods). | | yes | one | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random pod), `all` (selecting all eligible pods), `fixed` (selecting a specified number of eligible pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible pods). | | yes | `one` |
| value | string | Provides parameters for the `mode` configuration depending on the value of `mode`. | | no | 2 | | value | string | Provides parameters for the `mode` configuration depending on the value of `mode`. | | no | 1 |
| target | string | Specifies whether the target of fault injuection is `Request` or `Response`. The [`target`-related fields](#Description-for-`target`-related-fields) should be configured at the same time. | | yes | Request | | target | string | Specifies whether the target of fault injuection is `Request` or `Response`. The [`target`-related fields](#Description-for-`target`-related-fields) should be configured at the same time. | | yes | Request |
| port | int32 | The TCP port that the target service listens on. | | yes | 80 | | port | int32 | The TCP port that the target service listens on. | | yes | 80 |
| method | string | The HTTP method of the target request method. | Takes effect for all methods by default. | no | GET | | method | string | The HTTP method of the target request method. | Takes effect for all methods by default. | no | GET |
@ -136,7 +136,7 @@ Common fields are meaningful when the `target` of fault injection is `Request` o
The `Request` field is a meaningful when the `target` set to `Request` during the fault injection. The `Request` field is a meaningful when the `target` set to `Request` during the fault injection.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------------- | ----------------- | ------------------------------------------------------------------- | ------------- | -------- | ------------ | | --- | --- | --- | --- | --- | --- |
| replace.path | string | Specifies the URI path used to replace content. | | no | /api/v2/ | | replace.path | string | Specifies the URI path used to replace content. | | no | /api/v2/ |
| replace.method | string | Specifies the replaced content of the HTTP request method. | | no | DELETE | | replace.method | string | Specifies the replaced content of the HTTP request method. | | no | DELETE |
| replace.queries | map[string]string | Specifies the replaced key pair of the URI query. | | no | foo: bar | | replace.queries | map[string]string | Specifies the replaced key pair of the URI query. | | no | foo: bar |
@ -147,7 +147,7 @@ The `Request` field is a meaningful when the `target` set to `Request` during th
The `Response` is a meaningful when the `target` set to `Response` during the fault injection. The `Response` is a meaningful when the `target` set to `Response` during the fault injection.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | ----------------- | ----------------------------------------------------------- | --------------------------------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| code | int32 | Specifies the status code responded by `target`. | Takes effect for all status codes by default. | no | 200 | | code | int32 | Specifies the status code responded by `target`. | Takes effect for all status codes by default. | no | 200 |
| response_heads | map[string]string | Matches request headers to `target`. | Takes effect for all responses by default. | no | Content-Type: application/json | | response_heads | map[string]string | Matches request headers to `target`. | Takes effect for all responses by default. | no | Content-Type: application/json |
| replace.code | int32 | Specifies the replaced content of the response status code. | | no | 404 | | replace.code | int32 | Specifies the replaced content of the response status code. | | no | 404 |

View File

@ -175,11 +175,11 @@ For specific features, refer to [Create experiments using the YAML files](#creat
#### General fields #### General fields
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------- | ------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. Only latency, fault, attrOverride, and mistake are supported. | | Yes | latency | | action | string | Indicates the specific type of faults. Only latency, fault, attrOverride, and mistake are supported. | | Yes | latency |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | 1 | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | | No | 1 |
| volumePath | string | The mount point of volume in the target container. Must be the root directory of the mount. | | Yes | /var/run/etcd | | volumePath | string | The mount point of volume in the target container. Must be the root directory of the mount. | | Yes | /var/run/etcd |
| path | string | The valid range of fault injections, either a wildcard or a single file. | Valid for all files by default | No | /var/run/etcd/\*_/_ | | path | string | The valid range of fault injections, either a wildcard or a single file. | Valid for all files by default | No | /var/run/etcd/\*_/_ |
| methods | string[] | Type of the file system call that requires injecting fault. For more information about supported types, refer to [Appendix A](#appendix-a: methods-type). | All Types | No | READ | | methods | string[] | Type of the file system call that requires injecting fault. For more information about supported types, refer to [Appendix A](#appendix-a: methods-type). | All Types | No | READ |
@ -214,7 +214,7 @@ The following are specific information about fields corresponding to action:
AttrOverrideSpec is defined as follows: AttrOverrideSpec is defined as follows:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | -------- | -------------------------------------------------------------------------------------- | ------------- | -------- | ----------------- | | --- | --- | --- | --- | --- | --- |
| ino | int | ino number | | No | | | ino | int | ino number | | No | |
| size | int | File size | | No | | | size | int | File size | | No | |
| blocks | int | Number of blocks that the file uses | | No | | | blocks | int | Number of blocks that the file uses | | No | |
@ -246,7 +246,7 @@ The following are specific information about fields corresponding to action:
MistakeSpec is defined as follows: MistakeSpec is defined as follows:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | ------ | -------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| filling | string | The wrong data to be filled. Only zero (fill 0) or random (fill random bytes) are supported. | | Yes | | | filling | string | The wrong data to be filled. Only zero (fill 0) or random (fill random bytes) are supported. | | Yes | |
| maxOccurrences | int | Maximum number of errors in each operation. | | Yes | 1 | | maxOccurrences | int | Maximum number of errors in each operation. | | Yes | 1 |
| maxLength | int | Maximum length of each error (in bytes). | | Yes | 1 | | maxLength | int | Maximum length of each error (in bytes). | | Yes | 1 |

View File

@ -158,10 +158,10 @@ hello chaos mesh!
## Field description ## Field description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific fault type. The available fault types include return, script, cfl, oom, ccf, tce, tcf, cpf, tde, and tpf. | None | Yes | return | | action | string | Indicates the specific fault type. The available fault types include return, script, cfl, oom, ccf, tce, tcf, cpf, tde, and tpf. | None | Yes | return |
| mode | string | Indicates how to select Pod. The supported modes include one, all, fixed, fixed-percent, and random-max-percent. | None | Yes | 1 | | mode | string | Indicates how to select Pod. The supported modes include one, all, fixed, fixed-percent, and random-max-percent. | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. | None | No | 1 |
| target | string | Indicates the parameter passed to `chaosblade-exec-jvm`, representing JVMChaos targets, supporting servlet, psql, jvm, jedis, http, dubbo, rocketmq, tars, mysql, ruid, redisson, rabbitmq, monodb. | None | Yes | jvm | | target | string | Indicates the parameter passed to `chaosblade-exec-jvm`, representing JVMChaos targets, supporting servlet, psql, jvm, jedis, http, dubbo, rocketmq, tars, mysql, ruid, redisson, rabbitmq, monodb. | None | Yes | jvm |
| flags | map[string]string | Indicates parameters passed to `chaosblade-exec-jvm` and represents the flags of action. | None | No | | | flags | map[string]string | Indicates parameters passed to `chaosblade-exec-jvm` and represents the flags of action. | None | No | |
| matchers | map[string]string | Indicates parameters passed to `chaosblade-execu-jvm` and represents the matching of injection points. | None | No | | | matchers | map[string]string | Indicates parameters passed to `chaosblade-execu-jvm` and represents the matching of injection points. | None | No | |

View File

@ -139,12 +139,12 @@ Before creating NetworkChaos experiments, ensure the following:
## Field description ## Field description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | --------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific fault type. Available types include: `netem`, `delay` (network delay), `loss` (packet loss), `duplicate` (packet duplicating), `corrupt` (packet corrupt), `partition` (network partition), and `bandwidth` (network bandwidth limit).After you specify `action` field, refer to [Description for `action`-related fields](#description-for-action-related-fields) for other necessary field configuration. | None | Yes | Partition | | action | string | Indicates the specific fault type. Available types include: `netem`, `delay` (network delay), `loss` (packet loss), `duplicate` (packet duplicating), `corrupt` (packet corrupt), `partition` (network partition), and `bandwidth` (network bandwidth limit).After you specify `action` field, refer to [Description for `action`-related fields](#description-for-action-related-fields) for other necessary field configuration. | None | Yes | Partition |
| target | Selector | Used in combination with direction, making Chaos only effective for some packets. | None | No | | | target | Selector | Used in combination with direction, making Chaos only effective for some packets. | None | No | |
| direction | enum | Indicates the direction of `target` packets. Available vaules include `from` (the packets from `target`), `to` (the packets to `target`), and `both` ( the packets from or to `target`). This parameter makes Chaos only take effect for a specific direction of packets. | to | No | both | | direction | enum | Indicates the direction of `target` packets. Available vaules include `from` (the packets from `target`), `to` (the packets to `target`), and `both` ( the packets from or to `target`). This parameter makes Chaos only take effect for a specific direction of packets. | to | No | both |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides a parameter for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides a parameter for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | ["nginx"] | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | ["nginx"] |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
@ -160,7 +160,7 @@ For the Net Emulation and Bandwidth fault types, you can further configure the `
Setting `action` to `delay` means simulating network delay fault. You can also configure the following parameters. Setting `action` to `delay` means simulating network delay fault. You can also configure the following parameters.
| Parameter | Type | Description | Required | Required | Example | | Parameter | Type | Description | Required | Required | Example |
| ----------- | ----------------- | --------------------------------------------------------------------------- | -------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| latency | string | Indicates the network latency | No | No | 2ms | | latency | string | Indicates the network latency | No | No | 2ms |
| correlation | string | Indicates the correlation between the current latency and the previous one. | No | No | 0.5 | | correlation | string | Indicates the correlation between the current latency and the previous one. | No | No | 0.5 |
| jitter | string | Indicates the range of the network latency | No | No | 1ms | | jitter | string | Indicates the range of the network latency | No | No | 1ms |
@ -189,7 +189,7 @@ The computational model for `correlation` is as follows:
Setting `action` to `reorder` means simulating network packet reordering fault. You can also configure the following parameters. Setting `action` to `reorder` means simulating network packet reordering fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| reorder | string | Indicates the probability to reorder | 0 | No | 0.5 | | reorder | string | Indicates the probability to reorder | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between this time's length of delay time and the previous time's length of delay time | 0 | No | 0.5 | | correlation | string | Indicates the correlation between this time's length of delay time and the previous time's length of delay time | 0 | No | 0.5 |
| gap | int | Indicates the gap before and after packet reordering | 0 | No | 5 | | gap | int | Indicates the gap before and after packet reordering | 0 | No | 5 |
@ -199,7 +199,7 @@ Setting `action` to `reorder` means simulating network packet reordering fault.
Setting `action` to `loss` means simulating packet loss fault. You can also configure the following parameters. Setting `action` to `loss` means simulating packet loss fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------ | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| loss | string | Indicates the probability of packet loss | 0 | No | 0.5 | | loss | string | Indicates the probability of packet loss | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet loss and the previous time's packet loss | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet loss and the previous time's packet loss | 0 | No | 0.5 |
@ -208,7 +208,7 @@ Setting `action` to `loss` means simulating packet loss fault. You can also conf
Set `action` to `duplicate`, meaning simulating package duplication. At this point, you can also set the following parameters. Set `action` to `duplicate`, meaning simulating package duplication. At this point, you can also set the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| duplicate | string | Indicates the probability of packet duplicating | 0 | No | 0.5 | | duplicate | string | Indicates the probability of packet duplicating | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating | 0 | No | 0.5 |
@ -217,7 +217,7 @@ Set `action` to `duplicate`, meaning simulating package duplication. At this poi
Setting `action` to `corrupt` means simulating package corruption fault. You can also configure the following parameters. Setting `action` to `corrupt` means simulating package corruption fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------ | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| corrupt | string | Indicates the probability of packet corruption | 0 | No | 0.5 | | corrupt | string | Indicates the probability of packet corruption | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption | 0 | No | 0.5 |
@ -228,7 +228,7 @@ For occasional events such as `reorder`, `loss`, `duplicate`, and `corrupt`, the
Setting `action` to `bandwidth` means simulating bandwidth limit fault. You also need to configure the following parameters. Setting `action` to `bandwidth` means simulating bandwidth limit fault. You also need to configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ------ | ---------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| rate | string | Indicates the rate of bandwidth limit | | Yes | 1mbps | | rate | string | Indicates the rate of bandwidth limit | | Yes | 1mbps |
| limit | string | Indicates the number of bytes waiting in queue | | Yes | 1 | | limit | string | Indicates the number of bytes waiting in queue | | Yes | 1 |
| buffer | uint32 | Indicates the maximum number of bytes that can be sent instantaneously | | Yes | 1 | | buffer | uint32 | Indicates the maximum number of bytes that can be sent instantaneously | | Yes | 1 |

View File

@ -133,10 +133,10 @@ Before create experiments using Chaos Dashboard, ensure the following:
The following table describes the fields in the YAML configuration file. The following table describes the fields in the YAML configuration file.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Specifies the fault type to inject. The supported types include `pod-failure`, `pod-kill`, and `container-kill`. | None | Yes | `pod-kill` | | action | string | Specifies the fault type to inject. The supported types include `pod-failure`, `pod-kill`, and `container-kill`. | None | Yes | `pod-kill` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
| containerNames | []string | When you configure `action` to `container-killed`, this configuration is mandatory to specify the target container name for injecting faults. | None | No | ['prometheus'] | | containerNames | []string | When you configure `action` to `container-killed`, this configuration is mandatory to specify the target container name for injecting faults. | None | No | ['prometheus'] |
| gracePeriod | int64 | When you configure `action` to `pod-kill`, this configuration is mandatory to specify the duration before deleting Pod. | 0 | No | 0 | | gracePeriod | int64 | When you configure `action` to `pod-kill`, this configuration is mandatory to specify the duration before deleting Pod. | 0 | No | 0 |

View File

@ -53,10 +53,10 @@ You can create experiments in Chaos Dashboard or using the YAML configuration fi
The fields in the YAML configuration file are described in the following table: The fields in the YAML configuration file are described in the following table:
| Parameter | Type | Note | Default value | Required | Example | | Parameter | Type | Note | Default value | Required | Example |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------- | --------------------------------------- | | --- | --- | --- | --- | --- | --- |
| timeOffset | string | Specifies the length of time offset. | None | Yes | `-5m` | | timeOffset | string | Specifies the length of time offset. | None | Yes | `-5m` |
| clockIds | []string | Specifies the ID of clock that will be offset. See the [<clock>clock_gettime</clock> documentation](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) for details. | `["CLOCK_REALTIME"]` | No | `["CLOCK_REALTIME", "CLOCK_MONOTONIC"]` | | clockIds | []string | Specifies the ID of clock that will be offset. See the [<clock>clock_gettime</clock> documentation](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) for details. | `["CLOCK_REALTIME"]` | No | `["CLOCK_REALTIME", "CLOCK_MONOTONIC"]` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |

View File

@ -154,10 +154,10 @@ stringData:
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,仅支持 ec2-stop、ec2-restart、detach-volume | ec2-stop | 是 | ec2-stop | | action | string | 表示具体的故障类型,仅支持 ec2-stop、ec2-restart、detach-volume | ec2-stop | 是 | ec2-stop |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| secretName | string | 指定存储 AWS 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret | | secretName | string | 指定存储 AWS 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret |
| awsRegion | string | 指定 AWS 区域 | 无 | 是 | us-east-2 | | awsRegion | string | 指定 AWS 区域 | 无 | 是 | us-east-2 |
| ec2Instance | string | 指定 EC2 实例的 ID | 无 | 是 | your-ec2-instance-id | | ec2Instance | string | 指定 EC2 实例的 ID | 无 | 是 | your-ec2-instance-id |

View File

@ -85,11 +85,11 @@ kubectl get pods -n chaos-testing -l app.kubernetes.io/component=chaos-dns-serve
### 配置说明 ### 配置说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| :------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----- | :------- | :------------------------------------------- | | :-- | :-- | :-- | :-- | :-- | :-- |
| action | string | 定义 DNS 故障的行为,值可以为 `random``error`。当值为 `random` 时, DNS 服务返回随机的 IP 地址;当值为 `error` 时 DNS 服务返回错误 | 无 | 是 | `random``error` | | action | string | 定义 DNS 故障的行为,值可以为 `random``error`。当值为 `random` 时, DNS 服务返回随机的 IP 地址;当值为 `error` 时 DNS 服务返回错误 | 无 | 是 | `random``error` |
| patterns | string 数组 | 选择匹配故障行为的域名模版, 支持占位符 `?` 以及通配符 `*` | [] | 否 | `google.com``chaos-mesh.org``github.com` | | patterns | string 数组 | 选择匹配故障行为的域名模版, 支持占位符 `?` 以及通配符 `*` | [] | 否 | `google.com``chaos-mesh.org``github.com` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
:::note 注意 :::note 注意

View File

@ -161,10 +161,10 @@ stringData:
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 指定故障类型可选择的类型包括node-stop、node-reset、disk-loss | node-stop | 是 | node-stop | | action | string | 指定故障类型可选择的类型包括node-stop、node-reset、disk-loss | node-stop | 是 | node-stop |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| secretName | string | 指定存储 GCP 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret | | secretName | string | 指定存储 GCP 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret |
| project | string | 指定 GCP 项目名 | 无 | 是 | your-project | | project | string | 指定 GCP 项目名 | 无 | 是 | your-project |
| zone | string | 指定 GCP 实例区域 | 无 | 是 | us-central1-a | | zone | string | 指定 GCP 实例区域 | 无 | 是 | us-central1-a |

View File

@ -58,12 +58,12 @@ Chaos Mesh 提供的 StressChaos 实验类型可用于模拟容器内压力的
以上 YAML 配置文件中的字段说明如下: 以上 YAML 配置文件中的字段说明如下:
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ----------- | | --- | --- | --- | --- | --- | --- |
| duration | string | 指定具体实验的持续时间 | 无 | 是 | `30s` | | duration | string | 指定具体实验的持续时间 | 无 | 是 | `30s` |
| stressors | [Stressors](#stressors) | 指定 CPU 或内存压力的参数 | 无 | 否 | | | stressors | [Stressors](#stressors) | 指定 CPU 或内存压力的参数 | 无 | 否 | |
| stressngStressors | string | 指定 stress-ng 的参数来达到更丰富的压力注入 | 无 | 否 | `--clone 2` | | stressngStressors | string | 指定 stress-ng 的参数来达到更丰富的压力注入 | 无 | 否 | `--clone 2` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | `2` | | value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -111,9 +111,9 @@ Chaos Mesh 目前仅支持使用 YAML 配置文件创建 HTTPChaos 实验。在
通用字段指故障注入的目标过程为 Request 或 Response 时均有意义的字段。 通用字段指故障注入的目标过程为 Request 或 Response 时均有意义的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | | 是 | one | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的取值,为 `mode` 提供参数 | | 否 | 2 | | value | string | 取决于 `mode` 的取值,为 `mode` 提供参数 | 无 | 否 | 1 |
| target | string | 指定故障注入的目标过程为 `Request``Response`,需要同时配置[与 `target` 相关的字段](#与-target-相关的字段说明) | | 是 | Request | | target | string | 指定故障注入的目标过程为 `Request``Response`,需要同时配置[与 `target` 相关的字段](#与-target-相关的字段说明) | | 是 | Request |
| port | int32 | 目标服务监听的 TCP 端口 | | 是 | 80 | | port | int32 | 目标服务监听的 TCP 端口 | | 是 | 80 |
| method | string | 目标请求的 HTTP method | 默认对所有方法生效 | 否 | GET | | method | string | 目标请求的 HTTP method | 默认对所有方法生效 | 否 | GET |
@ -147,7 +147,7 @@ Request 专用字段是指故障注入的目标过程为 Request (即 `target`
Response 专用字段是指故障注入的目标过程为 Response (即 `target` 设置为 `Response` 时有意义的字段。 Response 专用字段是指故障注入的目标过程为 Response (即 `target` 设置为 `Response` 时有意义的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ---------------- | ----------------- | ------------------------ | -------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| code | int32 | 目标响应的状态码 | 默认对所有状态码生效 | 否 | 200 | | code | int32 | 目标响应的状态码 | 默认对所有状态码生效 | 否 | 200 |
| response_headers | map[string]string | 目标响应的响应头匹配 | 默认对所有响应生效 | 否 | Content-Type: application/json | | response_headers | map[string]string | 目标响应的响应头匹配 | 默认对所有响应生效 | 否 | Content-Type: application/json |
| replace.code | int32 | 指定响应状态码的替换内容 | | 否 | 404 | | replace.code | int32 | 指定响应状态码的替换内容 | | 否 | 404 |

View File

@ -179,11 +179,11 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
#### 通用字段 #### 通用字段
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,仅支持 latency、fault、attrOverride、mistake | | 是 | latency | | action | string | 表示具体的故障类型,仅支持 latency、fault、attrOverride、mistake | | 是 | latency |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | one | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| volumePath | string | volume 在目标容器内的挂载点,必须为挂载的根目录 | | 是 | /var/run/etcd | | volumePath | string | volume 在目标容器内的挂载点,必须为挂载的根目录 | | 是 | /var/run/etcd |
| path | string | 注入错误的生效范围,可以是通配符,也可以是单个文件 | 默认对所有文件生效 | 否 | /var/run/etcd/\*_/_ | | path | string | 注入错误的生效范围,可以是通配符,也可以是单个文件 | 默认对所有文件生效 | 否 | /var/run/etcd/\*_/_ |
| methods | string[] | 需要注入故障的文件系统调用类型,具体支持的类型见[附录 A](#附录-amethods-类型) | 所有类型 | 否 | READ | | methods | string[] | 需要注入故障的文件系统调用类型,具体支持的类型见[附录 A](#附录-amethods-类型) | 所有类型 | 否 | READ |
@ -218,7 +218,7 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
AttrOverrideSpec 定义如下 AttrOverrideSpec 定义如下
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ------ | -------- | -------------------------------------------------------------------------------------- | ------ | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| ino | int | ino 的号 | | 否 | | | ino | int | ino 的号 | | 否 | |
| size | int | 文件大小 | | 否 | | | size | int | 文件大小 | | 否 | |
| blocks | int | 文件占用块数 | | 否 | | | blocks | int | 文件占用块数 | | 否 | |
@ -250,14 +250,12 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
MistakeSpec 定义如下 MistakeSpec 定义如下
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | ------ | ------------------------------------------------------------------ | ------ | -------- | ---- | | --- | --- | --- | --- | --- | --- |
| filling | string | 错误数据的填充内容,只能为 zero填充 0或 random填充随机字节 | | 是 | | | filling | string | 错误数据的填充内容,只能为 zero填充 0或 random填充随机字节 | | 是 | |
| maxOccurrences | int | 错误在每一次操作中最多出现次数 | | 是 | 1 | | maxOccurrences | int | 错误在每一次操作中最多出现次数 | | 是 | 1 |
| maxLength | int | 每次错误的最大长度(单位为字节) | | 是 | 1 | | maxLength | int | 每次错误的最大长度(单位为字节) | | 是 | 1 |
:::warning 警告 :::warning 警告不推荐在除了 READ 和 WRITE 之外的文件系统调用上使用 mistake 错误。这可能会导致预期之外的结果,包括但不限于文件系统损坏、程序崩溃等。 :::
不推荐在除了 READ 和 WRITE 之外的文件系统调用上使用 mistake 错误。这可能会导致预期之外的结果,包括但不限于文件系统损坏、程序崩溃等。
:::
## 本地调试 ## 本地调试

View File

@ -158,10 +158,10 @@ hello chaos mesh!
## 字段说明 ## 字段说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ------ | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,支持 delay、return、script、cfl、oom、ccf、tce、cpf、tde、tpf。 | 无 | 是 | return | | action | string | 表示具体的故障类型,支持 delay、return、script、cfl、oom、ccf、tce、cpf、tde、tpf。 | 无 | 是 | return |
| mode | string | 表示选择 Pod 的方式,支持 one、all、fixed、fixed-percent、random-max-percent。 | 无 | 是 | one | | mode | string | 表示选择 Pod 的方式,支持 one、all、fixed、fixed-percent、random-max-percent。 | 无 | 是 | `one` |
| value | string | 取决于 mode 的取值,为 mode 提供参数 | 无 | 否 | 2 | | value | string | 取决于 mode 的取值,为 mode 提供参数 | 无 | 否 | 1 |
| target | string | 传递给 `chaosblade-exec-jvm` 的参数,代表 JVMChaos 的目标,支持 servlet、psql、jvm、jedis、http、dubbo、rocketmq、tars、mysql、druid、redisson、rabbitmq、mongodb。 | 无 | 是 | jvm | | target | string | 传递给 `chaosblade-exec-jvm` 的参数,代表 JVMChaos 的目标,支持 servlet、psql、jvm、jedis、http、dubbo、rocketmq、tars、mysql、druid、redisson、rabbitmq、mongodb。 | 无 | 是 | jvm |
| flags | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表 action 的 flags | 无 | 否 | | | flags | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表 action 的 flags | 无 | 否 | |
| matchers | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表注入点的匹配方式 | 无 | 否 | | | matchers | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表注入点的匹配方式 | 无 | 否 | |

View File

@ -137,12 +137,12 @@ NetworkChaos 用于模拟集群中网络故障的场景,目前支持以下几
### 字段说明 ### 字段说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | --------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型。netemdelaylossduplicatecorrupt 对应 net emulation 类型partition 表示网络分区bandwidth 表示限制带宽 | 无 | 是 | partition | | action | string | 表示具体的故障类型。netemdelaylossduplicatecorrupt 对应 net emulation 类型partition 表示网络分区bandwidth 表示限制带宽 | 无 | 是 | partition |
| target | Selector | 与 direction 组合使用,使得 Chaos 只对部分包生效 | 无 | 否 | | | target | Selector | 与 direction 组合使用,使得 Chaos 只对部分包生效 | 无 | 否 | |
| direction | enum | 值为 `from``to` 或 `both`。用于指定选出“来自 target 的包”,“发往 target 的包”,或者“全部选中” | to | 否 | both | | direction | enum | 值为 `from``to` 或 `both`。用于指定选出“来自 target 的包”,“发往 target 的包”,或者“全部选中” | to | 否 | both |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | ["nginx"] | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | ["nginx"] |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -139,10 +139,10 @@ PodChaos 是 Chaos Mesh 中的一种故障类型,通过创建 PodChaos 类型
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | -------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 指定要注入的故障类型,仅支持 `pod-failure`、`pod-kill`、`container-kill` | 无 | 是 | `pod-kill` | | action | string | 指定要注入的故障类型,仅支持 `pod-failure`、`pod-kill`、`container-kill` | 无 | 是 | `pod-kill` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
| containerNames | []string | 当你将 `action` 配置为 `container-kill` 时,此配置为必填,用于指定注入故障的目标 container 名 | 无 | 否 | ['prometheus'] | | containerNames | []string | 当你将 `action` 配置为 `container-kill` 时,此配置为必填,用于指定注入故障的目标 container 名 | 无 | 否 | ['prometheus'] |
| gracePeriod | int64 | 当你将 `action` 配置为 `pod-kill` 时,需要填写此项,用于指定删除 Pod 之前的持续时间 | 0 | 否 | 0 | | gracePeriod | int64 | 当你将 `action` 配置为 `pod-kill` 时,需要填写此项,用于指定删除 Pod 之前的持续时间 | 0 | 否 | 0 |

View File

@ -53,10 +53,10 @@ Chaos Mesh 提供的 TimeChaos 实验类型可用于模拟时间偏移的场景
以上 YAML 配置文件中的字段说明如下: 以上 YAML 配置文件中的字段说明如下:
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------- | -------------------------------------- | | --- | --- | --- | --- | --- | --- |
| timeOffset | string | 指定时间偏移的长度 | 无 | 是 | `-5m` | | timeOffset | string | 指定时间偏移的长度 | 无 | 是 | `-5m` |
| clockIds | []string | 指定时间偏移作用的时钟,详见 [`clock_gettime` 文档](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) | `["CLOCK_REALTIME"]` | 否 | `["CLOCK_REALTIME","CLOCK_MONOTONIC"]` | | clockIds | []string | 指定时间偏移作用的时钟,详见 [`clock_gettime` 文档](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) | `["CLOCK_REALTIME"]` | 否 | `["CLOCK_REALTIME","CLOCK_MONOTONIC"]` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -154,10 +154,10 @@ stringData:
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,仅支持 ec2-stop、ec2-restart、detach-volume | ec2-stop | 是 | ec2-stop | | action | string | 表示具体的故障类型,仅支持 ec2-stop、ec2-restart、detach-volume | ec2-stop | 是 | ec2-stop |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| secretName | string | 指定存储 AWS 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret | | secretName | string | 指定存储 AWS 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret |
| awsRegion | string | 指定 AWS 区域 | 无 | 是 | us-east-2 | | awsRegion | string | 指定 AWS 区域 | 无 | 是 | us-east-2 |
| ec2Instance | string | 指定 EC2 实例的 ID | 无 | 是 | your-ec2-instance-id | | ec2Instance | string | 指定 EC2 实例的 ID | 无 | 是 | your-ec2-instance-id |

View File

@ -85,11 +85,11 @@ kubectl get pods -n chaos-testing -l app.kubernetes.io/component=chaos-dns-serve
### 配置说明 ### 配置说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| :------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----- | :------- | :------------------------------------------- | | :-- | :-- | :-- | :-- | :-- | :-- |
| action | string | 定义 DNS 故障的行为,值可以为 `random``error`。当值为 `random` 时, DNS 服务返回随机的 IP 地址;当值为 `error` 时 DNS 服务返回错误 | 无 | 是 | `random``error` | | action | string | 定义 DNS 故障的行为,值可以为 `random``error`。当值为 `random` 时, DNS 服务返回随机的 IP 地址;当值为 `error` 时 DNS 服务返回错误 | 无 | 是 | `random``error` |
| patterns | string 数组 | 选择匹配故障行为的域名模版, 支持占位符 `?` 以及通配符 `*` | [] | 否 | `google.com``chaos-mesh.org``github.com` | | patterns | string 数组 | 选择匹配故障行为的域名模版, 支持占位符 `?` 以及通配符 `*` | [] | 否 | `google.com``chaos-mesh.org``github.com` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `fixed` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
:::note 注意 :::note 注意

View File

@ -161,10 +161,10 @@ stringData:
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 指定故障类型可选择的类型包括node-stop、node-reset、disk-loss | node-stop | 是 | node-stop | | action | string | 指定故障类型可选择的类型包括node-stop、node-reset、disk-loss | node-stop | 是 | node-stop |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| secretName | string | 指定存储 GCP 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret | | secretName | string | 指定存储 GCP 认证信息的 Kubernetes Secret 名字 | 无 | 否 | cloud-key-secret |
| project | string | 指定 GCP 项目名 | 无 | 是 | your-project | | project | string | 指定 GCP 项目名 | 无 | 是 | your-project |
| zone | string | 指定 GCP 实例区域 | 无 | 是 | us-central1-a | | zone | string | 指定 GCP 实例区域 | 无 | 是 | us-central1-a |

View File

@ -58,12 +58,12 @@ Chaos Mesh 提供的 StressChaos 实验类型可用于模拟容器内压力的
以上 YAML 配置文件中的字段说明如下: 以上 YAML 配置文件中的字段说明如下:
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ----------- | | --- | --- | --- | --- | --- | --- |
| duration | string | 指定具体实验的持续时间 | 无 | 是 | `30s` | | duration | string | 指定具体实验的持续时间 | 无 | 是 | `30s` |
| stressors | [Stressors](#stressors) | 指定 CPU 或内存压力的参数 | 无 | 否 | | | stressors | [Stressors](#stressors) | 指定 CPU 或内存压力的参数 | 无 | 否 | |
| stressngStressors | string | 指定 stress-ng 的参数来达到更丰富的压力注入 | 无 | 否 | `--clone 2` | | stressngStressors | string | 指定 stress-ng 的参数来达到更丰富的压力注入 | 无 | 否 | `--clone 2` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | `2` | | value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -111,9 +111,9 @@ Chaos Mesh 目前仅支持使用 YAML 配置文件创建 HTTPChaos 实验。在
通用字段指故障注入的目标过程为 Request 或 Response 时均有意义的字段。 通用字段指故障注入的目标过程为 Request 或 Response 时均有意义的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | | 是 | one | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的取值,为 `mode` 提供参数 | | 否 | 2 | | value | string | 取决于 `mode` 的取值,为 `mode` 提供参数 | 无 | 否 | 1 |
| target | string | 指定故障注入的目标过程为 `Request``Response`,需要同时配置[与 `target` 相关的字段](#与-target-相关的字段说明) | | 是 | Request | | target | string | 指定故障注入的目标过程为 `Request``Response`,需要同时配置[与 `target` 相关的字段](#与-target-相关的字段说明) | | 是 | Request |
| port | int32 | 目标服务监听的 TCP 端口 | | 是 | 80 | | port | int32 | 目标服务监听的 TCP 端口 | | 是 | 80 |
| method | string | 目标请求的 HTTP method | 默认对所有方法生效 | 否 | GET | | method | string | 目标请求的 HTTP method | 默认对所有方法生效 | 否 | GET |
@ -147,7 +147,7 @@ Request 专用字段是指故障注入的目标过程为 Request (即 `target`
Response 专用字段是指故障注入的目标过程为 Response (即 `target` 设置为 `Response` 时有意义的字段。 Response 专用字段是指故障注入的目标过程为 Response (即 `target` 设置为 `Response` 时有意义的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ---------------- | ----------------- | ------------------------ | -------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| code | int32 | 目标响应的状态码 | 默认对所有状态码生效 | 否 | 200 | | code | int32 | 目标响应的状态码 | 默认对所有状态码生效 | 否 | 200 |
| response_headers | map[string]string | 目标响应的响应头匹配 | 默认对所有响应生效 | 否 | Content-Type: application/json | | response_headers | map[string]string | 目标响应的响应头匹配 | 默认对所有响应生效 | 否 | Content-Type: application/json |
| replace.code | int32 | 指定响应状态码的替换内容 | | 否 | 404 | | replace.code | int32 | 指定响应状态码的替换内容 | | 否 | 404 |

View File

@ -179,11 +179,11 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
#### 通用字段 #### 通用字段
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,仅支持 latency、fault、attrOverride、mistake | | 是 | latency | | action | string | 表示具体的故障类型,仅支持 latency、fault、attrOverride、mistake | | 是 | latency |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | one | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | | 否 | 1 |
| volumePath | string | volume 在目标容器内的挂载点,必须为挂载的根目录 | | 是 | /var/run/etcd | | volumePath | string | volume 在目标容器内的挂载点,必须为挂载的根目录 | | 是 | /var/run/etcd |
| path | string | 注入错误的生效范围,可以是通配符,也可以是单个文件 | 默认对所有文件生效 | 否 | /var/run/etcd/\*_/_ | | path | string | 注入错误的生效范围,可以是通配符,也可以是单个文件 | 默认对所有文件生效 | 否 | /var/run/etcd/\*_/_ |
| methods | string[] | 需要注入故障的文件系统调用类型,具体支持的类型见[附录 A](#附录-amethods-类型) | 所有类型 | 否 | READ | | methods | string[] | 需要注入故障的文件系统调用类型,具体支持的类型见[附录 A](#附录-amethods-类型) | 所有类型 | 否 | READ |
@ -218,7 +218,7 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
AttrOverrideSpec 定义如下 AttrOverrideSpec 定义如下
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| ------ | -------- | -------------------------------------------------------------------------------------- | ------ | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| ino | int | ino 的号 | | 否 | | | ino | int | ino 的号 | | 否 | |
| size | int | 文件大小 | | 否 | | | size | int | 文件大小 | | 否 | |
| blocks | int | 文件占用块数 | | 否 | | | blocks | int | 文件占用块数 | | 否 | |
@ -250,14 +250,12 @@ IOChaos 是 Chaos Mesh 中的一种故障类型。通过创建 IOChaos 类型的
MistakeSpec 定义如下 MistakeSpec 定义如下
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | ------ | ------------------------------------------------------------------ | ------ | -------- | ---- | | --- | --- | --- | --- | --- | --- |
| filling | string | 错误数据的填充内容,只能为 zero填充 0或 random填充随机字节 | | 是 | | | filling | string | 错误数据的填充内容,只能为 zero填充 0或 random填充随机字节 | | 是 | |
| maxOccurrences | int | 错误在每一次操作中最多出现次数 | | 是 | 1 | | maxOccurrences | int | 错误在每一次操作中最多出现次数 | | 是 | 1 |
| maxLength | int | 每次错误的最大长度(单位为字节) | | 是 | 1 | | maxLength | int | 每次错误的最大长度(单位为字节) | | 是 | 1 |
:::warning 警告 :::warning 警告不推荐在除了 READ 和 WRITE 之外的文件系统调用上使用 mistake 错误。这可能会导致预期之外的结果,包括但不限于文件系统损坏、程序崩溃等。 :::
不推荐在除了 READ 和 WRITE 之外的文件系统调用上使用 mistake 错误。这可能会导致预期之外的结果,包括但不限于文件系统损坏、程序崩溃等。
:::
## 本地调试 ## 本地调试

View File

@ -158,10 +158,10 @@ hello chaos mesh!
## 字段说明 ## 字段说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ------ | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型,支持 delay、return、script、cfl、oom、ccf、tce、cpf、tde、tpf。 | 无 | 是 | return | | action | string | 表示具体的故障类型,支持 delay、return、script、cfl、oom、ccf、tce、cpf、tde、tpf。 | 无 | 是 | return |
| mode | string | 表示选择 Pod 的方式,支持 one、all、fixed、fixed-percent、random-max-percent。 | 无 | 是 | one | | mode | string | 表示选择 Pod 的方式,支持 one、all、fixed、fixed-percent、random-max-percent。 | 无 | 是 | `one` |
| value | string | 取决于 mode 的取值,为 mode 提供参数 | 无 | 否 | 2 | | value | string | 取决于 mode 的取值,为 mode 提供参数 | 无 | 否 | 1 |
| target | string | 传递给 `chaosblade-exec-jvm` 的参数,代表 JVMChaos 的目标,支持 servlet、psql、jvm、jedis、http、dubbo、rocketmq、tars、mysql、druid、redisson、rabbitmq、mongodb。 | 无 | 是 | jvm | | target | string | 传递给 `chaosblade-exec-jvm` 的参数,代表 JVMChaos 的目标,支持 servlet、psql、jvm、jedis、http、dubbo、rocketmq、tars、mysql、druid、redisson、rabbitmq、mongodb。 | 无 | 是 | jvm |
| flags | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表 action 的 flags | 无 | 否 | | | flags | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表 action 的 flags | 无 | 否 | |
| matchers | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表注入点的匹配方式 | 无 | 否 | | | matchers | map[string]string | 传递给 `chaosblade-exec-jvm` 的参数,代表注入点的匹配方式 | 无 | 否 | |

View File

@ -137,12 +137,12 @@ NetworkChaos 用于模拟集群中网络故障的场景,目前支持以下几
### 字段说明 ### 字段说明
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | --------- | | --- | --- | --- | --- | --- | --- |
| action | string | 表示具体的故障类型。netemdelaylossduplicatecorrupt 对应 net emulation 类型partition 表示网络分区bandwidth 表示限制带宽 | 无 | 是 | partition | | action | string | 表示具体的故障类型。netemdelaylossduplicatecorrupt 对应 net emulation 类型partition 表示网络分区bandwidth 表示限制带宽 | 无 | 是 | partition |
| target | Selector | 与 direction 组合使用,使得 Chaos 只对部分包生效 | 无 | 否 | | | target | Selector | 与 direction 组合使用,使得 Chaos 只对部分包生效 | 无 | 否 | |
| direction | enum | 值为 `from``to` 或 `both`。用于指定选出“来自 target 的包”,“发往 target 的包”,或者“全部选中” | to | 否 | both | | direction | enum | 值为 `from``to` 或 `both`。用于指定选出“来自 target 的包”,“发往 target 的包”,或者“全部选中” | to | 否 | both |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | ["nginx"] | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | ["nginx"] |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -139,10 +139,10 @@ PodChaos 是 Chaos Mesh 中的一种故障类型,通过创建 PodChaos 类型
下表介绍以上 YAML 配置文件中的字段。 下表介绍以上 YAML 配置文件中的字段。
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | -------------- | | --- | --- | --- | --- | --- | --- |
| action | string | 指定要注入的故障类型,仅支持 `pod-failure`、`pod-kill`、`container-kill` | 无 | 是 | `pod-kill` | | action | string | 指定要注入的故障类型,仅支持 `pod-failure`、`pod-kill`、`container-kill` | 无 | 是 | `pod-kill` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 2 | | value | string | 取决与 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比。 | 无 | 否 | 1 |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |
| containerNames | []string | 当你将 `action` 配置为 `container-kill` 时,此配置为必填,用于指定注入故障的目标 container 名 | 无 | 否 | ['prometheus'] | | containerNames | []string | 当你将 `action` 配置为 `container-kill` 时,此配置为必填,用于指定注入故障的目标 container 名 | 无 | 否 | ['prometheus'] |
| gracePeriod | int64 | 当你将 `action` 配置为 `pod-kill` 时,需要填写此项,用于指定删除 Pod 之前的持续时间 | 0 | 否 | 0 | | gracePeriod | int64 | 当你将 `action` 配置为 `pod-kill` 时,需要填写此项,用于指定删除 Pod 之前的持续时间 | 0 | 否 | 0 |

View File

@ -53,10 +53,10 @@ Chaos Mesh 提供的 TimeChaos 实验类型可用于模拟时间偏移的场景
以上 YAML 配置文件中的字段说明如下: 以上 YAML 配置文件中的字段说明如下:
| 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 | | 参数 | 类型 | 说明 | 默认值 | 是否必填 | 示例 |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------- | -------------------------------------- | | --- | --- | --- | --- | --- | --- |
| timeOffset | string | 指定时间偏移的长度 | 无 | 是 | `-5m` | | timeOffset | string | 指定时间偏移的长度 | 无 | 是 | `-5m` |
| clockIds | []string | 指定时间偏移作用的时钟,详见 [`clock_gettime` 文档](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) | `["CLOCK_REALTIME"]` | 否 | `["CLOCK_REALTIME","CLOCK_MONOTONIC"]` | | clockIds | []string | 指定时间偏移作用的时钟,详见 [`clock_gettime` 文档](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) | `["CLOCK_REALTIME"]` | 否 | `["CLOCK_REALTIME","CLOCK_MONOTONIC"]` |
| mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` | | mode | string | 指定实验的运行方式,可选择的方式包括:`one`(表示随机选出一个符合条件的 Pod、`all`(表示选出所有符合条件的 Pod、`fixed`(表示选出指定数量且符合条件的 Pod、`fixed-percent`(表示选出占符合条件的 Pod 中指定百分比的 Pod、`random-max-percent`(表示选出占符合条件的 Pod 中不超过指定百分比的 Pod | 无 | 是 | `one` |
| value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 2 | | value | string | 取决于 `mode` 的配置,为 `mode` 提供对应的参数。例如,当你将 `mode` 配置为 `fixed-percent` 时,`value` 用于指定 Pod 的百分比 | 无 | 否 | 1 |
| containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` | | containerNames | []string | 指定注入的容器名称 | 无 | 否 | `["nginx"]` |
| selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | | | selector | struct | 指定注入故障的目标 Pod详情请参考[定义实验范围](./define-chaos-experiment-scope.md) | 无 | 是 | |

View File

@ -154,10 +154,10 @@ Before you create an experiment using Chaos Dashboard, make sure the following r
The following table shows the fields in the YAML configuration file. The following table shows the fields in the YAML configuration file.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. Only ec2-stop, ec2-restore, and detain-volume are supported. | ec2-stop | Yes | ec2-stop | | action | string | Indicates the specific type of faults. Only ec2-stop, ec2-restore, and detain-volume are supported. | ec2-stop | Yes | ec2-stop |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| secretName | string | Specifies the name of the Kubernetes Secret that stores the AWS authentication information. | None | No | cloud-key-secret | | secretName | string | Specifies the name of the Kubernetes Secret that stores the AWS authentication information. | None | No | cloud-key-secret |
| awsRegion | string | Specifies the AWS region. | None | Yes | us-east-2 | | awsRegion | string | Specifies the AWS region. | None | Yes | us-east-2 |
| ec2Instance | string | Specifies the ID of the EC2 instance. | None | Yes | your-ec2-instance-id | | ec2Instance | string | Specifies the ID of the EC2 instance. | None | Yes | your-ec2-instance-id |

View File

@ -85,11 +85,11 @@ Make sure that the Pod status is `Running`.
### Configuration Description ### Configuration Description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| :-------- | :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :------- | :------------------------------------------- | | :-- | :-- | :-- | :-- | :-- | :-- |
| action | string | Defines the behavior of DNS fault. The value can be `random` or `error`. When the value is `random`, DNS service will return a random IP address; when the value is `error`, DNS service will return an error. | None | Yes | `random` or `error` | | action | string | Defines the behavior of DNS fault. The value can be `random` or `error`. When the value is `random`, DNS service will return a random IP address; when the value is `error`, DNS service will return an error. | None | Yes | `random` or `error` |
| patterns | String array | Selects a domain template that matches faults. Placeholder `?` and wildcard are supported. `*` | [] | No | `google.com`, `chaos-mesh.org`, `github.com` | | patterns | String array | Selects a domain template that matches faults. Placeholder `?` and wildcard are supported. `*` | [] | No | `google.com`, `chaos-mesh.org`, `github.com` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | |
:::note :::note

View File

@ -161,10 +161,10 @@ Before you create an experiment using Chaos Dashboard, make sure the following r
The following table shows the fields in the YAML configuration file. The following table shows the fields in the YAML configuration file.
| Parameter | Type | Descpription | Default value | Required | Example | | Parameter | Type | Descpription | Default value | Required | Example |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. The available fault types include node-stop, node-reset, and disk-loss. | node-stop | Yes | node-stop | | action | string | Indicates the specific type of faults. The available fault types include node-stop, node-reset, and disk-loss. | node-stop | Yes | node-stop |
| mode | string | Indicates the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` | | mode | string | Indicates the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of pods. | None | No | 1 |
| secretName | string | Indicates the name of the Kubernetes secret that stores the GCP authentication information. | None | No | cloud-key-secret | | secretName | string | Indicates the name of the Kubernetes secret that stores the GCP authentication information. | None | No | cloud-key-secret |
| project | string | Indicates the name of GCP project. | None | Yes | your-project | | project | string | Indicates the name of GCP project. | None | Yes | your-project |
| zone | string | Indicates the region of GCP instance. | None | Yes | us-central1-a | | zone | string | Indicates the region of GCP instance. | None | Yes | us-central1-a |

View File

@ -58,12 +58,12 @@ You can create experiments using either Chaos Dashboard or the YAML configuratio
The fields in the YAML configuration file are described in the following table: The fields in the YAML configuration file are described in the following table:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ----------- | | --- | --- | --- | --- | --- | --- |
| duration | string | Specifies the duration of the experiment. | None | Yes | `30s` | | duration | string | Specifies the duration of the experiment. | None | Yes | `30s` |
| stressors | [Stressors](#stressors) | Specifies the stress of CPU or memory | None | No | | | stressors | [Stressors](#stressors) | Specifies the stress of CPU or memory | None | No | |
| stressngStressors | string | Specifies the stres-ng parameter to reach richer stress injection | None | No | `--clone 2` | | stressngStressors | string | Specifies the stres-ng parameter to reach richer stress injection | None | No | `--clone 2` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides a parameter for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | `2` | | value | string | Provides a parameter for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the Scope of Chaos Experiments](./define-chaos-experiment-scope.md). | None | Yes | |
@ -84,6 +84,6 @@ The fields in the YAML configuration file are described in the following table:
##### CPUStressor ##### CPUStressor
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ---- | -------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| workers | int | Specifies the number of threads that apply memory stress | | Yes | `1` | | workers | int | Specifies the number of threads that apply memory stress | | Yes | `1` |
| load | int | Specifies the percentage of CPU occupied0 means sleep and no load; 100 means full load | | No | `50` | | load | int | Specifies the percentage of CPU occupied0 means sleep and no load; 100 means full load | | No | `50` |

View File

@ -111,9 +111,9 @@ Currently, Chaos Mesh only supports using YAML configuration files to create HTT
Common fields are meaningful when the `target` of fault injection is `Request` or `Response`. Common fields are meaningful when the `target` of fault injection is `Request` or `Response`.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random pod), `all` (selecting all eligible pods), `fixed` (selecting a specified number of eligible pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible pods). | | yes | one | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random pod), `all` (selecting all eligible pods), `fixed` (selecting a specified number of eligible pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible pods). | | yes | `one` |
| value | string | Provides parameters for the `mode` configuration depending on the value of `mode`. | | no | 2 | | value | string | Provides parameters for the `mode` configuration depending on the value of `mode`. | | no | 1 |
| target | string | Specifies whether the target of fault injuection is `Request` or `Response`. The [`target`-related fields](#Description-for-`target`-related-fields) should be configured at the same time. | | yes | Request | | target | string | Specifies whether the target of fault injuection is `Request` or `Response`. The [`target`-related fields](#Description-for-`target`-related-fields) should be configured at the same time. | | yes | Request |
| port | int32 | The TCP port that the target service listens on. | | yes | 80 | | port | int32 | The TCP port that the target service listens on. | | yes | 80 |
| method | string | The HTTP method of the target request method. | Takes effect for all methods by default. | no | GET | | method | string | The HTTP method of the target request method. | Takes effect for all methods by default. | no | GET |
@ -136,7 +136,7 @@ Common fields are meaningful when the `target` of fault injection is `Request` o
The `Request` field is a meaningful when the `target` set to `Request` during the fault injection. The `Request` field is a meaningful when the `target` set to `Request` during the fault injection.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------------- | ----------------- | ------------------------------------------------------------------- | ------------- | -------- | ------------ | | --- | --- | --- | --- | --- | --- |
| replace.path | string | Specifies the URI path used to replace content. | | no | /api/v2/ | | replace.path | string | Specifies the URI path used to replace content. | | no | /api/v2/ |
| replace.method | string | Specifies the replaced content of the HTTP request method. | | no | DELETE | | replace.method | string | Specifies the replaced content of the HTTP request method. | | no | DELETE |
| replace.queries | map[string]string | Specifies the replaced key pair of the URI query. | | no | foo: bar | | replace.queries | map[string]string | Specifies the replaced key pair of the URI query. | | no | foo: bar |
@ -147,7 +147,7 @@ The `Request` field is a meaningful when the `target` set to `Request` during th
The `Response` is a meaningful when the `target` set to `Response` during the fault injection. The `Response` is a meaningful when the `target` set to `Response` during the fault injection.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | ----------------- | ----------------------------------------------------------- | --------------------------------------------- | -------- | ------------------------------ | | --- | --- | --- | --- | --- | --- |
| code | int32 | Specifies the status code responded by `target`. | Takes effect for all status codes by default. | no | 200 | | code | int32 | Specifies the status code responded by `target`. | Takes effect for all status codes by default. | no | 200 |
| response_heads | map[string]string | Matches request headers to `target`. | Takes effect for all responses by default. | no | Content-Type: application/json | | response_heads | map[string]string | Matches request headers to `target`. | Takes effect for all responses by default. | no | Content-Type: application/json |
| replace.code | int32 | Specifies the replaced content of the response status code. | | no | 404 | | replace.code | int32 | Specifies the replaced content of the response status code. | | no | 404 |

View File

@ -175,11 +175,11 @@ For specific features, refer to [Create experiments using the YAML files](#creat
#### General fields #### General fields
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------- | ------------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific type of faults. Only latency, fault, attrOverride, and mistake are supported. | | Yes | latency | | action | string | Indicates the specific type of faults. Only latency, fault, attrOverride, and mistake are supported. | | Yes | latency |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | 1 | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a Pod at random), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of the eligible Pods), and `random-max-percent` (selecting the maximum percentage of the eligible Pods). | None | Yes | `one` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | | No | 1 |
| volumePath | string | The mount point of volume in the target container. Must be the root directory of the mount. | | Yes | /var/run/etcd | | volumePath | string | The mount point of volume in the target container. Must be the root directory of the mount. | | Yes | /var/run/etcd |
| path | string | The valid range of fault injections, either a wildcard or a single file. | Valid for all files by default | No | /var/run/etcd/\*_/_ | | path | string | The valid range of fault injections, either a wildcard or a single file. | Valid for all files by default | No | /var/run/etcd/\*_/_ |
| methods | string[] | Type of the file system call that requires injecting fault. For more information about supported types, refer to [Appendix A](#appendix-a: methods-type). | All Types | No | READ | | methods | string[] | Type of the file system call that requires injecting fault. For more information about supported types, refer to [Appendix A](#appendix-a: methods-type). | All Types | No | READ |
@ -214,7 +214,7 @@ The following are specific information about fields corresponding to action:
AttrOverrideSpec is defined as follows: AttrOverrideSpec is defined as follows:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | -------- | -------------------------------------------------------------------------------------- | ------------- | -------- | ----------------- | | --- | --- | --- | --- | --- | --- |
| ino | int | ino number | | No | | | ino | int | ino number | | No | |
| size | int | File size | | No | | | size | int | File size | | No | |
| blocks | int | Number of blocks that the file uses | | No | | | blocks | int | Number of blocks that the file uses | | No | |
@ -246,7 +246,7 @@ The following are specific information about fields corresponding to action:
MistakeSpec is defined as follows: MistakeSpec is defined as follows:
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | ------ | -------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| filling | string | The wrong data to be filled. Only zero (fill 0) or random (fill random bytes) are supported. | | Yes | | | filling | string | The wrong data to be filled. Only zero (fill 0) or random (fill random bytes) are supported. | | Yes | |
| maxOccurrences | int | Maximum number of errors in each operation. | | Yes | 1 | | maxOccurrences | int | Maximum number of errors in each operation. | | Yes | 1 |
| maxLength | int | Maximum length of each error (in bytes). | | Yes | 1 | | maxLength | int | Maximum length of each error (in bytes). | | Yes | 1 |

View File

@ -158,10 +158,10 @@ hello chaos mesh!
## Field description ## Field description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific fault type. The available fault types include return, script, cfl, oom, ccf, tce, tcf, cpf, tde, and tpf. | None | Yes | return | | action | string | Indicates the specific fault type. The available fault types include return, script, cfl, oom, ccf, tce, tcf, cpf, tde, and tpf. | None | Yes | return |
| mode | string | Indicates how to select Pod. The supported modes include one, all, fixed, fixed-percent, and random-max-percent. | None | Yes | 1 | | mode | string | Indicates how to select Pod. The supported modes include one, all, fixed, fixed-percent, and random-max-percent. | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`. | None | No | 1 |
| target | string | Indicates the parameter passed to `chaosblade-exec-jvm`, representing JVMChaos targets, supporting servlet, psql, jvm, jedis, http, dubbo, rocketmq, tars, mysql, ruid, redisson, rabbitmq, monodb. | None | Yes | jvm | | target | string | Indicates the parameter passed to `chaosblade-exec-jvm`, representing JVMChaos targets, supporting servlet, psql, jvm, jedis, http, dubbo, rocketmq, tars, mysql, ruid, redisson, rabbitmq, monodb. | None | Yes | jvm |
| flags | map[string]string | Indicates parameters passed to `chaosblade-exec-jvm` and represents the flags of action. | None | No | | | flags | map[string]string | Indicates parameters passed to `chaosblade-exec-jvm` and represents the flags of action. | None | No | |
| matchers | map[string]string | Indicates parameters passed to `chaosblade-execu-jvm` and represents the matching of injection points. | None | No | | | matchers | map[string]string | Indicates parameters passed to `chaosblade-execu-jvm` and represents the matching of injection points. | None | No | |

View File

@ -139,12 +139,12 @@ Before creating NetworkChaos experiments, ensure the following:
## Field description ## Field description
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | --------- | | --- | --- | --- | --- | --- | --- |
| action | string | Indicates the specific fault type. Available types include: `netem`, `delay` (network delay), `loss` (packet loss), `duplicate` (packet duplicating), `corrupt` (packet corrupt), `partition` (network partition), and `bandwidth` (network bandwidth limit).After you specify `action` field, refer to [Description for `action`-related fields](#description-for-action-related-fields) for other necessary field configuration. | None | Yes | Partition | | action | string | Indicates the specific fault type. Available types include: `netem`, `delay` (network delay), `loss` (packet loss), `duplicate` (packet duplicating), `corrupt` (packet corrupt), `partition` (network partition), and `bandwidth` (network bandwidth limit).After you specify `action` field, refer to [Description for `action`-related fields](#description-for-action-related-fields) for other necessary field configuration. | None | Yes | Partition |
| target | Selector | Used in combination with direction, making Chaos only effective for some packets. | None | No | | | target | Selector | Used in combination with direction, making Chaos only effective for some packets. | None | No | |
| direction | enum | Indicates the direction of `target` packets. Available vaules include `from` (the packets from `target`), `to` (the packets to `target`), and `both` ( the packets from or to `target`). This parameter makes Chaos only take effect for a specific direction of packets. | to | No | both | | direction | enum | Indicates the direction of `target` packets. Available vaules include `from` (the packets from `target`), `to` (the packets to `target`), and `both` ( the packets from or to `target`). This parameter makes Chaos only take effect for a specific direction of packets. | to | No | both |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides a parameter for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides a parameter for the `mode` configuration, depending on `mode`. For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | ["nginx"] | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | ["nginx"] |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
@ -160,7 +160,7 @@ For the Net Emulation and Bandwidth fault types, you can further configure the `
Setting `action` to `delay` means simulating network delay fault. You can also configure the following parameters. Setting `action` to `delay` means simulating network delay fault. You can also configure the following parameters.
| Parameter | Type | Description | Required | Required | Example | | Parameter | Type | Description | Required | Required | Example |
| ----------- | ----------------- | --------------------------------------------------------------------------- | -------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| latency | string | Indicates the network latency | No | No | 2ms | | latency | string | Indicates the network latency | No | No | 2ms |
| correlation | string | Indicates the correlation between the current latency and the previous one. | No | No | 0.5 | | correlation | string | Indicates the correlation between the current latency and the previous one. | No | No | 0.5 |
| jitter | string | Indicates the range of the network latency | No | No | 1ms | | jitter | string | Indicates the range of the network latency | No | No | 1ms |
@ -189,7 +189,7 @@ The computational model for `correlation` is as follows:
Setting `action` to `reorder` means simulating network packet reordering fault. You can also configure the following parameters. Setting `action` to `reorder` means simulating network packet reordering fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| reorder | string | Indicates the probability to reorder | 0 | No | 0.5 | | reorder | string | Indicates the probability to reorder | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between this time's length of delay time and the previous time's length of delay time | 0 | No | 0.5 | | correlation | string | Indicates the correlation between this time's length of delay time and the previous time's length of delay time | 0 | No | 0.5 |
| gap | int | Indicates the gap before and after packet reordering | 0 | No | 5 | | gap | int | Indicates the gap before and after packet reordering | 0 | No | 5 |
@ -199,7 +199,7 @@ Setting `action` to `reorder` means simulating network packet reordering fault.
Setting `action` to `loss` means simulating packet loss fault. You can also configure the following parameters. Setting `action` to `loss` means simulating packet loss fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------ | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| loss | string | Indicates the probability of packet loss | 0 | No | 0.5 | | loss | string | Indicates the probability of packet loss | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet loss and the previous time's packet loss | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet loss and the previous time's packet loss | 0 | No | 0.5 |
@ -208,7 +208,7 @@ Setting `action` to `loss` means simulating packet loss fault. You can also conf
Set `action` to `duplicate`, meaning simulating package duplication. At this point, you can also set the following parameters. Set `action` to `duplicate`, meaning simulating package duplication. At this point, you can also set the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| duplicate | string | Indicates the probability of packet duplicating | 0 | No | 0.5 | | duplicate | string | Indicates the probability of packet duplicating | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating | 0 | No | 0.5 |
@ -217,7 +217,7 @@ Set `action` to `duplicate`, meaning simulating package duplication. At this poi
Setting `action` to `corrupt` means simulating package corruption fault. You can also configure the following parameters. Setting `action` to `corrupt` means simulating package corruption fault. You can also configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------ | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| corrupt | string | Indicates the probability of packet corruption | 0 | No | 0.5 | | corrupt | string | Indicates the probability of packet corruption | 0 | No | 0.5 |
| correlation | string | Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption | 0 | No | 0.5 | | correlation | string | Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption | 0 | No | 0.5 |
@ -228,7 +228,7 @@ For occasional events such as `reorder`, `loss`, `duplicate`, and `corrupt`, the
Setting `action` to `bandwidth` means simulating bandwidth limit fault. You also need to configure the following parameters. Setting `action` to `bandwidth` means simulating bandwidth limit fault. You also need to configure the following parameters.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| --------- | ------ | ---------------------------------------------------------------------- | ------------- | -------- | ------- | | --- | --- | --- | --- | --- | --- |
| rate | string | Indicates the rate of bandwidth limit | | Yes | 1mbps | | rate | string | Indicates the rate of bandwidth limit | | Yes | 1mbps |
| limit | string | Indicates the number of bytes waiting in queue | | Yes | 1 | | limit | string | Indicates the number of bytes waiting in queue | | Yes | 1 |
| buffer | uint32 | Indicates the maximum number of bytes that can be sent instantaneously | | Yes | 1 | | buffer | uint32 | Indicates the maximum number of bytes that can be sent instantaneously | | Yes | 1 |

View File

@ -133,10 +133,10 @@ Before create experiments using Chaos Dashboard, ensure the following:
The following table describes the fields in the YAML configuration file. The following table describes the fields in the YAML configuration file.
| Parameter | Type | Description | Default value | Required | Example | | Parameter | Type | Description | Default value | Required | Example |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | -------------- | | --- | --- | --- | --- | --- | --- |
| action | string | Specifies the fault type to inject. The supported types include `pod-failure`, `pod-kill`, and `container-kill`. | None | Yes | `pod-kill` | | action | string | Specifies the fault type to inject. The supported types include `pod-failure`, `pod-kill`, and `container-kill`. | None | Yes | `pod-kill` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |
| containerNames | []string | When you configure `action` to `container-killed`, this configuration is mandatory to specify the target container name for injecting faults. | None | No | ['prometheus'] | | containerNames | []string | When you configure `action` to `container-killed`, this configuration is mandatory to specify the target container name for injecting faults. | None | No | ['prometheus'] |
| gracePeriod | int64 | When you configure `action` to `pod-kill`, this configuration is mandatory to specify the duration before deleting Pod. | 0 | No | 0 | | gracePeriod | int64 | When you configure `action` to `pod-kill`, this configuration is mandatory to specify the duration before deleting Pod. | 0 | No | 0 |

View File

@ -53,10 +53,10 @@ You can create experiments in Chaos Dashboard or using the YAML configuration fi
The fields in the YAML configuration file are described in the following table: The fields in the YAML configuration file are described in the following table:
| Parameter | Type | Note | Default value | Required | Example | | Parameter | Type | Note | Default value | Required | Example |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------- | --------------------------------------- | | --- | --- | --- | --- | --- | --- |
| timeOffset | string | Specifies the length of time offset. | None | Yes | `-5m` | | timeOffset | string | Specifies the length of time offset. | None | Yes | `-5m` |
| clockIds | []string | Specifies the ID of clock that will be offset. See the [<clock>clock_gettime</clock> documentation](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) for details. | `["CLOCK_REALTIME"]` | No | `["CLOCK_REALTIME", "CLOCK_MONOTONIC"]` | | clockIds | []string | Specifies the ID of clock that will be offset. See the [<clock>clock_gettime</clock> documentation](https://man7.org/linux/man-pages/man2/clock_gettime.2.html) for details. | `["CLOCK_REALTIME"]` | No | `["CLOCK_REALTIME", "CLOCK_MONOTONIC"]` |
| mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `1` | | mode | string | Specifies the mode of the experiment. The mode options include `one` (selecting a random Pod), `all` (selecting all eligible Pods), `fixed` (selecting a specified number of eligible Pods), `fixed-percent` (selecting a specified percentage of Pods from the eligible Pods), and `random-max-percent` (selecting the maximum percentage of Pods from the eligible Pods). | None | Yes | `one` |
| value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 2 | | value | string | Provides parameters for the `mode` configuration, depending on `mode`.For example, when `mode` is set to `fixed-percent`, `value` specifies the percentage of Pods. | None | No | 1 |
| containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` | | containerNames | []string | Specifies the name of the container into which the fault is injected. | None | No | `["nginx"]` |
| selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | | | selector | struct | Specifies the target Pod. For details, refer to [Define the experiment scope](./define-chaos-experiment-scope.md). | None | Yes | |