Documentation
¶
Index ¶
Constants ¶
const ( // VXLAN specifies VXLAN encapsulation VXLAN EncapProtocol = "vxlan" // Geneve specifies Geneve encapsulation Geneve EncapProtocol = "geneve" // Disabled specifies to disable encapsulation Disabled EncapProtocol = "" IPv4 UnderlayProtocol = "ipv4" IPv6 UnderlayProtocol = "ipv6" )
Variables ¶
var Cell = cell.Module( "datapath-tunnel-config", "Tunneling configurations", cell.Config(defaultConfig), cell.Provide( newConfig, Config.datapathConfigProvider, func(dcfg *option.DaemonConfig) EnablerOut { return NewEnabler(dcfg.TunnelingEnabled()) }, func(kpr kpr.KPRConfig, lbcfg loadbalancer.Config) EnablerOut { return NewEnabler( (kpr.EnableNodePort || kpr.KubeProxyReplacement == option.KubeProxyReplacementTrue) && lbcfg.LoadBalancerUsesDSR() && lbcfg.DSRDispatch == loadbalancer.DSRDispatchGeneve, WithoutMTUAdaptation(), ) }, ), )
Cell is a cell that provides the parameters for the Cilium tunnel, based on user configuration and requests from external modules.
Functions ¶
func WithValidator ¶
func WithValidator(validator func(EncapProtocol) error) enablerOpt
WithValidator allows to register extra validation functions to assert that the configured tunnel protocol matches the one expected by the given feature.
func WithoutMTUAdaptation ¶
func WithoutMTUAdaptation() enablerOpt
WithoutMTUAdaptation conveys that the given feature request to enable tunneling, but the MTU adaptation is already handled externally.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the materialized tunneling configuration to be used, depending on the user configuration and optional overrides required by additional features.
func NewTestConfig ¶
func NewTestConfig(proto EncapProtocol) Config
NewTestConfig returns a new TunnelConfig for testing purposes.
func (Config) DeviceName ¶
DeviceName returns the name of the tunnel device (empty if disabled).
func (Config) EncapProtocol ¶ added in v1.18.0
func (cfg Config) EncapProtocol() EncapProtocol
EncapProtocol returns the enabled tunnel protocol. The tunnel protocol may be set to either VXLAN or Geneve even when the primary mode is native routing, in case an additional feature (e.g., egress gateway) may request some traffic to be routed through a tunnel.
func (Config) ShouldAdaptMTU ¶
ShouldAdaptMTU returns whether we should adapt the MTU calculation to account for encapsulation.
func (Config) SrcPortHigh ¶ added in v1.17.2
SrcPortHigh returns the upper src port hint to be used by the tunnel (0 if disabled).
func (Config) SrcPortLow ¶ added in v1.17.2
SrcPortLow returns the lower src port hint to be used by the tunnel (0 if disabled).
func (Config) UnderlayProtocol ¶ added in v1.18.0
func (cfg Config) UnderlayProtocol() UnderlayProtocol
type EnablerOut ¶
EnablerOut allows requesting to enable tunneling functionalities.
func NewEnabler ¶
func NewEnabler(enable bool, opts ...enablerOpt) EnablerOut
NewEnabler returns an object to be injected through hive to request to enable tunneling functionalities. Extra options are meaningful only when enable is set to true, and are ignored otherwise.
type EncapProtocol ¶ added in v1.18.0
type EncapProtocol string
EncapProtocol represents the valid types of encapsulation protocols.
func (EncapProtocol) String ¶ added in v1.18.0
func (tp EncapProtocol) String() string
type UnderlayProtocol ¶ added in v1.18.0
type UnderlayProtocol string
UnderlayProtocol represents the valid types of underlay protocols for the tunnel.