MCPcopy
hub / github.com/google/seesaw / initNetwork

Method initNetwork

engine/core.go:277–305  ·  view source on GitHub ↗

initNetwork initialises the network configuration for load balancing.

()

Source from the content-addressed store, hash-verified

275
276// initNetwork initialises the network configuration for load balancing.
277func (e *Engine) initNetwork() {
278 if e.config.AnycastEnabled {
279 if err := e.ncc.BGPWithdrawAll(); err != nil {
280 log.Fatalf("Failed to withdraw all BGP advertisements: %v", err)
281 }
282 }
283 if err := e.ncc.IPVSFlush(); err != nil {
284 log.Fatalf("Failed to flush IPVS table: %v", err)
285 }
286
287 lbCfg := &ncctypes.LBConfig{
288 ClusterVIP: e.config.ClusterVIP,
289 DummyInterface: e.config.DummyInterface,
290 NodeInterface: e.config.NodeInterface,
291 Node: e.config.Node,
292 RoutingTableID: e.config.RoutingTableID,
293 VRID: e.config.VRID,
294 UseVMAC: e.config.UseVMAC,
295 }
296 e.lbInterface = e.ncc.NewLBInterface(e.config.LBInterface, lbCfg)
297
298 if err := e.lbInterface.Init(); err != nil {
299 log.Fatalf("Failed to initialise LB interface: %v", err)
300 }
301
302 if e.config.AnycastEnabled {
303 e.initAnycast()
304 }
305}
306
307// initAnycast initialises the anycast configuration.
308func (e *Engine) initAnycast() {

Callers 1

RunMethod · 0.95

Implementers 3

EngineClientha/engine_client.go
DummyEngineha/engine_client.go
SeesawEngineengine/ipc.go

Calls 5

initAnycastMethod · 0.95
BGPWithdrawAllMethod · 0.65
IPVSFlushMethod · 0.65
NewLBInterfaceMethod · 0.65
InitMethod · 0.65

Tested by

no test coverage detected