config

package
v0.111.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultResyncTime                        = 5 * time.Minute
	DefaultConfigFilePath     string         = "/conf/targetallocator.yaml"
	DefaultCRScrapeInterval   model.Duration = model.Duration(time.Second * 30)
	DefaultAllocationStrategy                = "consistent-hashing"
	DefaultFilterStrategy                    = "relabel-config"
)

Variables

This section is empty.

Functions

func LoadFromCLI

func LoadFromCLI(target *Config, flagSet *pflag.FlagSet) error

func LoadFromFile

func LoadFromFile(file string, target *Config) error

func ValidateConfig

func ValidateConfig(config *Config) error

ValidateConfig validates the cli and file configs together.

Types

type Config

type Config struct {
	ListenAddr         string                `yaml:"listen_addr,omitempty"`
	KubeConfigFilePath string                `yaml:"kube_config_file_path,omitempty"`
	ClusterConfig      *rest.Config          `yaml:"-"`
	RootLogger         logr.Logger           `yaml:"-"`
	CollectorSelector  *metav1.LabelSelector `yaml:"collector_selector,omitempty"`
	PromConfig         *promconfig.Config    `yaml:"config"`
	AllocationStrategy string                `yaml:"allocation_strategy,omitempty"`
	FilterStrategy     string                `yaml:"filter_strategy,omitempty"`
	PrometheusCR       PrometheusCRConfig    `yaml:"prometheus_cr,omitempty"`
	HTTPS              HTTPSServerConfig     `yaml:"https,omitempty"`
}

func CreateDefaultConfig

func CreateDefaultConfig() Config

func Load

func Load() (*Config, error)

type HTTPSServerConfig added in v0.100.0

type HTTPSServerConfig struct {
	Enabled         bool   `yaml:"enabled,omitempty"`
	ListenAddr      string `yaml:"listen_addr,omitempty"`
	CAFilePath      string `yaml:"ca_file_path,omitempty"`
	TLSCertFilePath string `yaml:"tls_cert_file_path,omitempty"`
	TLSKeyFilePath  string `yaml:"tls_key_file_path,omitempty"`
}

func (HTTPSServerConfig) NewTLSConfig added in v0.100.0

func (c HTTPSServerConfig) NewTLSConfig() (*tls.Config, error)

type PrometheusCRConfig

type PrometheusCRConfig struct {
	Enabled                         bool                  `yaml:"enabled,omitempty"`
	PodMonitorSelector              *metav1.LabelSelector `yaml:"pod_monitor_selector,omitempty"`
	ServiceMonitorSelector          *metav1.LabelSelector `yaml:"service_monitor_selector,omitempty"`
	ServiceMonitorNamespaceSelector *metav1.LabelSelector `yaml:"service_monitor_namespace_selector,omitempty"`
	PodMonitorNamespaceSelector     *metav1.LabelSelector `yaml:"pod_monitor_namespace_selector,omitempty"`
	ScrapeInterval                  model.Duration        `yaml:"scrape_interval,omitempty"`
}

Jump to

Keyboard shortcuts

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