Kubernetes
action Network

# set_bandwidth

Simulate bandwith on a Pod network link

Run it now
View details

Type | action
Module | chaosk8s.chaosmesh.network.actions
Name | set_bandwidth
Return | mapping

Usage

JSON

    {
      "name": "set-bandwidth",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosk8s.chaosmesh.network.actions",
        "func": "set_bandwidth",
        "arguments": {
          "name": "",
          "rate": "",
          "limit": 0,
          "buffer": 0
        }
      }
    }

YAML

    name: set-bandwidth
    provider:
      arguments:
        buffer: 0
        limit: 0
        name: ''
        rate: ''
      func: set_bandwidth
      module: chaosk8s.chaosmesh.network.actions
      type: python
    type: action

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
name | string |  | Yes | Name | A unique name to identify this particular fault
direction | string | to | No | Direction | Which direction to apply the bandwidth: `from`, `to` or `both`
rate | string |  | Yes | Rate | Packet rate, such as `1mbps`
limit | integer |  | Yes | Limit | Number of bytes waiting in the queue
buffer | integer |  | Yes | Limit | Amount of bytes that can be sent simultaenously
ns | string | default | No | Namespace | Namespace where to apply the fault
namespaces_selectors | string |  | No | Namespaces Selectors | Comma-separated list of namespaces to scope the fault to
label_selectors | string |  | No | Label Selectors | Comma-separated list of key=value pairs to scope the fault to
annotations_selectors | string |  | No | Annotation Selectors | Comma-separated list of key=value pairs to scope the fault to
mode | string | one | No | Mode | Mode of fault injection: `one`, `all`, `fixed`, `fixed-percent`, `random-max-percent`
mode_value | string |  | No | Mode Value | Value depending on the mode above
external_targets | string |  | No | External Targets | IPv4 or domain targetted by the fault when direction is set to “to”
target_namespaces_selectors | string |  | No | Target Namespaces Selectors | Comma-separated list of namespaces to scope the fault to the right target pod. Only works when direction is set to `both` or `from`
target_label_selectors | string |  | No | Target Label Selectors | Comma-separated list of key=value pairs to scope the network fault to the right target pod. Only works when direction is set to `both` or `from`
target_annotations_selectors | string |  | No | Target Annotation Selectors | Comma-separated list of key=value pairs to scope the fault to the right target pod. Only works when direction is set to `both` or `from`
target_mode | string | one | No | Target Mode | Target Mode of fault injection: `one`, `all`, `fixed`, `fixed-percent`, `random-max-percent`
target_mode_value | string |  | No | Target Mode Value | Value depending on the mode above

This action relies on Chaos Mesh to perform the fault. Make sure to install it before hand.

Signature

    def set_bandwidth(name: str,
                      rate: str,
                      limit: int,
                      buffer: int,
                      ns: str = 'default',
                      namespaces_selectors: Optional[str] = None,
                      label_selectors: Optional[str] = None,
                      annotations_selectors: Optional[str] = None,
                      mode: str = 'one',
                      mode_value: Optional[str] = None,
                      direction: str = 'to',
                      peakrate: Optional[int] = None,
                      minburst: Optional[int] = None,
                      external_targets: Union[str, List[str], NoneType] = None,
                      target_mode: Optional[str] = 'one',
                      target_mode_value: Optional[str] = None,
                      target_namespaces_selectors: Union[str, List[str],
                                                         NoneType] = None,
                      target_label_selectors: Union[str, Dict[str, Any],
                                                    NoneType] = None,
                      target_annotations_selectors: Union[str, Dict[str, Any],
                                                          NoneType] = None,
                      secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
        pass

## Related starters

- Kubernetes
  action Network

  ## `corrupt_packets`

  Corrupt packets on a Pod network link
- Kubernetes
  action Network

  ## `deny_all_ingress`

  Deny all ingress to pods
- Kubernetes
  action Network

  ## `remove_allow_dns_access`

  Remove DNS access from pods