Network Chaos API
AbstractNetworkChaosModule abstract module class
All the plugins must implement the AbstractNetworkChaosModule abstract class in order to be instantiated and ran by the Netwok Chaos NG plugin.
This abstract class implements two main abstract methods:
run(self, target: str, kubecli: KrknTelemetryOpenshift, error_queue: queue.Queue = None)is the entrypoint for each Network Chaos module. If the module is configured to be run in parallelerror_queuemust not be Nonetarget: param is the name of the resource (Pod, Node etc.) that will be targeted by the scenariokubecli: theKrknTelemetryOpenshiftneeded by the scenario to access to the krkn-lib methodserror_queue: a queue that will be used by the plugin to push the errors raised during the execution of parallel modules
get_config(self) -> (NetworkChaosScenarioType, BaseNetworkChaosConfig)returns the common subset of settings shared by all the scenariosBaseNetworkChaosConfigand the type of Network Chaos Scenario that is running (Pod Scenario or Node Scenario)
BaseNetworkChaosConfig base module configuration
Is the base class that contains the common parameters shared by all the Network Chaos NG modules.
idis the string name of the Network Chaos NG modulewait_durationif there is more than one network module config in the same config file, the plugin will waitwait_durationseconds before running the following onetest_durationthe duration in seconds of the scenariolabel_selectorthe selector used to target the resourceinstance_countif greater than 0 picksinstance_countelements from the targets selected by the filters randomlyexecutionif more than one target are selected by the selector the scenario can target the resources both inserialorparallel.namespacethe namespace were the scenario workloads will be deployedtaints: List of taints for which tolerations need to created. Example: [“node-role.kubernetes.io/master:NoSchedule”]