Skip to content

Commit

Permalink
[chaos-mesh] Add some chaos schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed May 23, 2024
1 parent f8b8180 commit e4de3c7
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build Docker and deploy
on:
push:
branches:
- master
- dag-master
workflow_dispatch:
release:
types: [ published ]
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
labels: ${{ steps.docker_meta.outputs.labels }}
- name: deploy cluster
# Only deploy on master.
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/dag-master'
shell: bash
env:
IMAGE_VERSION: ${{steps.docker_meta.outputs.version}}
Expand Down
4 changes: 2 additions & 2 deletions kube/chaos/network-netem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ spec:
mode: one
selector:
namespaces:
- default
- starcoin-halley
labelSelectors:
"app": "starcoin"
"app": "starcoin-0"
delay:
latency: "100ms"
correlation: "25"
Expand Down
2 changes: 1 addition & 1 deletion kube/chaos/network-partition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
mode: one
selector:
namespaces:
- default
- starcoin-halley
labelSelectors:
"app": "starcoin"
direction: to
Expand Down
2 changes: 1 addition & 1 deletion kube/chaos/pod-kill-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
mode: one
selector:
namespaces:
- default
- starcoin-halley
labelSelectors:
"app": "starcoin"
scheduler:
Expand Down
4 changes: 2 additions & 2 deletions kube/chaos/pod-kill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ spec:
mode: one
selector:
namespaces:
- default
- starcoin-halley
labelSelectors:
"app": "starcoin"
"app": "starcoin-0"
scheduler:
cron: "@every 20m"
38 changes: 38 additions & 0 deletions kube/chaos/schedule-halley-networkdelay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: starcoin-halley
name: networkdelay
spec:
schedule: '*/15 * * * *'
startingDeadlineSeconds: null
concurrencyPolicy: Forbid
historyLimit: 1
type: NetworkChaos
networkChaos:
selector:
namespaces:
- starcoin-halley
pods:
starcoin-halley:
- starcoin-0
- starcoin-1
- starcoin-2
mode: one
action: delay
duration: 5m
delay:
latency: 50000ms
correlation: '0'
jitter: 50m
direction: to
target:
selector:
namespaces:
- starcoin-halley
pods:
starcoin-halley:
- starcoin-0
- starcoin-1
- starcoin-2
mode: one
30 changes: 30 additions & 0 deletions kube/chaos/schedule-halley-networkpartition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: starcoin-halley
name: networkpartition
spec:
schedule: '*/30 * * * *'
startingDeadlineSeconds: null
concurrencyPolicy: Forbid
historyLimit: 1000
type: NetworkChaos
networkChaos:
selector:
namespaces:
- starcoin-halley
pods:
starcoin-halley:
- starcoin-0
mode: all
action: partition
duration: 5m
direction: to
target:
selector:
namespaces:
- starcoin-halley
pods:
starcoin-halley:
- starcoin-0
mode: all
20 changes: 20 additions & 0 deletions kube/chaos/schedule-halley-podkill.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: starcoin-halley
name: podkill
spec:
schedule: '* */1 * * *'
startingDeadlineSeconds: null
concurrencyPolicy: Forbid
historyLimit: 1
type: PodChaos
podChaos:
selector:
namespaces:
- starcoin-halley
pods:
starcoin-halley:
- starcoin-1
mode: all
action: pod-kill
2 changes: 1 addition & 1 deletion kube/chaos/time-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
mode: one
selector:
namespaces:
- default
- starcoin-halley
labelSelectors:
"app": "starcoin"
timeOffset: "-10m"
Expand Down
4 changes: 2 additions & 2 deletions kube/manifest/starcoin-halley.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
matchLabels:
app: starcoin
serviceName: starcoin-svc
replicas: 1
replicas: 3
template:
metadata:
name: starcoin
Expand All @@ -23,7 +23,7 @@ spec:
starcoin/node-pool: seed-pool
containers:
- name: starcoin
image: starcoin/starcoin:halley24_force_upgrade_v11
image: starcoin/starcoin:dag-master
imagePullPolicy: Always
command:
- bash
Expand Down

0 comments on commit e4de3c7

Please sign in to comment.