api7 / apisix-mesh-agent

Apache License 2.0
79 stars 10 forks source link

Traffic interception scheme #29

Closed tokers closed 3 years ago

tokers commented 3 years ago

As the data plane of Service Mesh, the apisix-mesh-agent must have the ability to setup rules to forward traffic from the original port to APISIX. Tools what we can use can be iptables. What's more, Istio always has a common go package to setup and clean iptables rules. It supports to set up rules on demand.

What we can do is exposing two sub commands:

setup-iptables

This command set up some rules, it should support the following options.

cleanup-iptables

This command cleanup all rules that set by setup-interception command.

Usage

When VM/Pod initialized, the apisix-mesh-agent setup-interception should be run firstly.

./apisix-mesh-agent setup-interception --apisix-port 9080 --inbound-port 80 --outbound-port "*"

If you want to cancel these rules, just run:

./apisix-mesh-agent cleanup-interception
tokers commented 3 years ago

Solved by #30 .