Skip to content

Commit 47e80fe

Browse files
committed
kubectl-ko: add new command ovn-trace for tracing ovn lflows only (#3202)
Signed-off-by: 张祖建 <zhangzujian.7@gmail.com>
1 parent 0bb52d9 commit 47e80fe

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

dist/images/kubectl-ko

+13-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CONN_CHECK_LABEL="conn-check"
1414
CONN_CHECK_SERVER="conn-check-server"
1515
PERF_GC_COMMAND=()
1616
LAST_PERF_FAILED_LOG=""
17+
OVN_TRACE=0
1718

1819
showHelp(){
1920
echo "kubectl ko {subcommand} [option...]"
@@ -26,11 +27,11 @@ showHelp(){
2627
echo " dpctl {nodeName} [ovs-dpctl options ...] invoke ovs-dpctl on the specified node"
2728
echo " appctl {nodeName} [ovs-appctl options ...] invoke ovs-appctl on the specified node"
2829
echo " tcpdump {namespace/podname} [tcpdump options ...] capture pod traffic"
29-
echo " trace ... trace ovn microflow of specific packet"
30-
echo " trace {namespace/podname} {target ip address} [target mac address] {icmp|tcp|udp} [target tcp/udp port] trace ICMP/TCP/UDP"
31-
echo " trace {namespace/podname} {target ip address} [target mac address] arp {request|reply} trace ARP request/reply"
32-
echo " trace {node//nodename} {target ip address} [target mac address] {icmp|tcp|udp} [target tcp/udp port] trace ICMP/TCP/UDP"
33-
echo " trace {node//nodename} {target ip address} [target mac address] arp {request|reply} trace ARP request/reply"
30+
echo " trace/ovn-trace ... trace ovn microflow of specific packet"
31+
echo " trace/ovn-trace {namespace/podname} {target ip address} [target mac address] {icmp|tcp|udp} [target tcp/udp port] trace ICMP/TCP/UDP"
32+
echo " trace/ovn-trace {namespace/podname} {target ip address} [target mac address] arp {request|reply} trace ARP request/reply"
33+
echo " trace/ovn-trace {node//nodename} {target ip address} [target mac address] {icmp|tcp|udp} [target tcp/udp port] trace ICMP/TCP/UDP"
34+
echo " trace/ovn-trace {node//nodename} {target ip address} [target mac address] arp {request|reply} trace ARP request/reply"
3435
echo " diagnose {all|node|subnet|IPPorts} [nodename|subnetName|{proto1}-{IP1}-{Port1},{proto2}-{IP2}-{Port2}] diagnose connectivity of all nodes or a specific node or specify subnet's ds pod or IPPorts like 'tcp-172.18.0.2-53,udp-172.18.0.3-53'"
3536
echo " env-check check the environment configuration"
3637
echo " tuning {install-fastpath|local-install-fastpath|remove-fastpath|install-stt|local-install-stt|remove-stt} {centos7|centos8}} [kernel-devel-version] deploy kernel optimisation components to the system"
@@ -440,6 +441,8 @@ trace(){
440441
esac
441442

442443
set +x
444+
test $OVN_TRACE -ne 0 && return
445+
443446
echo "--------"
444447
echo "Start OVS Tracing"
445448
echo ""
@@ -1654,6 +1657,11 @@ case $subcommand in
16541657
getOvnCentralPod
16551658
trace "$@"
16561659
;;
1660+
ovn-trace)
1661+
getOvnCentralPod
1662+
OVN_TRACE=1
1663+
trace "$@"
1664+
;;
16571665
diagnose)
16581666
diagnose "$@"
16591667
;;

0 commit comments

Comments
 (0)