Documentation
¶
Index ¶
- Constants
- type BGPWorker
- type Controller
- type GoBGPDController
- func (g *GoBGPDController) Get(ctx context.Context) ([]string, error)
- func (g *GoBGPDController) Set(ctx context.Context, addresses, configuredAddresses []string, ...) error
- func (g *GoBGPDController) SetV6(ctx context.Context, addresses []string, communities []string) error
- func (g *GoBGPDController) Teardown(context.Context) error
- type IPPoolV2
- type IPPoolV3
- type Marshals
Constants ¶
View Source
const (
AddrKindIPV4 = "ipv4"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGPWorker ¶
BGPWorker describes a BGP worker that can advertise BGP routes and communities
func NewBGPWorker ¶
func NewBGPWorker(ctx context.Context, configKey string, watcher *watcher.Watcher, ipDevices *system.IP, ipPrimary *system.IP, ipvs *system.IPVS, bgpController Controller, communities []string, logger logrus.FieldLogger) (BGPWorker, error)
NewBGPWorker creates a new BGPWorker, which configures BGP for all VIPs
type Controller ¶
type Controller interface {
// Get returns the addresses currently in the BGP RIB
Get(ctx context.Context) ([]string, error)
// Set receives a list of ip addresses and performs the necessary
// steps to configure each address in BGP.
Set(ctx context.Context, addresses, configuredAddresses []string, communities []string) error
// SetV6 set, for v6. Very similar to above function
SetV6(ctx context.Context, addresses []string, communities []string) error
// Teardown removes all addresses from BGP.
// Perhaps this will never be applied.
Teardown(context.Context) error
}
The Controller provides an interface for configuring BGP. Feed a controller a list of VIP addresses that require configuration, and it will manage the whole add/remove/change process.
type GoBGPDController ¶
type GoBGPDController struct {
// contains filtered or unexported fields
}
func NewBGPDController ¶
func NewBGPDController(executablePath string, logger logrus.FieldLogger) *GoBGPDController
func (*GoBGPDController) Get ¶
func (g *GoBGPDController) Get(ctx context.Context) ([]string, error)
Get fetches a list of configured addresses in gobgp
func (*GoBGPDController) Set ¶
func (g *GoBGPDController) Set(ctx context.Context, addresses, configuredAddresses []string, communities []string) error
Set configures the ipvsadm rules for ipv4 with an optional set of community strings. If a community is not set or blank, then it will not be used.
type IPPoolV2 ¶
type IPPoolV2 struct {
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Metadata struct {
CIDR string `json:"cidr,omitempty" yaml:"cidr,omitempty"`
} `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Spec struct {
IPIP struct {
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
} `json:"ipip,omitempty" yaml:"ipip,omitempty"`
NatOutgoing bool `json:"nat-outgoing,omitempty" yaml:"nat-outgoing,omitempty"`
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
} `json:"spec,omitempty" yaml:"spec,omitempty"`
}
type IPPoolV3 ¶
type IPPoolV3 struct {
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Metadata struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
} `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Spec struct {
CIDR string `json:"cidr,omitempty" yaml:"cidr,omitempty"`
IPIPMode string `json:"ipipMode,omitempty" yaml:"ipipMode,omitempty"`
NatOutgoing bool `json:"natOutgoing,omitempty" yaml:"natOutgoing,omitempty"`
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
} `json:"spec,omitempty" yaml:"spec,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.