|
| 1 | +apiVersion: litmuschaos.io/v1alpha1 |
| 2 | +description: |
| 3 | + message: | |
| 4 | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject cpu-stress |
| 5 | +kind: ChaosExperiment |
| 6 | +metadata: |
| 7 | + name: spring-boot-cpu-stress |
| 8 | + labels: |
| 9 | + name: spring-boot-cpu-stress |
| 10 | + app.kubernetes.io/part-of: litmus |
| 11 | + app.kubernetes.io/component: chaosexperiment |
| 12 | + app.kubernetes.io/version: latest |
| 13 | +spec: |
| 14 | + definition: |
| 15 | + scope: Namespaced |
| 16 | + permissions: |
| 17 | + # Create and monitor the experiment & helper pods |
| 18 | + - apiGroups: [ "" ] |
| 19 | + resources: [ "pods" ] |
| 20 | + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] |
| 21 | + # Performs CRUD operations on the events inside chaosengine and chaosresult |
| 22 | + - apiGroups: [ "" ] |
| 23 | + resources: [ "events" ] |
| 24 | + verbs: [ "create","get","list","patch","update" ] |
| 25 | + # Track and get the runner, experiment, and helper pods log |
| 26 | + - apiGroups: [ "" ] |
| 27 | + resources: [ "pods/log" ] |
| 28 | + verbs: [ "get","list","watch" ] |
| 29 | + # for creating and managing to execute commands inside target container |
| 30 | + - apiGroups: [ "" ] |
| 31 | + resources: [ "pods/exec" ] |
| 32 | + verbs: [ "get","list","create" ] |
| 33 | + # for configuring and monitor the experiment job by the chaos-runner pod |
| 34 | + - apiGroups: [ "batch" ] |
| 35 | + resources: [ "jobs" ] |
| 36 | + verbs: [ "create","list","get","delete","deletecollection" ] |
| 37 | + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow |
| 38 | + - apiGroups: [ "litmuschaos.io" ] |
| 39 | + resources: [ "chaosengines","chaosexperiments","chaosresults" ] |
| 40 | + verbs: [ "create","list","get","patch","update","delete" ] |
| 41 | + image: "litmuschaos/go-runner:latest" |
| 42 | + imagePullPolicy: Always |
| 43 | + args: |
| 44 | + - -c |
| 45 | + - ./experiments -name spring-boot-cpu-stress |
| 46 | + command: |
| 47 | + - /bin/bash |
| 48 | + env: |
| 49 | + |
| 50 | + # it contains fraction of cpu to be stressed(0.95 equals 95%) |
| 51 | + # it supports value in range [0.1,1.0] |
| 52 | + - name: CPU_LOAD_FRACTION |
| 53 | + value: '0.9' |
| 54 | + |
| 55 | + # port of the spring boot application |
| 56 | + - name: CM_PORT |
| 57 | + value: '' |
| 58 | + |
| 59 | + #it contains number of requests are to be attacked |
| 60 | + # n value means nth request will be affected |
| 61 | + - name: CM_LEVEL |
| 62 | + value: '1' |
| 63 | + |
| 64 | + # it limits watched packages/classes/methods |
| 65 | + - name: CM_WATCHED_CUSTOM_SERVICES |
| 66 | + value: '' |
| 67 | + |
| 68 | + # provide name of watcher |
| 69 | + # it supports controller, restController, service, repository, component, webClient |
| 70 | + - name: CM_WATCHERS |
| 71 | + value: 'restController' |
| 72 | + |
| 73 | + - name: TOTAL_CHAOS_DURATION |
| 74 | + value: '30' |
| 75 | + |
| 76 | + ## percentage of total pods to target |
| 77 | + - name: PODS_AFFECTED_PERC |
| 78 | + value: '' |
| 79 | + |
| 80 | + ## Period to wait before and after injection of chaos |
| 81 | + - name: RAMP_TIME |
| 82 | + value: '' |
| 83 | + |
| 84 | + ## it defines the sequence of chaos execution for multiple target pods |
| 85 | + ## supported values: serial, parallel |
| 86 | + - name: SEQUENCE |
| 87 | + value: 'parallel' |
| 88 | + |
| 89 | + ## env var that describes the library used to execute the chaos |
| 90 | + ## default: litmus. Supported values: litmus |
| 91 | + - name: LIB |
| 92 | + value: 'litmus' |
| 93 | + |
| 94 | + labels: |
| 95 | + name: spring-boot-cpu-stress |
| 96 | + app.kubernetes.io/part-of: litmus |
| 97 | + app.kubernetes.io/component: experiment-job |
| 98 | + app.kubernetes.io/version: latest |
0 commit comments