Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aiopslab/generators/fault/chaos-yaml/pod-kill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod-kill-mesh
namespace: default
spec:
action: pod-kill
action: pod-failure
mode: one
selector:
namespaces:
Expand Down
7 changes: 6 additions & 1 deletion aiopslab/generators/fault/inject_symp.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ def recover_network_delay(self):
def inject_pod_kill(self, microservices: List[str], duration: str = "200s"):
"""
Inject a pod kill fault targeting specified microservices by label in the configured namespace.

Note: This uses 'pod-failure' action instead of 'pod-kill' to prevent Kubernetes from immediately
recreating the pod. The 'pod-kill' action forcefully deletes pods, causing Kubernetes controllers
(Deployment/ReplicaSet) to immediately recreate them. The 'pod-failure' action makes pods unavailable
for the specified duration without deletion, allowing proper fault injection testing.

Args:
microservices (List[str]): A list of microservices labels to target for the pod kill experiment.
Expand All @@ -174,7 +179,7 @@ def inject_pod_kill(self, microservices: List[str], duration: str = "200s"):
"kind": "PodChaos",
"metadata": {"name": "pod-kill", "namespace": self.namespace},
"spec": {
"action": "pod-kill",
"action": "pod-failure",
"mode": "one",
"duration": duration,
"selector": {
Expand Down