Skip to content

Commit 7704e14

Browse files
author
Florin Marin
committed
Fix targetIp and upgrade to Chaos-mesh 2.1.3
Signed-off-by: Florin Marin <[email protected]>
1 parent 8159f13 commit 7704e14

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

chaos/network-delay.yaml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
apiVersion: pingcap.com/v1alpha1
2-
kind: NetworkChaos
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: Schedule
33
metadata:
4-
name: network-delay-example
4+
name: schedule-delay-example
55
spec:
6-
action: delay
7-
mode: one
8-
selector:
9-
namespaces:
10-
- default
11-
labelSelectors:
12-
"app": "web-show"
13-
delay:
14-
latency: "10ms"
15-
correlation: "100"
16-
jitter: "0ms"
17-
duration: "30s"
18-
scheduler:
19-
cron: "@every 60s"
6+
schedule: '*/1 * * * *'
7+
historyLimit: 2
8+
concurrencyPolicy: 'Allow'
9+
type: 'NetworkChaos'
10+
networkChaos:
11+
action: delay
12+
mode: one
13+
selector:
14+
namespaces:
15+
- default
16+
labelSelectors:
17+
'app': 'web-show'
18+
delay:
19+
latency: '10ms'
20+
correlation: '100'
21+
jitter: '0ms'
22+
duration: '30s'

deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
TARGET_IP=$(kubectl get pod -n kube-system -o wide| grep kube-controller | head -n 1 | awk '{print $6}')
5+
TARGET_IP=$(kubectl get pod -n kube-system -o wide| grep kube-controller | head -n 1 | awk '{print $8}')
66

77
sed "s/TARGETIP/$TARGET_IP/g" deploy/deployment.yaml > deploy/deployment.yamlg
88

@@ -12,6 +12,6 @@ kubectl apply -f deploy/
1212

1313
while [[ $(kubectl get pods -l app=web-show -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod running" && sleep 1; done
1414

15-
kill $(lsof -t -i:8081) 2>&1 >/dev/null | True
15+
kill $(lsof -t -i:8081) 2>&1 >/dev/null | true
1616

1717
nohup kubectl port-forward svc/web-show --address 0.0.0.0 8081:8081 2>&1 &

0 commit comments

Comments
 (0)