lbagent

package
v0.0.0-...-2b29b9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 54 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HA_STATE_SCRIPT_NAME    = "ha_state.sh"
	HA_STATE_SCRIPT_CONTENT = `
#!/bin/bash
echo "$@" >%s
`
	HA_STATE_FILENAME = "ha_state"
)
View Source
const (
	ErrOvnService = errors.Error("ovn controller")
	ErrOvnConfig  = errors.Error("ovn controller configuration")
)

Variables

This section is empty.

Functions

func StartService

func StartService()

Types

type ApiHelper

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

func NewApiHelper

func NewApiHelper(opts *Options, lbagentId string) (*ApiHelper, error)

func (*ApiHelper) Run

func (h *ApiHelper) Run(ctx context.Context)

func (*ApiHelper) SetHaStateProvider

func (h *ApiHelper) SetHaStateProvider(hsp HaStateProvider)

type Bar

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

func NewBar

func NewBar() *Bar

func (*Bar) Cancel

func (b *Bar) Cancel()

func (*Bar) Cancelled

func (b *Bar) Cancelled() <-chan struct{}

func (*Bar) Done

func (b *Bar) Done()

func (*Bar) Init

func (b *Bar) Init()

type HaStateProvider

type HaStateProvider interface {
	StateChannel() <-chan string
	StateScript() string
}

type HaStateWatcher

type HaStateWatcher struct {
	HaStateScriptPath string
	HaStatePath       string
	CurrentState      string // TODO hide it

	C chan string
	// contains filtered or unexported fields
}

func NewHaStateWatcher

func NewHaStateWatcher(opts *Options) (hsw *HaStateWatcher, err error)

func (*HaStateWatcher) Run

func (hsw *HaStateWatcher) Run(ctx context.Context)

func (*HaStateWatcher) StateChannel

func (hsw *HaStateWatcher) StateChannel() <-chan string

func (*HaStateWatcher) StateScript

func (hsw *HaStateWatcher) StateScript() string

type HaproxyHelper

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

func NewHaproxyHelper

func NewHaproxyHelper(opts *Options, lbagentId string) (*HaproxyHelper, error)

func (*HaproxyHelper) Run

func (h *HaproxyHelper) Run(ctx context.Context)

type LbagentCmd

type LbagentCmd struct {
	Type LbagentCmdType
	Data interface{}
}

type LbagentCmdType

type LbagentCmdType uintptr
const (
	LbagentCmdUseCorpus LbagentCmdType = iota
	LbagentCmdStopDaemons
)

type LbagentCmdUseCorpusData

type LbagentCmdUseCorpusData struct {
	Corpus      *agentmodels.LoadbalancerCorpus
	AgentParams *agentmodels.AgentParams
	Wg          sync.WaitGroup
}

type LbagentCommonOptions

type LbagentCommonOptions struct {
	common_options.HostCommonOptions

	// ApiLbagentId                  string `require:"true"`
	ApiLbagentHbInterval          int `default:"10"`
	ApiLbagentHbTimeoutRelaxation int `` /* 162-byte string literal not displayed */

	ApiSyncIntervalSeconds  int `default:"10"`
	ApiRunDelayMilliseconds int `default:"10"`

	ApiListBatchSize int `default:"1024"`

	DataPreserveN int `default:"8" help:"number of recent data to preserve on disk"`

	BaseDataDir string // `required:"true"`

	KeepalivedBin string `default:"keepalived"`
	HaproxyBin    string `default:"haproxy"`
	GobetweenBin  string `default:"gobetween"`
	TelegrafBin   string `default:"telegraf"`

	DisableLocalVpc bool `help:"disable local VPC support" default:"false"`
	// contains filtered or unexported fields
}

type Options

type Options struct {
	LbagentCommonOptions

	ovnutils.SOvnOptions

	CommonConfigFile string `help:"common config file for container"`

	ListenInterface string `help:"listening interface of lbagent" default:"eth0"`
	AccessIp        string `help:"access ip of lbagent, if there are multiple IPs on listen interface"`
}

func (*Options) ValidateThenInit

func (opts *Options) ValidateThenInit() error

type OvnHost

type OvnHost struct {
	Bar *Bar
	// contains filtered or unexported fields
}

func (*OvnHost) Refresh

func (ovnHost *OvnHost) Refresh(ctx context.Context, lb *agentmodels.Loadbalancer) error

func (*OvnHost) SetAddrIdx

func (ovnHost *OvnHost) SetAddrIdx(inner, outer uint16)

func (*OvnHost) Start

func (ovnHost *OvnHost) Start(ctx context.Context)

func (*OvnHost) Stop

func (ovnHost *OvnHost) Stop()

type OvnWorker

type OvnWorker struct {
	Bar *Bar
	// contains filtered or unexported fields
}

func NewOvnWorker

func NewOvnWorker(opts *Options) *OvnWorker

func (*OvnWorker) Refresh

func (ovn *OvnWorker) Refresh(ctx context.Context, lbs agentmodels.Loadbalancers) error

func (*OvnWorker) Start

func (ovn *OvnWorker) Start(ctx context.Context)

func (*OvnWorker) Stop

func (ovn *OvnWorker) Stop()

Directories

Path Synopsis
*

Jump to

Keyboard shortcuts

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