Skip to content

Commit

Permalink
[Cherry-pick for RC2] (#1506)
Browse files Browse the repository at this point in the history
* update(pod-delete): Adding type casting in pod-delete experiment (#1503)

Signed-off-by: shubhamchaudhary <[email protected]>

* feat(disk-fill): Adding Dynamic Variable for Container Path (#1502)

* (feat) Adding Dynamic Variable for Container Path

Signed-off-by: Rahul M Chheda <[email protected]>

* Adding appropriate comments

Signed-off-by: Rahul M Chheda <[email protected]>

* feat(image): Using a comman image for stress-ng commands (#1462)

Signed-off-by: Udit Gaurav <[email protected]>

Co-authored-by: Rahul M Chheda <[email protected]>
Co-authored-by: UDIT GAURAV <[email protected]>
  • Loading branch information
3 people authored May 13, 2020
1 parent 81bc298 commit 80c61b1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chaoslib/litmus/disk_fill/disk_fill_pod.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ spec:
volumes:
- name: udev
hostPath:
path: /var/lib/docker/containers
path: {{ container_path }}
1 change: 0 additions & 1 deletion chaoslib/litmus/node_cpu_hog/node-cpu-hog-pod.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ spec:
- image: {{ cpu_stress_image }}
imagePullPolicy: Always
name: node-cpu-hog
command: ["stress"]
args: ["--cpu", "{{ cpu_limit }}", "--timeout", "{{ c_duration }}"]
4 changes: 2 additions & 2 deletions chaoslib/litmus/pod_delete/kill_random_pod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@
retries: 90
when: "type is defined and type != ''"

when: "chaosDiffTimeStamp is not defined or (chaosDiffTimeStamp is defined and chaosDiffTimeStamp < c_duration)"
when: "chaosDiffTimeStamp is not defined or (chaosDiffTimeStamp is defined and chaosDiffTimeStamp|int < c_duration|int)"

# chaos_status tracking the status of chaos, If it is active means chaos is in progress
# If it is terminate means chaos is ended.
- name: "[Mark]: Setting chaos_status to terminate"
set_fact:
chaos_status: "terminate"
when: "chaosDiffTimeStamp is defined and chaosDiffTimeStamp >= c_duration"
when: "chaosDiffTimeStamp is defined and chaosDiffTimeStamp|int >= c_duration|int"

when: "chaos_status is not defined or (chaos_status is defined and chaos_status == 'active')"
1 change: 1 addition & 0 deletions experiments/generic/disk_fill/disk_fill_ansible_logic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
chaos_pod_name: "{{ lookup('env','POD_NAME') }}"
c_ns: "{{ lookup('env','CHAOS_NAMESPACE') }}"
c_lib: "{{ lookup('env','LIB') }}"
container_path: "{{ lookup('env','CONTAINER_PATH') }}"

tasks:
- block:
Expand Down
5 changes: 5 additions & 0 deletions experiments/generic/disk_fill/disk_fill_k8s_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,10 @@ spec:
- name: CHAOS_NAMESPACE
value: ''

# provide the container runtime path
# default set to docker
- name: CONTAINER_PATH
value: '/var/lib/docker/containers'

command: ["/bin/bash"]
args: ["-c", "ansible-playbook ./experiments/generic/disk_fill/disk_fill_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0"]
2 changes: 1 addition & 1 deletion experiments/generic/node_cpu_hog/node_cpu_hog_k8s_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:

# provide lib image
- name: LIB_IMAGE
value: 'litmuschaos/cpu:latest'
value: 'litmuschaos/stress-ng:latest'

## PERIOD TO WAIT BEFORE INJECTION OF CHAOS IN SEC
- name: RAMP_TIME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:

# provide lib image
- name: LIB_IMAGE
value: 'alexeiled/stress-ng:latest'
value: 'litmuschaos/stress-ng:latest'

## PERIOD TO WAIT BEFORE AND AFTER INJECTION OF CHAOS IN SEC
- name: RAMP_TIME
Expand Down

0 comments on commit 80c61b1

Please sign in to comment.