github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/cli/kbcli_fault_network_bandwidth.md (about)

     1  ---
     2  title: kbcli fault network bandwidth
     3  ---
     4  
     5  Limit the bandwidth that pods use to communicate with other objects.
     6  
     7  ```
     8  kbcli fault network bandwidth [flags]
     9  ```
    10  
    11  ### Examples
    12  
    13  ```
    14    # Isolate all pods network under the default namespace from the outside world, including the k8s internal network.
    15    kbcli fault network partition
    16    
    17    # The specified pod is isolated from the k8s external network "kubeblocks.io".
    18    kbcli fault network partition mycluster-mysql-1 --external-targets=kubeblocks.io
    19    
    20    # Isolate the network between two pods.
    21    kbcli fault network partition mycluster-mysql-1 --target-label=statefulset.kubernetes.io/pod-name=mycluster-mysql-2
    22    
    23    // Like the partition command, the target can be specified through --target-label or --external-targets. The pod only has obstacles in communicating with this target. If the target is not specified, all communication will be blocked.
    24    # Block all pod communication under the default namespace, resulting in a 50% packet loss rate.
    25    kbcli fault network loss --loss=50
    26    
    27    # Block the specified pod communication, so that the packet loss rate is 50%.
    28    kbcli fault network loss mysql-cluster-mysql-2 --loss=50
    29    
    30    kbcli fault network corrupt --corrupt=50
    31    
    32    # Blocks specified pod communication with a 50% packet corruption rate.
    33    kbcli fault network corrupt mysql-cluster-mysql-2 --corrupt=50
    34    
    35    kbcli fault network duplicate --duplicate=50
    36    
    37    # Block specified pod communication so that the packet repetition rate is 50%.
    38    kbcli fault network duplicate mysql-cluster-mysql-2 --duplicate=50
    39    
    40    kbcli fault network delay --latency=10s
    41    
    42    # Block the communication of the specified pod, causing its network delay for 10s.
    43    kbcli fault network delay mysql-cluster-mysql-2 --latency=10s
    44    
    45    # Limit the communication bandwidth between mysql-cluster-mysql-2 and the outside.
    46    kbcli fault network bandwidth mysql-cluster-mysql-2 --rate=1kbps --duration=1m
    47  ```
    48  
    49  ### Options
    50  
    51  ```
    52        --annotation stringToString      Select the pod to inject the fault according to Annotation. (default [])
    53        --buffer uint32                  the maximum number of bytes that can be sent instantaneously. (default 1)
    54        --direction string               You can select "to"" or "from"" or "both"". (default "to")
    55        --dry-run string[="unchanged"]   Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none")
    56        --duration string                Supported formats of the duration are: ms / s / m / h. (default "10s")
    57    -e, --external-target stringArray    a network target outside of Kubernetes, which can be an IPv4 address or a domain name,
    58                                         	 such as "www.baidu.com". Only works with direction: to.
    59    -h, --help                           help for bandwidth
    60        --label stringToString           label for pod, such as '"app.kubernetes.io/component=mysql, statefulset.kubernetes.io/pod-name=mycluster-mysql-0. (default [])
    61        --limit uint32                   the number of bytes waiting in the queue. (default 1)
    62        --minburst uint32                the size of the peakrate bucket.
    63        --mode string                    You can select "one", "all", "fixed", "fixed-percent", "random-max-percent", Specify the experimental mode, that is, which Pods to experiment with. (default "all")
    64        --node stringArray               Inject faults into pods in the specified node.
    65        --node-label stringToString      label for node, such as '"kubernetes.io/arch=arm64,kubernetes.io/hostname=minikube-m03,kubernetes.io/os=linux. (default [])
    66        --ns-fault stringArray           Specifies the namespace into which you want to inject faults. (default [default])
    67    -o, --output format                  Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
    68        --peakrate uint                  the maximum consumption rate of the bucket.
    69        --phase stringArray              Specify the pod that injects the fault by the state of the pod.
    70        --rate string                    the rate at which the bandwidth is limited. For example : 10 bps/kbps/mbps/gbps.
    71        --target-label stringToString    label for pod, such as '"app.kubernetes.io/component=mysql, statefulset.kubernetes.io/pod-name=mycluster-mysql-0"' (default [])
    72        --target-mode string             You can select "one", "all", "fixed", "fixed-percent", "random-max-percent", Specify the experimental mode, that is, which Pods to experiment with.
    73        --target-ns-fault stringArray    Specifies the namespace into which you want to inject faults.
    74        --target-value string            If you choose mode=fixed or fixed-percent or random-max-percent, you can enter a value to specify the number or percentage of pods you want to inject.
    75        --value string                   If you choose mode=fixed or fixed-percent or random-max-percent, you can enter a value to specify the number or percentage of pods you want to inject.
    76  ```
    77  
    78  ### Options inherited from parent commands
    79  
    80  ```
    81        --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
    82        --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
    83        --as-uid string                  UID to impersonate for the operation.
    84        --cache-dir string               Default cache directory (default "$HOME/.kube/cache")
    85        --certificate-authority string   Path to a cert file for the certificate authority
    86        --client-certificate string      Path to a client certificate file for TLS
    87        --client-key string              Path to a client key file for TLS
    88        --cluster string                 The name of the kubeconfig cluster to use
    89        --context string                 The name of the kubeconfig context to use
    90        --disable-compression            If true, opt-out of response compression for all requests to the server
    91        --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
    92        --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
    93        --match-server-version           Require server version to match client version
    94    -n, --namespace string               If present, the namespace scope for this CLI request
    95        --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
    96    -s, --server string                  The address and port of the Kubernetes API server
    97        --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
    98        --token string                   Bearer token for authentication to the API server
    99        --user string                    The name of the kubeconfig user to use
   100  ```
   101  
   102  ### SEE ALSO
   103  
   104  * [kbcli fault network](kbcli_fault_network.md)	 - Network chaos.
   105  
   106  #### Go Back to [CLI Overview](cli.md) Homepage.
   107