config

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	KubeConfig      *rest.Config
	KubeClient      *kubernetes.Clientset
	AgentKubeClient *agentclientset.Clientset
	MetricsClient   *metrics.Clientset

	Settings ConfigSettings `yaml:"settings"`
	Alarms   ConfigAlarms   `yaml:"alarms"`
	Links    ConfigLinks    `yaml:"links"`
}

Config definition

func GetDefaultConfig added in v1.7.0

func GetDefaultConfig() *Config

GetDefaultConfig returns default config

func (*Config) GetRunOnce added in v1.6.0

func (cfg *Config) GetRunOnce() bool

func (*Config) Load added in v1.6.0

func (cfg *Config) Load()

Load reads config from file, envs or flags

func (*Config) Print added in v1.7.0

func (cfg *Config) Print()

func (*Config) SetConfigFile added in v1.6.0

func (cfg *Config) SetConfigFile(cfgFile string)

SetConfigFile set config file path and read it into struct

func (*Config) SetKubeConfig added in v1.6.0

func (cfg *Config) SetKubeConfig(config *rest.Config)

SetKubeConfig override default kube config

func (*Config) SetRunOnce added in v1.6.0

func (cfg *Config) SetRunOnce(r bool)

func (*Config) Validate added in v1.6.0

func (cfg *Config) Validate()

Validate analyze config values and throws an error if some problem found

type ConfigAlarmSetting added in v1.2.0

type ConfigAlarmSetting struct {
	Enabled  bool   `yaml:"enabled"`
	Priority string `yaml:"priority"`
}

ConfigAlarmSetting definition

type ConfigAlarmSettingResources added in v1.5.0

type ConfigAlarmSettingResources struct {
	Enabled bool                            `yaml:"enabled"`
	CPU     ConfigAlarmSettingWithThreshold `yaml:"cpu"`
	Memory  ConfigAlarmSettingWithThreshold `yaml:"memory"`
}

ConfigAlarmSettingResources definition

type ConfigAlarmSettingWithThreshold added in v1.2.0

type ConfigAlarmSettingWithThreshold struct {
	Enabled   bool   `yaml:"enabled"`
	Priority  string `yaml:"priority"`
	Threshold int32  `yaml:"priority"`
}

ConfigAlarmSettingWithThreshold definition

type ConfigAlarms added in v1.2.0

type ConfigAlarms struct {
	Cluster ConfigAlarmSetting `yaml:"cluster"`
	Pods    ConfigAlarmsPods   `yaml:"pods"`
	Nodes   ConfigAlarmsNodes  `yaml:"nodes"`
}

ConfigAlarms definition

type ConfigAlarmsNodes added in v1.2.0

type ConfigAlarmsNodes struct {
	Enabled   bool                        `yaml:"enabled"`
	Terminate ConfigAlarmSetting          `yaml:"terminate"`
	Resources ConfigAlarmSettingResources `yaml:"resources"`
}

ConfigAlarmsNodes definition

type ConfigAlarmsPods added in v1.2.0

type ConfigAlarmsPods struct {
	Enabled   bool                            `yaml:"enabled"`
	Terminate ConfigAlarmSetting              `yaml:"terminate"`
	Waiting   ConfigAlarmSetting              `yaml:"waiting"`
	Restarts  ConfigAlarmSettingWithThreshold `yaml:"restarts"`
	Resources ConfigAlarmSettingResources     `yaml:"resources"`
}

ConfigAlarmsPods definition

type ConfigLinks struct {
	Pods  []ConfigLinksSetting `yaml:"pods"`
	Nodes []ConfigLinksSetting `yaml:"nodes"`
}

ConfigLinks definition

type ConfigLinksSetting added in v1.3.0

type ConfigLinksSetting struct {
	Name string `yaml:"name"`
	Href string `yaml:"href"`
}

ConfigLinksSetting definition

type ConfigSettings added in v1.2.0

type ConfigSettings struct {
	APIKey        string            `yaml:"apiKey"`
	KubeConfig    string            `yaml:"kubeconfig"`
	Master        string            `yaml:"master"`
	Insecure      bool              `yaml:"insecure"`
	Namespace     string            `yaml:"namespace"`
	Port          int               `yaml:"port"`
	Log           ConfigSettingsLog `yaml:"log"`
	ElectionID    string            `yaml:"electionID"`
	CheckInterval string            `yaml:"checkInterval"`
}

ConfigSettings definition

type ConfigSettingsLog added in v1.2.0

type ConfigSettingsLog struct {
	Level string `yaml:"log.level"`
	JSON  bool   `yaml:"log.json"`
}

ConfigSettingsLog definition

Jump to

Keyboard shortcuts

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