forked from litmuschaos/chaos-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a k6-loadgen chaos fault (litmuschaos#622)
* feat: add load dir Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * fix: chore Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * feat: add secret Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * fix: hostpath to secret Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * fix: fixed scope Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * fix: implement feedbacks Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * fix: chore Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * Update faults/load/k6-loadgen/engine.yaml Co-authored-by: Neelanjan Manna <neelanjanmanna@gmail.com> Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * Update faults/load/k6-loadgen/fault.yaml Co-authored-by: Neelanjan Manna <neelanjanmanna@gmail.com> Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> * Update faults/load/k6-loadgen/engine.yaml Co-authored-by: Neelanjan Manna <neelanjanmanna@gmail.com> Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> --------- Signed-off-by: namkyu1999 <lak9348@konkuk.ac.kr> Co-authored-by: Neelanjan Manna <neelanjanmanna@gmail.com>
- Loading branch information
1 parent
a26b30e
commit 1311908
Showing
9 changed files
with
518 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/git,visualstudiocode,goland+all,jetbrains+all,macos | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=git,visualstudiocode,goland+all,jetbrains+all,macos | ||
|
||
### Git ### | ||
# Created by git for backups. To disable backups in Git: | ||
# $ git config --global mergetool.keepBackup false | ||
*.orig | ||
|
||
# Created by git when using merge tools for conflicts | ||
*.BACKUP.* | ||
*.BASE.* | ||
*.LOCAL.* | ||
*.REMOTE.* | ||
*_BACKUP_*.txt | ||
*_BASE_*.txt | ||
*_LOCAL_*.txt | ||
*_REMOTE_*.txt | ||
|
||
### GoLand+all ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
# .idea/jarRepositories.xml | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
### GoLand+all Patch ### | ||
# Ignore everything but code style settings and run configurations | ||
# that are supposed to be shared within teams. | ||
|
||
.idea/* | ||
|
||
!.idea/codeStyles | ||
!.idea/runConfigurations | ||
|
||
### JetBrains+all ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
|
||
# AWS User-specific | ||
|
||
# Generated files | ||
|
||
# Sensitive or high-churn files | ||
|
||
# Gradle | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
# .idea/jarRepositories.xml | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
|
||
# Mongo Explorer plugin | ||
|
||
# File-based project format | ||
|
||
# IntelliJ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
|
||
# JIRA plugin | ||
|
||
# Cursive Clojure plugin | ||
|
||
# SonarLint plugin | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
|
||
# Editor-based Rest Client | ||
|
||
# Android studio 3.1+ serialized cache file | ||
|
||
### JetBrains+all Patch ### | ||
# Ignore everything but code style settings and run configurations | ||
# that are supposed to be shared within teams. | ||
|
||
|
||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### VisualStudioCode ### | ||
.vscode/ | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/git,visualstudiocode,goland+all,jetbrains+all,macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
description: | ||
message: | | ||
Execute the k6 engine using the JS script | ||
kind: ChaosExperiment | ||
metadata: | ||
name: k6-loadgen | ||
labels: | ||
name: k6-loadgen | ||
app.kubernetes.io/part-of: litmus | ||
app.kubernetes.io/component: chaosexperiment | ||
app.kubernetes.io/version: ci | ||
spec: | ||
definition: | ||
scope: Namespaced | ||
permissions: | ||
# Create and monitor the experiment & helper pods | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: | ||
[ | ||
"create", | ||
"delete", | ||
"get", | ||
"list", | ||
"patch", | ||
"update", | ||
"deletecollection", | ||
] | ||
# Performs CRUD operations on the events inside chaosengine and chaosresult | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create", "get", "list", "patch", "update"] | ||
# Fetch configmaps & secrets details and mount it to the experiment pod (if specified) | ||
- apiGroups: [""] | ||
resources: ["secrets", "configmaps"] | ||
verbs: ["get", "list"] | ||
# Track and get the runner, experiment, and helper pods log | ||
- apiGroups: [""] | ||
resources: ["pods/log"] | ||
verbs: ["get", "list", "watch"] | ||
# for creating and managing to execute commands inside target container | ||
- apiGroups: [""] | ||
resources: ["pods/exec"] | ||
verbs: ["get", "list", "create"] | ||
# for configuring and monitor the experiment job by the chaos-runner pod | ||
- apiGroups: ["batch"] | ||
resources: ["jobs"] | ||
verbs: ["create", "list", "get", "delete", "deletecollection"] | ||
# for creation, status polling and deletion of litmus chaos resources used within a chaos workflow | ||
- apiGroups: ["litmuschaos.io"] | ||
resources: ["chaosengines", "chaosexperiments", "chaosresults"] | ||
verbs: ["create", "list", "get", "patch", "update", "delete"] | ||
image: "litmuschaos.docker.scarf.sh/litmuschaos/go-runner:latest" | ||
imagePullPolicy: Always | ||
args: | ||
- -c | ||
- ./experiments -name k6-loadgen | ||
command: | ||
- /bin/bash | ||
env: | ||
# set chaos duration (in sec) as desired | ||
- name: TOTAL_CHAOS_DURATION | ||
value: "30" | ||
|
||
# Interval between chaos injection in sec | ||
- name: CHAOS_INTERVAL | ||
value: "30" | ||
|
||
# Period to wait before and after injection of chaos in sec | ||
- name: RAMP_TIME | ||
value: "0" | ||
|
||
# Provide the secret name of the JS script | ||
- name: SCRIPT_SECRET_NAME | ||
value: "k6-script" | ||
|
||
# Provide the secret key of the JS script | ||
- name: SCRIPT_SECRET_KEY | ||
value: "script.js" | ||
|
||
# Provide the image name of the helper pod | ||
- name: LIB_IMAGE | ||
value: "ghcr.io/grafana/k6-operator:latest-runner" | ||
|
||
# Provide the image pull policy of the helper pod | ||
- name: LIBImagePullPolicy | ||
value: "Always" | ||
|
||
labels: | ||
name: k6-loadgen | ||
app.kubernetes.io/part-of: litmus | ||
app.kubernetes.io/component: experiment-job | ||
app.kubernetes.io/version: ci | ||
--- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: nginx-chaos | ||
namespace: default | ||
spec: | ||
engineState: 'active' | ||
appinfo: | ||
appns: '' | ||
applabel: '' | ||
appkind: '' | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: k6-loadgen | ||
spec: | ||
components: | ||
env: | ||
# set chaos duration (in sec) as desired | ||
- name: TOTAL_CHAOS_DURATION | ||
value: "30" | ||
|
||
# Interval between chaos injection in sec | ||
- name: CHAOS_INTERVAL | ||
value: "30" | ||
|
||
# Period to wait before and after injection of chaos in sec | ||
- name: RAMP_TIME | ||
value: "0" | ||
|
||
# Provide the secret name of the JS script | ||
- name: SCRIPT_SECRET_NAME | ||
value: "k6-script" | ||
|
||
# Provide the secret key of the JS script | ||
- name: SCRIPT_SECRET_KEY | ||
value: "script.js" | ||
|
||
# Provide the image name of the helper pod | ||
- name: LIB_IMAGE | ||
value: "ghcr.io/grafana/k6-operator:latest-runner" | ||
|
||
# Provide the image pull policy of the helper pod | ||
- name: LIB_IMAGE_PULL_POLICY | ||
value: "Always" |
Oops, something went wrong.