Skip to content

815_krknPR_about_disk_failure_simulation #164

Open
10sharmashivam wants to merge 1 commit intokrkn-chaos:mainfrom
10sharmashivam:815_krknPR_disk_failure_scenerio
Open

815_krknPR_about_disk_failure_simulation #164
10sharmashivam wants to merge 1 commit intokrkn-chaos:mainfrom
10sharmashivam:815_krknPR_disk_failure_scenerio

Conversation

@10sharmashivam
Copy link
Copy Markdown

Description

This PR adds disk failure simulation functionality to krkn-lib, which will be used by the main krkn repository for disk failure chaos scenarios. The implementation uses Kubernetes-native approaches instead of direct oc debug commands.

Context

This PR addresses the following comment from the main krkn repository: PR

"We try to keep krkn as Kubernetes-based as possible. Can you try using this function in krkn-lib instead of oc debug to be sure this functionality can work on all cluster types?"

The original implementation used OpenShift-specific oc debug commands, which limited the functionality to OpenShift clusters only. This PR moves the functionality to krkn-lib and implements it using pure Kubernetes-native approaches.

Why a new PR in krkn-lib?

  1. Architectural Decision: krkn-lib is designed to contain shared functionality that works across different Kubernetes distributions. Moving the disk failure simulation here follows this architectural pattern.

  2. Distribution Agnostic: The current implementation in krkn uses OpenShift-specific commands (oc debug). Moving this to krkn-lib and using Kubernetes-native approaches makes it work across all Kubernetes distributions.

  3. Code Reusability: This functionality can be reused by other components or projects that use krkn-lib.

Changes

  • Added simulate_disk_failure method to KrknKubernetes class
  • Replaced OpenShift-specific oc debug commands with Kubernetes-native approaches:
    • Uses privileged pods for node operations
    • Uses sysfs for disk operations
    • Uses standard Kubernetes volume mounts
  • Includes proper validation and error handling
  • Follows Kubernetes best practices for pod management
  • Maintains security with read-only mounts and proper cleanup

Related Issues and PR

PR 815
Issues 1 & 2

Add simulate_disk_failure method to KrknKubernetes class to support
disk failure chaos scenarios. This implementation uses Kubernetes-native
approaches instead of direct oc debug commands, making it more portable
across different Kubernetes distributions.

Signed-off-by: 10sharmashivam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant