daemon

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(c *Config)

Types

type Config

type Config struct {
	Version                string              `yaml:"version" json:"version"`
	AccessID               secret.Secret       `yaml:"access_key" json:"access_key"`
	AccessSecret           secret.Secret       `yaml:"access_secret" json:"access_secret"`
	RegionID               string              `yaml:"region_id" json:"region_id"`
	InstanceType           string              `yaml:"-" json:"-"`
	CredentialPath         string              `yaml:"credential_path" json:"credential_path"`
	ServiceCIDR            string              `yaml:"service_cidr" json:"service_cidr"`
	VSwitches              map[string][]string `yaml:"vswitches" json:"vswitches"`
	ENITags                map[string]string   `yaml:"eni_tags" json:"eni_tags"`
	MaxPoolSize            int                 `yaml:"max_pool_size" json:"max_pool_size"`
	MinPoolSize            int                 `yaml:"min_pool_size" json:"min_pool_size"`
	MinENI                 int                 `yaml:"min_eni" json:"min_eni"`
	MaxENI                 int                 `yaml:"max_eni" json:"max_eni"`
	Prefix                 string              `yaml:"prefix" json:"prefix"`
	SecurityGroup          string              `yaml:"security_group" json:"security_group"`
	SecurityGroups         []string            `yaml:"security_groups" json:"security_groups"`
	EniCapRatio            float64             `yaml:"eni_cap_ratio" json:"eni_cap_ratio" mod:"default=1"`
	EniCapShift            int                 `yaml:"eni_cap_shift" json:"eni_cap_shift"`
	VSwitchSelectionPolicy string              `yaml:"vswitch_selection_policy" json:"vswitch_selection_policy" mod:"default=random"`
	EnableEIPPool          string              `yaml:"enable_eip_pool" json:"enable_eip_pool"`
	EnableEIPMigrate       bool                `yaml:"enable_eip_migrate" json:"enable_eip_migrate"`
	IPStack                string              `yaml:"ip_stack" json:"ip_stack" validate:"oneof=ipv4 ipv6 dual" mod:"default=ipv4"` // default ipv4 , support ipv4 dual
	// rob the eip instance even the eip already bound to other resource
	AllowEIPRob                 string                  `yaml:"allow_eip_rob" json:"allow_eip_rob"`
	EnableENITrunking           bool                    `yaml:"enable_eni_trunking" json:"enable_eni_trunking"`
	CustomStatefulWorkloadKinds []string                `yaml:"custom_stateful_workload_kinds" json:"custom_stateful_workload_kinds"`
	IPAMType                    types.IPAMType          `yaml:"ipam_type" json:"ipam_type"`           // crd or default
	ENICapPolicy                types.ENICapPolicy      `yaml:"eni_cap_policy" json:"eni_cap_policy"` // prefer trunk or secondary
	BackoffOverride             map[string]wait.Backoff `json:"backoff_override,omitempty"`
	ExtraRoutes                 []route.Route           `json:"extra_routes,omitempty"`
	DisableDevicePlugin         bool                    `json:"disable_device_plugin"`
	WaitTrunkENI                bool                    `json:"wait_trunk_eni"` // true for don't create trunk eni
	ENITagFilter                map[string]string       `json:"eni_tag_filter"` // if set , only enis match filter, will be managed
	DisableSecurityGroupCheck   bool                    `json:"disable_security_group_check"`
	KubeClientQPS               float32                 `json:"kube_client_qps"`
	KubeClientBurst             int                     `json:"kube_client_burst"`
}

Config configuration of terway daemon

func ConfigFromConfigMap

func ConfigFromConfigMap(ctx context.Context, client client.Client, nodeName string) (*Config, error)

ConfigFromConfigMap get eni-config form configmap if nodeName is not empty dynamic config is read

func GetConfig

func GetConfig() *Config

func GetConfigFromFileWithMerge

func GetConfigFromFileWithMerge(filePath string, cfg []byte) (*Config, error)

GetConfigFromFileWithMerge parse Config from file

func MergeConfigAndUnmarshal

func MergeConfigAndUnmarshal(topCfg, baseCfg []byte) (*Config, error)

func (*Config) GetExtraRoutes

func (c *Config) GetExtraRoutes() []string

func (*Config) GetSecurityGroups

func (c *Config) GetSecurityGroups() []string

func (*Config) GetVSwitchIDs

func (c *Config) GetVSwitchIDs() []string

func (*Config) Populate added in v1.5.7

func (c *Config) Populate()

func (*Config) Validate added in v1.5.7

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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