Documentation ¶
Index ¶
- func ToLogLevel(level string) zerolog.Level
- type Config
- func (c *Config) ActiveCluster() string
- func (c *Config) ActiveNamespace() string
- func (c *Config) ExcludedNS(n string) bool
- func (c *Config) ExcludedNode(n string) bool
- func (c *Config) ExcludedService(s string) bool
- func (c *Config) Init(f *genericclioptions.ConfigFlags) error
- func (c *Config) NodeCPULimit() float64
- func (c *Config) NodeMEMLimit() float64
- func (c *Config) PodCPULimit() float64
- func (c *Config) PodMEMLimit() float64
- func (c *Config) RESTConfig() (*restclient.Config, error)
- func (c *Config) RawConfig() (clientcmdapi.Config, error)
- func (c *Config) RestartsLimit() int
- type Excludes
- type Level
- type Limits
- type Namespace
- type Node
- type Pod
- type Popeye
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToLogLevel ¶
ToLogLevel convert a string to a level.
Types ¶
type Config ¶
type Config struct { Popeye Popeye `yaml:"popeye"` Spinach string ClearScreen bool LogLevel string LintLevel string Sections []string // contains filtered or unexported fields }
Config tracks Popeye configuration options.
func (*Config) ActiveCluster ¶
ActiveCluster get the current cluster name.
func (*Config) ActiveNamespace ¶
ActiveNamespace returns the desired namespace if set or all if not.
func (*Config) ExcludedNS ¶
ExcludedNS checks if a namespace should be excluded from the scan.
func (*Config) ExcludedNode ¶
ExcludedNode returns excluded nodes if any.
func (*Config) ExcludedService ¶
ExcludedService returns excluded services if any.
func (*Config) Init ¶
func (c *Config) Init(f *genericclioptions.ConfigFlags) error
Init a popeye configuration from file or default if no file given.
func (*Config) NodeCPULimit ¶
NodeCPULimit returns the node cpu threshold if set otherwise the default.
func (*Config) NodeMEMLimit ¶
NodeMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) PodCPULimit ¶
PodCPULimit returns the pod cpu threshold if set otherwise the default.
func (*Config) PodMEMLimit ¶
PodMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) RESTConfig ¶
func (c *Config) RESTConfig() (*restclient.Config, error)
RESTConfig fetch the current REST api-server connection.
func (*Config) RawConfig ¶
func (c *Config) RawConfig() (clientcmdapi.Config, error)
RawConfig fetch the current kubeconfig with no overrides.
func (*Config) RestartsLimit ¶
RestartsLimit returns pod restarts limit.
type Namespace ¶
type Namespace struct {
Excludes `yaml:"exclude"`
}
Namespace tracks namespace configurations.
type Pod ¶
type Pod struct { Restarts int `yaml:"restarts"` Limits Limits `yaml:"limits"` Exclude Excludes `yaml:"exclude"` }
Pod tracks pod configurations.