* feat(pod-disruption): support parallel pod deletion
Introduce 'kill_mode' field to pod disruption scenario to support parallel
deletion of pods. By default 'kill_mode' is 'sequential' preserving
existing behavior. When set to 'parallel', it concurrently deletes pods
using threading and queue, enabling effective testing of disruption scenarios
like etcd quorum loss where simultaneous disruption is necessary.
Resolves: #1516
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>
* fix(pod-disruption): validate kill_mode and address PR feedback
- Validate 'kill_mode' at parse time: fallback to 'sequential' and log a
warning if an unknown string is provided, preventing silent failures.
- Update test_parallel_mode_calls_delete_concurrently to use a
threading.Barrier to definitively prove concurrent thread execution.
- Revert 'scenarios/openshift/etcd.yml' to default non-destructive behavior
and extract parallel quorum loss example into a new explicitly named file
'etcd_quorum_loss.yml'.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>
* refactor(pod-disruption): optimize imports and cap threads
- Reorganize imports in pod_disruption_scenario_plugin.py to comply with
standard PEP-8 grouping (stdlib, third-party, local).
- Replace unbounded OS thread spawning in _delete_pods_parallel with
concurrent.futures.ThreadPoolExecutor. Capped max_workers to 10 to
prevent excessive concurrent API calls that could overload the Kubernetes
API server under aggressive scenario configurations.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>
* refactor(pod-disruption): align execution config with network_chaos_ng
- Renamed config field from 'kill_mode' to 'execution' for consistency
with the network_chaos_ng plugin.
- Changed valid values from 'sequential|parallel' to 'serial|parallel'.
- Replaced fallback warning with strict validation, raising ValueError on
invalid execution values, aligning with the strict validation pattern
used elsewhere in the codebase.
- Updated relevant tests and scenario YAML templates.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>
* fix(pod-disruption): remove unused logging import in models.py
Following the switch from a warning log to raising a ValueError for
invalid execution types, the logging import was no longer used.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>
---------
Signed-off-by: swagatobauri <swagato731123@gmail.com>
Co-authored-by: Darshan Jain <darjain@redhat.com>
Functional & Unit Tests / Functional & Unit Tests (push) Failing after 10m38s
Functional & Unit Tests / Generate Coverage Badge (push) Has been skipped
* Adding node_label_selector for pod scenarios
Signed-off-by: Sahil Shah <sahshah@redhat.com>
* using kubernetes function, adding node_name and removing extra config
Signed-off-by: Sahil Shah <sahshah@redhat.com>
* adding CI test for custom pod scenario
Signed-off-by: Sahil Shah <sahshah@redhat.com>
* fixing comment
* adding test to workflow
* adding list parsing logic for krkn hub
* parsing not needed, as input is always []
---------
Signed-off-by: Sahil Shah <sahshah@redhat.com>
Functional & Unit Tests / Functional & Unit Tests (push) Failing after 9m9s
Functional & Unit Tests / Generate Coverage Badge (push) Has been skipped
* Disable SSL verification for IBM node scenarios and fix node reboot scenario
Signed-off-by: Sahil Shah <sahshah@redhat.com>
* adding disable ssl as a scenario parameter for ibmcloud
Signed-off-by: Sahil Shah <sahshah@redhat.com>
---------
Signed-off-by: Sahil Shah <sahshah@redhat.com>
Functional & Unit Tests / Functional & Unit Tests (push) Has been cancelled
Functional & Unit Tests / Generate Coverage Badge (push) Has been cancelled
- Implemented methods for detaching and attaching disks to baremetal nodes.
- Added a new scenario `node_disk_detach_attach_scenario` to manage disk operations.
- Updated the YAML configuration to include the new scenario with disk details.
Signed-off-by: Yogananth Subramanian <ysubrama@redhat.com>
* Add support for user-provided default network ACL
Signed-off-by: henrick <self@thehenrick.com>
* Add logs to notify user when their provided acl is used
Signed-off-by: henrick <self@thehenrick.com>
* Update docs to include optional default_acl_id parameter in zone_outage
Signed-off-by: henrick <self@thehenrick.com>
---------
Signed-off-by: henrick <self@thehenrick.com>
Co-authored-by: henrick <self@thehenrick.com>
This option is enabled only for node_stop_start scenario where
user will want to stop the node for certain duration to understand
the impact before starting the node back on. This commit also bumps
the timeout for the scenario to 360 seconds from 120 seconds to make
sure there's enough time for the node to get to Ready state from the
Kubernetes side after the node is started on the infra side.
Signed-off-by: Naga Ravi Chaitanya Elluri <nelluri@redhat.com>
The scenario introduces network latency, packet loss, and bandwidth restriction in the Pod's network interface. The purpose of this scenario is to observe faults caused by random variations in the network.
Below example config applies ingress traffic shaping to openshift console.
````
- id: pod_ingress_shaping
config:
namespace: openshift-console # Required - Namespace of the pod to which filter need to be applied.
label_selector: 'component=ui' # Applies traffic shaping to access openshift console.
network_params:
latency: 500ms # Add 500ms latency to ingress traffic from the pod.
````
The scenario introduces network latency, packet loss, and bandwidth restriction in the Pod's network interface.
The purpose of this scenario is to observe faults caused by random variations in the network.
Below example config applies egress traffic shaping to openshift console.
````
- id: pod_egress_shaping
config:
namespace: openshift-console # Required - Namespace of the pod to which filter need to be applied.
label_selector: 'component=ui' # Applies traffic shaping to access openshift console.
network_params:
latency: 500ms # Add 500ms latency to egress traffic from the pod.
````
Pod network outage chaos scenario blocks traffic at pod level irrespective of the network policy used.
With the current network policies, it is not possible to explicitly block ports which are enabled
by allowed network policy rule. This chaos scenario addresses this issue by using OVS flow rules
to block ports related to the pod. It supports OpenShiftSDN and OVNKubernetes based networks.
Below example config blocks access to openshift console.
````
- id: pod_network_outage
config:
namespace: openshift-console
direction:
- ingress
ingress_ports:
- 8443
label_selector: 'component=ui'
````
Also renames retry_wait to expected_recovery_time to make it clear that
the Kraken will exit 1 if the container doesn't recover within the expected
time.
Fixes https://github.com/redhat-chaos/krkn/issues/414