Documentation
¶
Index ¶
- type AllocationLimits
- type Allocations
- type Config
- func (c *Config) CPUResourceLimits() Allocations
- func (c *Config) ExcludedNS(n string) bool
- func (c *Config) ExcludedNode(n string) bool
- func (c *Config) ExcludedService(s string) bool
- func (c *Config) LinterLevel() int
- func (c *Config) MEMResourceLimits() Allocations
- func (c *Config) NodeCPULimit() float64
- func (c *Config) NodeMEMLimit() float64
- func (c *Config) PodCPULimit() float64
- func (c *Config) PodMEMLimit() float64
- func (c *Config) RestartsLimit() int
- func (c *Config) Sections() []string
- 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 ¶
This section is empty.
Types ¶
type AllocationLimits ¶ added in v0.3.0
type AllocationLimits struct {
CPU Allocations `yaml:"cpu"`
MEM Allocations `yaml:"memory"`
}
AllocationLimits tracks limit thresholds cpu and memory thresholds.
type Allocations ¶ added in v0.3.0
type Allocations struct {
Over int `yaml:"over"`
Under int `yanl:"under"`
}
Allocations track under/over allocation limits.
type Config ¶
type Config struct {
*k8s.Client
Popeye Popeye `yaml:"popeye"`
Flags *k8s.Flags
LintLevel int
}
Config tracks Popeye configuration options.
func NewConfig ¶ added in v0.2.0
func NewConfig(flags *k8s.Flags) (*Config, error)
NewConfig create a new Popeye configuration.
func (*Config) CPUResourceLimits ¶ added in v0.3.0
func (c *Config) CPUResourceLimits() Allocations
CPUResourceLimits returns memory over/under allocation thresholds.
func (*Config) ExcludedNS ¶
func (c *Config) ExcludedNS(n string) bool
ExcludedNS checks if a namespace should be excluded from the scan.
func (*Config) ExcludedNode ¶
func (c *Config) ExcludedNode(n string) bool
ExcludedNode returns excluded nodes if any.
func (*Config) ExcludedService ¶
func (c *Config) ExcludedService(s string) bool
ExcludedService returns excluded services if any.
func (*Config) LinterLevel ¶ added in v0.2.0
func (c *Config) LinterLevel() int
LinterLevel returns the current lint level.
func (*Config) MEMResourceLimits ¶ added in v0.3.0
func (c *Config) MEMResourceLimits() Allocations
MEMResourceLimits returns memory over/under allocation thresholds.
func (*Config) NodeCPULimit ¶
func (c *Config) NodeCPULimit() float64
NodeCPULimit returns the node cpu threshold if set otherwise the default.
func (*Config) NodeMEMLimit ¶
func (c *Config) NodeMEMLimit() float64
NodeMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) PodCPULimit ¶
func (c *Config) PodCPULimit() float64
PodCPULimit returns the pod cpu threshold if set otherwise the default.
func (*Config) PodMEMLimit ¶
func (c *Config) PodMEMLimit() float64
PodMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) RestartsLimit ¶
func (c *Config) RestartsLimit() int
RestartsLimit returns pod restarts limit.
type Level ¶
type Level int
Level tracks lint check level.
const (
// OkLevel denotes no linting issues.
OkLevel Level = iota
// InfoLevel denotes FIY linting issues.
InfoLevel
// WarnLevel denotes a warning issue.
WarnLevel
// ErrorLevel denotes a serious issue.
ErrorLevel
)
type Limits ¶
type Limits struct {
CPU float64 `yaml:"cpu"`
Memory float64 `yam:"memory"`
}
Limits tracks cpu and mem limits.
type Namespace ¶
type Namespace struct {
Excludes `yaml:"exclude"`
}
Namespace tracks namespace configurations.
type Node ¶
type Node struct {
Excludes `yaml:"exclude"`
Limits Limits `yaml:"limits"`
}
Node tracks node configurations.
type Pod ¶
type Pod struct {
Restarts int `yaml:"restarts"`
Limits Limits `yaml:"limits"`
Exclude Excludes `yaml:"exclude"`
}
Pod tracks pod configurations.