Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TrafficRedirectionCfg ¶
type TrafficRedirectionCfg struct { ProxySvc *api.AgentService EnableConsulDNS bool ExcludeInboundPorts []int ExcludeOutboundPorts []int ExcludeOutboundCIDRs []string ExcludeUIDs []string // contains filtered or unexported fields }
func (*TrafficRedirectionCfg) Apply ¶
func (c *TrafficRedirectionCfg) Apply() error
applyTrafficRedirectionRules creates and applies traffic redirection rules with the help of iptables
iptables.Config:
ConsulDNSIP: Consul Dataplane's DNS server (i.e. localhost) ConsulDNSPort: Consul Dataplane's DNS server's bind port ProxyUserID: a constant set by default in the mesh-task module for the Consul dataplane's container ProxyInboundPort: the proxy service's port or bind port ProxyOutboundPort: default transparent proxy outbound port ExcludeInboundPorts: prometheus, envoy stats, expose paths and `transparentProxy.excludeInboundPorts` ExcludeOutboundPorts: `transparentProxy.excludeOutboundPorts` in CONSUL_ECS_CONFIG_JSON ExcludeOutboundCIDRs: `transparentProxy.excludeOutboundCIDRs` in CONSUL_ECS_CONFIG_JSON ExcludeUIDs: `transparentProxy.excludeUIDs` in CONSUL_ECS_CONFIG_JSON
func (*TrafficRedirectionCfg) Config ¶
func (c *TrafficRedirectionCfg) Config() iptables.Config
type TrafficRedirectionOpts ¶
type TrafficRedirectionOpts func(*TrafficRedirectionCfg)
func WithIPTablesProvider ¶
func WithIPTablesProvider(provider iptables.Provider) TrafficRedirectionOpts
type TrafficRedirectionProvider ¶
type TrafficRedirectionProvider interface { // Apply applies the traffic redirection with iptables Apply() error // Config returns the resultant iptables config that gets // applied by the provider Config() iptables.Config }
func New ¶
func New(cfg *config.Config, proxySvc *api.AgentService, additionalInboundPortsToExclude []int, opts ...TrafficRedirectionOpts) TrafficRedirectionProvider
Click to show internal directories.
Click to hide internal directories.