当前位置:网站首页>[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
2022-07-07 08:59:00 【Fairy Xiao Xiaole】
node CPU load
The goal is : Specify a node , do CPU load 80% experiment
node_cpu_load.yaml Content :
apiVersion: chaosblade.io/v1alpha1
kind: ChaosBlade
metadata:
name: cpu-load
spec:
experiments:
- scope: node
target: cpu
action: fullload
desc: "increase node cpu load by names"
matchers:
- name: names
value:
- "docker20"
- name: cpu-percent
value:
- "80"
Select a node , modify node_cpu_load.yaml Medium names value .
Carry out orders :
$ kubectl apply -f node_cpu_load.yaml
Check the status
perform kubectl get blade cpu-load -o json command , Check the experiment status .
View results
Access to the Node node , Use top Command can see this node CPU Achieve the desired effect .
stop it
Carry out orders :kubectl delete -f node_cpu_load.yaml
Or delete blade resources :kubectl delete blade cpu-load
Node network related scenarios
Before operation , Please log in first node node , Use ifconfig Command to view network card information , Not all system default network card names are eth0
Node network delay scenario
The goal is : Specify the local of the node 32436 Port add 3000 Millisecond access delay , The delay time fluctuates up and down 1000 millisecond
Select a node , modify delay_node_network_by_names.yaml Medium names value
Yes docker20 Node local port 32436 Access packet loss rate 100%.
delay_node_network_by_names.yaml Content :
apiVersion: chaosblade.io/v1alpha1
kind: ChaosBlade
metadata:
name: delay-node-network-by-names
spec:
experiments:
- scope: node
target: network
action: delay
desc: "delay node network loss"
matchers:
- name: names
value: ["docker20"]
- name: interface
value: ["ens33"]
- name: local-port
value: ["32436"]
- name: time
value: ["3000"]
- name: offset
value: ["1000"]
Carry out orders :
$ kubectl apply -f delay_node_network_by_names.yaml
Check the status
perform kubectl get blade delay-node-network-by-names -o json command , Check the experiment status .
View results
# Access... From the experiment node Guestbook
$ time echo "" | telnet 192.168.1.129 32436
Trying 192.168.1.129...
Connected to 192.168.1.129.
Escape character is '^]'.
Connection closed by foreign host.
echo "" 0.00s user 0.00s system 35% cpu 0.003 total
telnet 192.168.1.129 32436 0.01s user 0.00s system 0% cpu 3.248 total
stop it
Carry out orders :kubectl delete -f delay_node_network_by_names.yaml
Or delete blade resources :kubectl delete blade delay-node-network-by-names
Node network packet loss scenario
The goal is : Of the specified node 32436 Packet loss rate of port injection 100% Failure of
Select a node , modify loss_node_network_by_names.yaml Medium names value .
loss_node_network_by_names.yaml Content :
apiVersion: chaosblade.io/v1alpha1
kind: ChaosBlade
metadata:
name: loss-node-network-by-names
spec:
experiments:
- scope: node
target: network
action: loss
desc: "node network loss"
matchers:
- name: names
value: ["docker20"]
- name: percent
value: ["100"]
- name: interface
value: ["ens33"]
- name: local-port
value: ["32436"]
Carry out orders , Start :
$ kubectl apply -f loss_node_network_by_names.yaml
Check the status
perform kubectl get blade loss-node-network-by-names -o json command , Check the status .
View results
The port is Guestbook nodeport The port of , No response when accessing the experimental port , However, the port that accesses the unopened experiment can be used normally :
# Access to the node IP
$ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
docker20 Ready worker 3d16h v1.17.6 192.168.1.129 <none> Ubuntu 18.04.4 LTS 4.15.0-101-generic docker://19.3.11
kk Ready controlplane,etcd,worker 4d16h v1.17.6 192.168.4.210 <none> Ubuntu 18.04.4 LTS 4.15.0-101-generic docker://19.3.11
# Access from the operation node Guestbook - cannot access
$ telnet 192.168.1.129 32436
Trying 192.168.1.129...
telnet: connect to address 192.168.1.129: Operation timed out
telnet: Unable to connect to remote host
# Access from non operational nodes Guestbook - Normal visit
$ telnet 192.168.4.210 32436
Trying 192.168.4.210...
Connected to 192.168.4.210.
Escape character is '^]'.
You can also access address verification directly from the browser .
stop it
Carry out orders :kubectl delete -f loss_node_network_by_names.yaml
Or delete blade resources :kubectl delete blade loss-node-network-by-names
Node domain name access exception scenario
The goal is : This experiment is modified Node Of hosts, Tamper with domain name address mapping , simulation Pod Abnormal scenario of internal domain name access .
Select a node , modify dns_node_network_by_names.yaml Medium names value .
dns_node_network_by_names.yaml Content :
apiVersion: chaosblade.io/v1alpha1
kind: ChaosBlade
metadata:
name: dns-node-network-by-names
spec:
experiments:
- scope: node
target: network
action: dns
desc: "dns node network by names"
matchers:
- name: names
value:
- "docker20"
- name: domain
value: ["www.baidu.com"]
- name: ip
value: ["10.0.0.1"]
Carry out orders , Start the experiment :
$ kubectl apply -f dns_node_network_by_names.yaml
Check the experiment status
perform kubectl get blade dns-node-network-by-names -o json command , Check the experiment status .
View experiment results
# Enter the experiment node
$ ssh [email protected]
# Ping www.baidu.com
$ ping www.baidu.com
# No response
You can see Node Of /etc/hosts The document was modified , Simulated dns Analyze abnormal scenarios .
stop it
Carry out orders :kubectl delete -f dns_node_network_by_names.yaml
Or delete blade resources :kubectl delete blade dns-node-network-by-names
边栏推荐
- Lenovo hybrid cloud Lenovo xcloud: 4 major product lines +it service portal
- MySQL master-slave delay solution
- 测试人一定要会的技能:selenium的三种等待方式解读,清晰明了
- 【ChaosBlade:根据标签删除POD、Pod 域名访问异常场景、Pod 文件系统 I/O 故障场景】
- Sign and authenticate API interface or H5 interface
- Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
- Troublesome problem of image resizing when using typora to edit markdown to upload CSDN
- Count the number of words in the string c language
- channel. Detailed explanation of queuedeclare parameters
- Original collection of hardware bear (updated on June 2022)
猜你喜欢
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
Output a spiral matrix C language
The longest ascending subsequence model acwing 1017 Strange thief Kidd's glider
Unityshader introduction essentials personal summary -- Basic chapter (I)
LeetCode 715. Range 模块
硬核分享:硬件工程师常用工具包
Greenplum 6.x monitoring software setup
数字三角形模型 AcWing 1027. 方格取数
Synchronized underlying principle, volatile keyword analysis
Greenplum6.x搭建_环境配置
随机推荐
Simulation volume leetcode [general] 1609 Parity tree
Mock. JS usage details
How to add a mask of a target in a picture
NVIC中断优先级管理
[step on the pit] Nacos registration has been connected to localhost:8848, no available server
Synchronized underlying principle, volatile keyword analysis
Why choose cloud native database
Several common database connection methods
Personal deduction topic classification record
Several methods of calculating the average value of two numbers
go mod module declares its path as: gtihub. com/xxx-xx but was required as:xx-xx
MAC OSX php dyld: Library not loaded: /usr/local/xxxx. dylib
Troublesome problem of image resizing when using typora to edit markdown to upload CSDN
Greenplum 6.x common statements
最长上升子序列模型 AcWing 1017. 怪盗基德的滑翔翼
Un salaire annuel de 50 W Ali P8 vous montrera comment passer du test
平台化,强链补链的一个支点
Greenplum 6.x version change record common manual
On December 8th, 2020, the memory of marketing MRC application suddenly increased, resulting in system oom
Oracle makes it clear at one time that a field with multiple separators will be split into multiple rows, and then multiple rows and columns. Multiple separators will be split into multiple rows, and