gateway

package
v0.0.0-...-cae1f32 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureStaticIP

func ConfigureStaticIP(staticVIP string) error

ConfigureStaticIP adds a secondary IP to an interface, Example: staticVIP=192.168.56.199/24

Get the route for this staticVIP
Find Interface with that route,
Verify interface has IP in same network as staticVIP
If found configure staticVIP on that interface.

func RemoveStaticIP

func RemoveStaticIP(staticVIP string) error

Types

type EgressGateway

type EgressGateway struct {
	// contains filtered or unexported fields
}

EgressGateway configures the gateway node (based on the `staticegressip` CRD object) with SNAT rules to NAT egress traffic from the pods that need a static egress IP

func NewEgressGateway

func NewEgressGateway() (*EgressGateway, error)

NewEgressGateway is a constructor for EgressGateway interface

func (*EgressGateway) AddStaticIptablesRule

func (gateway *EgressGateway) AddStaticIptablesRule(setName string, sourceIPs []string, destinationIP, egressIP string) error

AddStaticIptablesRule adds iptables rule for SNAT, creates source and destination IPsets. IPs can then be dynamically added to these IPsets.

func (*EgressGateway) ClearStaticIptablesRule

func (gateway *EgressGateway) ClearStaticIptablesRule(setName string, destinationIP, egressIP string) error

DeleteStaticIptablesRule clears IPtables rules added by AddStaticIptablesRule

func (*EgressGateway) DeleteStaticIptablesRule

func (gateway *EgressGateway) DeleteStaticIptablesRule(setName string, destinationIP, egressIP string) error

DeleteStaticIptablesRule clears IPtables rules added by AddStaticIptablesRule

func (*EgressGateway) Setup

func (gateway *EgressGateway) Setup() error

Jump to

Keyboard shortcuts

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