Skip to content
166 changes: 166 additions & 0 deletions charts/spring-boot/experiments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Injects spring boot chaos monkey assault on pods belonging to an app deployment
kind: ChaosExperiment
metadata:
name: spring-boot-chaos
labels:
name: spring-boot-chaos
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: chaosexperiment
app.kubernetes.io/version: latest
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 details and mount it to the experiment pod (if specified)
- apiGroups: [ "" ]
resources: [ "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 comands inside target container
- apiGroups: [ "" ]
resources: [ "pods/exec" ]
verbs: [ "get","list","create" ]
# deriving the parent/owner details of the pod(if parent is anyof {deployment, statefulset, daemonsets})
- apiGroups: [ "apps" ]
resources: [ "deployments","statefulsets","replicasets", "daemonsets" ]
verbs: [ "list","get" ]
# deriving the parent/owner details of the pod(if parent is deploymentConfig)
- apiGroups: [ "apps.openshift.io" ]
resources: [ "deploymentconfigs" ]
verbs: [ "list","get" ]
# deriving the parent/owner details of the pod(if parent is deploymentConfig)
- apiGroups: [ "" ]
resources: [ "replicationcontrollers" ]
verbs: [ "get","list" ]
# deriving the parent/owner details of the pod(if parent is argo-rollouts)
- apiGroups: [ "argoproj.io" ]
resources: [ "rollouts" ]
verbs: [ "list","get" ]
# 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/go-runner:latest"
imagePullPolicy: Always
args:
- -c
- ./experiments -name spring-boot-chaos
command:
- /bin/bash
env:
- name: TOTAL_CHAOS_DURATION
value: '15'

## Period to wait before injection of chaos in sec
- name: RAMP_TIME
value: ''

## env var that describes the library used to execute the chaos
## default: litmus. Supported values: litmus
- name: LIB
value: 'litmus'

# Chaos Monkey Spring Boot configuration
# Level determines at which frequency the assault happens on the application. For a value N, the assaults happens every N requests
Comment thread
cazeaux marked this conversation as resolved.
- name: CM_LEVEL
value: '1'

# Whether the level should be used as a deterministic value (attack every x requests) or a chance (on average, 1 in x requests will be attacked)
- name: CM_DETERMINISTIC
value: 'true'


# Comma separated list of watched Java services. Ex: com.example.application.controller.HelloController.sayHello
- name: CM_WATCHED_CUSTOM_SERVICES
value: ''

# Comma separated list of watchers. Possible values: controller, restController, service, repository, component, restTemplate, webClient, actuatorHealth
- name: CM_WATCHERS
value: 'restController'

# AppKiller assault active
- name: CM_KILL_APPLICATIONS_ACTIVE
value: 'false'
# Memory cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_KILL_APPLICATION_CRON
value: ''

# Latency assault active
- name: CM_LATENCY_ACTIVE
value: 'false'
# Minimum latency (ms)
- name: CM_LATENCY_RANGE_START
value: '500'
# Maxiumu latency (ms)
- name: CM_LATENCY_RANGE_END
value: '500'

# Exception assault active
- name: CM_EXCEPTIONS_ACTIVE
value: 'false'
# Type of raised exception
- name: CM_EXCEPTIONS_TYPE
value: 'java.lang.IllegalArgumentException'
# Argument of raised exception
- name: CM_EXCEPTIONS_ARGUMENTS
value: 'java.lang.String:custom illegal argument exception'

# Memory assault active
- name: CM_MEMORY_ACTIVE
value: 'false'
# Duration to assault memory when requested fill amount is reached in ms.
- name: CM_MEMORY_MS_HOLD_FILLED_MEM
value: '90000'
# Time in ms between increases of memory usage.
- name: CM_MEMORY_MS_NEXT_INCREASE
value: '10000'
# Fraction of one individual memory increase iteration. 1.0 equals 100 %.
- name: CM_MEMORY_FILL_INC_FRACTION
value: '1.0'
# Final fraction of used memory by assault. 0.95 equals 95 %.
- name: CM_MEMORY_FILL_TARGET_FRACTION
value: '0.95'
# Memory cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey memory assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_MEMORY_CRON
value: ''

# CPU assault active
- name: CM_CPU_ACTIVE
value: 'false'
# Duration to assault cpu when requested load is reached in ms.
- name: CM_CPU_MS_HOLD_LOAD
value: '90000'
# Final fraction of used cpu by assault. 0.95 equals 95 %.
- name: CM_CPU_LOAD_TARGET_FRACTION
value: '0.9'
# CPU cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey cpu assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_CPU_CRON
value: ''

labels:
name: spring-boot-chaos
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: experiment-job
app.kubernetes.io/runtime-api-usage: "true"
app.kubernetes.io/version: latest
Binary file added charts/spring-boot/icons/spring-boot-chaos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charts/spring-boot/icons/spring-boot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions charts/spring-boot/spring-boot-chaos/engine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: spring-boot-app-chaos
namespace: default
spec:
appinfo:
appns: 'default'
applabel: 'app=springboot'
appkind: 'deployment'
# It can be active/stop
engineState: 'active'
chaosServiceAccount: spring-boot-chaos-sa
experiments:
- name: spring-boot-chaos
spec:
components:
env:
- name: TOTAL_CHAOS_DURATION
value: '15'

## Period to wait before injection of chaos in sec
- name: RAMP_TIME
value: ''
# Latency assault active
- name: CM_LATENCY_ACTIVE
value: 'false'
# Memory assault active
- name: CM_MEMORY_ACTIVE
value: 'false'
# Memory assault active
- name: CM_CPU_ACTIVE
value: 'false'
# Memory assault active
- name: CM_EXCEPTION_ACTIVE
value: 'false'
# AppKiller assault active
- name: CM_KILL_APPLICATIONS_ACTIVE
value: 'false'
# Comma separated list of watchers. Possible values: controller, restController, service, repository, component, restTemplate, webClient, actuatorHealth
- name: CM_WATCHERS
value: 'restController'
# Level determines at which frequency the assault happens on the application. For a value N, the assaults happens every N requests
- name: CM_LEVEL
value: '1'
166 changes: 166 additions & 0 deletions charts/spring-boot/spring-boot-chaos/experiment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Injects spring boot chaos monkey assault on pods belonging to an app deployment
kind: ChaosExperiment
metadata:
name: spring-boot-chaos
labels:
name: spring-boot-chaos
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: chaosexperiment
app.kubernetes.io/version: latest
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 details and mount it to the experiment pod (if specified)
- apiGroups: [ "" ]
resources: [ "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 comands inside target container
- apiGroups: [ "" ]
resources: [ "pods/exec" ]
verbs: [ "get","list","create" ]
# deriving the parent/owner details of the pod(if parent is anyof {deployment, statefulset, daemonsets})
- apiGroups: [ "apps" ]
resources: [ "deployments","statefulsets","replicasets", "daemonsets" ]
verbs: [ "list","get" ]
# deriving the parent/owner details of the pod(if parent is deploymentConfig)
- apiGroups: [ "apps.openshift.io" ]
resources: [ "deploymentconfigs" ]
verbs: [ "list","get" ]
# deriving the parent/owner details of the pod(if parent is deploymentConfig)
- apiGroups: [ "" ]
resources: [ "replicationcontrollers" ]
verbs: [ "get","list" ]
# deriving the parent/owner details of the pod(if parent is argo-rollouts)
- apiGroups: [ "argoproj.io" ]
resources: [ "rollouts" ]
verbs: [ "list","get" ]
# 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/go-runner:latest"
imagePullPolicy: Always
args:
- -c
- ./experiments -name spring-boot-chaos
command:
- /bin/bash
env:
- name: TOTAL_CHAOS_DURATION
value: '15'

## Period to wait before injection of chaos in sec
- name: RAMP_TIME
value: ''

## env var that describes the library used to execute the chaos
## default: litmus. Supported values: litmus
- name: LIB
value: 'litmus'

# Chaos Monkey Spring Boot configuration
# Level determines at which frequency the assault happens on the application. For a value N, the assaults happens every N requests
Comment thread
cazeaux marked this conversation as resolved.
- name: CM_LEVEL
value: '1'

# Whether the level should be used as a deterministic value (attack every x requests) or a chance (on average, 1 in x requests will be attacked)
- name: CM_DETERMINISTIC
value: 'true'


# Comma separated list of watched Java services. Ex: com.example.application.controller.HelloController.sayHello
- name: CM_WATCHED_CUSTOM_SERVICES
value: ''

# Comma separated list of watchers. Possible values: controller, restController, service, repository, component, restTemplate, webClient, actuatorHealth
- name: CM_WATCHERS
value: 'restController'

# AppKiller assault active
- name: CM_KILL_APPLICATIONS_ACTIVE
value: 'false'
# Memory cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_KILL_APPLICATION_CRON
value: ''

# Latency assault active
- name: CM_LATENCY_ACTIVE
value: 'false'
# Minimum latency (ms)
- name: CM_LATENCY_RANGE_START
value: '500'
# Maxiumu latency (ms)
- name: CM_LATENCY_RANGE_END
value: '500'

# Exception assault active
- name: CM_EXCEPTIONS_ACTIVE
value: 'false'
# Type of raised exception
- name: CM_EXCEPTIONS_TYPE
value: 'java.lang.IllegalArgumentException'
# Argument of raised exception
- name: CM_EXCEPTIONS_ARGUMENTS
value: 'java.lang.String:custom illegal argument exception'

# Memory assault active
- name: CM_MEMORY_ACTIVE
value: 'false'
# Duration to assault memory when requested fill amount is reached in ms.
- name: CM_MEMORY_MS_HOLD_FILLED_MEM
value: '90000'
# Time in ms between increases of memory usage.
- name: CM_MEMORY_MS_NEXT_INCREASE
value: '10000'
# Fraction of one individual memory increase iteration. 1.0 equals 100 %.
- name: CM_MEMORY_FILL_INC_FRACTION
value: '1.0'
# Final fraction of used memory by assault. 0.95 equals 95 %.
- name: CM_MEMORY_FILL_TARGET_FRACTION
value: '0.95'
# Memory cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey memory assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_MEMORY_CRON
value: ''

# CPU assault active
- name: CM_CPU_ACTIVE
value: 'false'
# Duration to assault cpu when requested load is reached in ms.
- name: CM_CPU_MS_HOLD_LOAD
value: '90000'
# Final fraction of used cpu by assault. 0.95 equals 95 %.
- name: CM_CPU_LOAD_TARGET_FRACTION
value: '0.9'
# CPU cron. Cron expression like */1 * * * * ? can be set to enable chaos monkey cpu assault on a schedule
# Warning: if disabled, leave empty (do not use "OFF" value like in chaos monkey for spring documentation)
- name: CM_CPU_CRON
value: ''

labels:
name: spring-boot-chaos
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: experiment-job
app.kubernetes.io/runtime-api-usage: "true"
app.kubernetes.io/version: latest
Loading