redirecttraffic

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL