Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a k6-loadgen chaos fault #687

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

namkyu1999
Copy link
Member

@namkyu1999 namkyu1999 commented Feb 10, 2024

What this PR does / why we need it:

I have implemented the k6-loadgen chaos fault in this PR based on the proposal.

reference: locust-loadgen

Which issue this PR fixes : fixes #4309

Special notes for your reviewer: @uditgaurav

Checklist:

  • Fixes #
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests
  • E2E run Required for the changes

namkyu1999 added 2 commits February 8, 2024 22:57
Signed-off-by: namkyu1999 <[email protected]>
Signed-off-by: namkyu1999 <[email protected]>
chaoslib/litmus/k6-loadgen/lib/k6-loadgen.go Outdated Show resolved Hide resolved
pkg/load/k6-loadgen/types/types.go Outdated Show resolved Hide resolved
pkg/types/types.go Show resolved Hide resolved
Comment on lines 130 to 132
HostPath: &corev1.HostPathVolumeSource{
Path: experimentsDetails.ScriptPath,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an end user, who is executing the fault, doesn't have access to the host file system, they won't be able to create the script there and thus execute the fault. Therefore, we should use a ConfigMap to store the script and mount it here. The name of the ConfigMap can be an experiment input (we can have a default name).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this implement so that the script file is mounted in the helper pod using a secret name while taking the name of the secret as an experiment ENV input of go-runner.

Signed-off-by: namkyu1999 <[email protected]>
Signed-off-by: namkyu1999 <[email protected]>
return common.HelperFailedError(err, appLabel, experimentsDetails.ChaosNamespace, true)
}

//Deleting all the helper pod for container-kill chaos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Deleting all the helper pod for container-kill chaos
//Deleting all the helper pod for k6-loadgen chaos

VolumeMounts: []corev1.VolumeMount{
{
Name: volumeName,
MountPath: "/mnt",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use the constant defined above

@ksatchit ksatchit merged commit eef3b40 into litmuschaos:master Mar 7, 2024
4 of 8 checks passed
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.

4 participants