Skip to content

Commit 4b0bfb7

Browse files
committed
Update chaosd setup to create a temporary fake experiment to trigger necessary chaosd setup for network testing
1 parent 623e6f6 commit 4b0bfb7

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

roles/chaosd/tasks/setup.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
state: started
6565
daemon_reload: true
6666

67+
- name: Run network partition attack
68+
ansible.builtin.command:
69+
cmd: "{{ chaosd_install_dir }}/chaosd attack network partition -d eth0 --direction from --hostname temporary.com --uid 9999"
70+
become: true
71+
changed_when: true
72+
6773
- name: Copy chaos iptables bridge script
6874
ansible.builtin.template:
6975
src: chaos-iptables-bridge.sh.j2

roles/chaosd/templates/chaos-iptables-bridge.sh.j2

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,5 @@ add_jump() {
1212
iptables -t "$table" -C "$from" -j "$to" 2>/dev/null || iptables -t "$table" -I "$from" "$pos" -j "$to"
1313
}
1414

15-
# Reuse Chaos Mesh chains if they exist
16-
has_chain() { iptables -t filter -nL "$1" >/dev/null 2>&1; }
17-
18-
# 1) Container egress: DOCKER-USER -> CHAOS-OUTPUT
19-
if has_chain CHAOS-OUTPUT; then
20-
add_jump filter DOCKER-USER CHAOS-OUTPUT 1
21-
fi
22-
23-
# 2) Container ingress prep: DOCKER-USER -> CHAOS-INPUT
24-
# (This lets CHAOS-INPUT rules, when present, also run for FORWARDed traffic to containers.)
25-
if has_chain CHAOS-INPUT; then
26-
add_jump filter DOCKER-USER CHAOS-INPUT 1
27-
fi
15+
add_jump filter DOCKER-USER CHAOS-OUTPUT 1
16+
add_jump filter DOCKER-USER CHAOS-INPUT 1

roles/generate_kubernetes_config/defaults/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ gen_kubernetes_config_helm_charts: # noqa var-naming[no-role-prefix]
189189
dependencies:
190190
- name: chaos-mesh
191191
repository: https://ethpandaops.github.io/ethereum-helm-charts
192-
version: 0.0.4
192+
version: 0.0.3
193193
syncoor-server:
194194
valuesTemplatePath: templates/syncoor-server.yaml.j2
195195
dependencies:

roles/generate_kubernetes_config/templates/chaos-mesh.yaml.j2

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ chaos-mesh:
3939
{% for host in groups['ethereum_node'] | sort %}
4040
- name: {{ hostvars[host]['inventory_hostname'] }}
4141
address: "https://<path:/secrets/services/services.enc.yaml#ethereum | jsonPath {.testnets.{{ devnet_name }}-devnets.node_ingress.combined}>@rpc.{{ hostvars[host]['inventory_hostname'] }}.{{ network_subdomain }}/chaosd/"
42+
hostname: "{{ hostvars[host]['inventory_hostname'] }}.{{ network_subdomain }}"
43+
ip: "{{ hostvars[host]['ansible_host'] }}"
4244
labels:
4345
{% if 'ethereum_node_cl' in hostvars[host] %}
4446
consensus: {{ hostvars[host]['ethereum_node_cl'] }}
@@ -52,7 +54,4 @@ chaos-mesh:
5254
{% endif %}
5355
annotations:
5456
description: "{{ hostvars[host]['ethereum_node_cl'] | default('unknown') | title }} + {{ hostvars[host]['ethereum_node_el'] | default('unknown') | title }} node"
55-
{% if 'node_role' in hostvars[host] %}
56-
role: {{ hostvars[host]['node_role'] }}
57-
{% endif %}
5857
{% endfor %}

0 commit comments

Comments
 (0)