tke-bridge-agent
配置。kubectl edit daemonset tke-bridge-agent -n kube-system
--bandwidth
,开启 bandwidth 插件支持。agent.cniChaining.bandwidth
),修改为true
。kubernetes.io/ingress-bandwidth
此 annotation 指定入带宽限速。kubernetes.io/egress-bandwidth
此 annotation 指定出带宽限速。apiVersion: apps/v1kind: Deploymentmetadata:name: nginxspec:replicas: 1selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxannotations:kubernetes.io/ingress-bandwidth: 10Mkubernetes.io/egress-bandwidth: 20Mspec:containers:- name: nginximage: nginx
tc qdisc show
qdisc tbf 1: dev vethc09123a1 root refcnt 2 rate 10Mbit burst 256Mb lat 25.0msqdisc ingress ffff: dev vethc09123a1 parent ffff:fff1 ----------------qdisc tbf 1: dev 6116 root refcnt 2 rate 20Mbit burst 256Mb lat 25.0ms
iperf -c <服务 IP> -p <服务端口> -i 1
------------------------------------------------------------Client connecting to 172.16.0.xxx, TCP port 80TCP window size: 12.0 MByte (default)------------------------------------------------------------[ 3] local 172.16.0.xxx port 41112 connected with 172.16.0.xx port 80[ ID] Interval Transfer Bandwidth[ 3] 0.0- 1.0 sec 257 MBytes 2.16 Gbits/sec[ 3] 1.0- 2.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 2.0- 3.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 3.0- 4.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 4.0- 5.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 5.0- 6.0 sec 1.12 MBytes 9.38 Mbits/sec[ 3] 6.0- 7.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 7.0- 8.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 8.0- 9.0 sec 1.18 MBytes 9.90 Mbits/sec[ 3] 9.0-10.0 sec 1.12 MBytes 9.38 Mbits/sec[ 3] 0.0-10.3 sec 268 MBytes 218 Mbits/sec
本页内容是否解决了您的问题?