Documentation ¶
Index ¶
Constants ¶
const ( EncapTypeFOU = EncapType("fou") EncapTypeIPIP = EncapType("ipip") )
Variables ¶
This section is empty.
Functions ¶
func CleanupTunnel ¶
cleanupTunnel removes any traces of tunnels / routes that were setup by nrc.setupOverlayTunnel() and are no longer needed. All errors are logged only, as we want to attempt to perform all cleanup actions regardless of their success
func GenerateTunnelName ¶
GenerateTunnelName will generate a name for a tunnel interface given a node IP Since linux restricts interface names to 15 characters, we take the sha-256 of the node IP after removing non-entropic characters like '.' and ':', and then use the first 12 bytes of it. This allows us to cater to both long IPv4 addresses and much longer IPv6 addresses.
TODO: In the future, we should consider using the hexadecimal byte representation of IPv4 addresses and using a the SHA256 of the hash. Additionally, we should not remove non-entropic characters as it can cause hash collisions as "21.3.0.4" would has the same as "2.13.0.4" without "."'s.
Types ¶
type EncapType ¶
type EncapType string
EncapType represents the type of encapsulation used for an overlay tunnel in kube-router.
func ParseEncapType ¶
ParseEncapType parses the given string and returns an Encap type if valid. It returns an error if the encapsulation type is invalid.
Parameters:
- s: A string representing the encapsulation type.
Returns:
- Encap: The parsed encapsulation type.
- bool: A boolean indicating whether the encapsulation type is valid.
type OverlayTunnel ¶
type OverlayTunnel struct {
// contains filtered or unexported fields
}
func NewOverlayTunnel ¶
func NewOverlayTunnel(krNode utils.NodeIPAware, encapType EncapType, encapPort EncapPort) *OverlayTunnel
func (*OverlayTunnel) EncapPort ¶
func (o *OverlayTunnel) EncapPort() EncapPort
func (*OverlayTunnel) EncapType ¶
func (o *OverlayTunnel) EncapType() EncapType