config

package
v1.6.2-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceClusterConfigMap  = "clusterConfigMap"
	SourceNodeMerged        = "nodeMerged"
	NetworkModeENIShare     = "eni_shared"
	NetworkModeENIExclusive = "eni_exclusive"
	PlatformVKE             = "vke"

	// DefaultDebugPort is the port for debug and prometheus metrics.
	DefaultDebugPort                   = 11414
	DefaultPoolTargetLimit             = 1
	DefaultPoolMonitorIntervalSec      = 120
	DefaultSubnetStatAgingSec          = 40
	DefaultSubnetStatUpdateIntervalSec = 60
	DefaultReconcileIntervalSec        = 1200
	DefaultGcProtectPeriodSec          = 120
)
View Source
const (
	Namespace       = "kube-system"
	CelloConfigName = "cello-config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// CredentialServerAddress address of credential server, if not set, take the default value of sdk
	CredentialServerAddress *string `yaml:"credentialServerAddress" json:"credentialServerAddress,omitempty"`

	// CredentialAccessKeyId used in static authentication
	CredentialAccessKeyId *string `yaml:"credentialAccessKeyId" json:"credentialAccessKeyId,omitempty"`

	// CredentialAccessKeySecret used in static authentication
	CredentialAccessKeySecret *string `yaml:"credentialAccessKeySecret" json:"credentialAccessKeySecret,omitempty"`

	// RamRole used in dynamic authentication, mutually exclusive with static authentication and takes precedence over static authentication
	RamRole *string `yaml:"ramRole" json:"ramRole,omitempty"`

	// OpenApiAddress address of top gateway for accessing volc openapi
	OpenApiAddress *string `yaml:"openApiAddress" json:"openApiAddress,omitempty"`

	// SecurityGroups used by pods (actually used by ENI)
	SecurityGroups []string `yaml:"securityGroups" json:"securityGroups,omitempty"`

	// LegacySecurityGroups used for compatibility
	LegacySecurityGroups []string `yaml:"security_groups" json:"security_groups,omitempty"`

	// Subnets used by pods (actually used by ENI)
	Subnets []string `yaml:"subnets" json:"subnets,omitempty"`

	// HeathAndDebugPort port for heath check and debug
	HeathAndDebugPort *uint32 `yaml:"heathAndDebugPort" json:"heathAndDebugPort,omitempty"`

	// ReconcileIntervalSec ReconcileInterval of daemon expressed in seconds
	ReconcileIntervalSec *uint32 `yaml:"reconcileIntervalSec" json:"reconcileIntervalSec"`

	// pool configs of eni or eni-multi-ip mode
	// PoolTargetLimit the maximum ratio of the number of cached resources to the total quota
	PoolTargetLimit *float64 `yaml:"PoolTargetLimit" json:"poolTargetLimit,omitempty"`

	// PoolTarget the target number of cached resources
	PoolTarget *uint32 `yaml:"poolTarget" json:"poolTarget,omitempty"`

	// PoolTargetMin the min number of cached resources and used resources
	PoolTargetMin *uint32 `yaml:"poolTargetMin" json:"poolTargetMin,omitempty"`

	// PoolMaxCap max capacity of resources Pool
	PoolMaxCap *uint32 `yaml:"poolMaxCap" json:"poolMaxCap,omitempty"`

	// PoolMaxCapProbe enable PoolMaxCap automatic detection
	PoolMaxCapProbe *bool `yaml:"poolMaxCapProbe" json:"poolMaxCapProbe,omitempty"`

	// PoolMonitorIntervalSec  PoolMonitorInterval expressed in seconds
	PoolMonitorIntervalSec *uint32 `yaml:"poolMonitorIntervalSec" json:"poolMonitorIntervalSec,omitempty"`

	// PoolGCProtectPeriodSec protect period in seconds of resource while gc action
	PoolGCProtectPeriodSec *uint32 `yaml:"poolGCProtectPeriodSec" json:"poolGCProtectPeriodSec,omitempty"`

	// SubnetStatAgingSec SubnetStatAging expressed in seconds
	SubnetStatAgingSec *uint32 `yaml:"subnetStatAgingSec" json:"subnetStatAgingSec,omitempty"`

	// SubnetStatUpdateIntervalSec SubnetStatUpdateInterval expressed in seconds
	SubnetStatUpdateIntervalSec *uint32 `yaml:"subnetStatUpdateIntervalSec" json:"subnetStatUpdateIntervalSec,omitempty"`

	// EnableTrunk enable trunk
	EnableTrunk *bool `yaml:"enableTrunk" json:"enableTrunk,omitempty"`

	// NetworkMode network mode of cello
	NetworkMode *string `yaml:"networkMode" json:"networkMode,omitempty"`

	// IPFamily protocol stack
	IPFamily *string `yaml:"ipFamily" json:"ipFamily,omitempty"`

	// Source config source
	Source *string `yaml:"source" json:"source,omitempty"`

	// Platform is the platform used by user to deploy the kubernetes cluster. Optional values:
	// - "vke": The cluster is provided by Volcengine Kubernetes Engine(VKE).
	// - "kubernetes": The cluster is hosted by user(self-managed).
	Platform *string `yaml:"platform" json:"platform,omitempty"`
}

Config configuration of cello daemon.

func GetCelloConfigFromConfigMap

func GetCelloConfigFromConfigMap(obj interface{}) (*Config, error)

GetCelloConfigFromConfigMap get cello config from configmap object.

func GetMergedConfigFromConfigMap

func GetMergedConfigFromConfigMap(k8s k8s.Service) (*Config, error)

GetMergedConfigFromConfigMap get merged config from all configmaps(cluster scope and node scope).

func ParseConfig

func ParseConfig(k8s k8s.Service) (*Config, error)

ParseConfig Parse Config from configmap.

func (*Config) String

func (c *Config) String() string

Jump to

Keyboard shortcuts

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