Documentation
¶
Index ¶
- type AllocationLimits
- type Allocations
- type BasicAuth
- type Code
- type Config
- func (c *Config) CPUResourceLimits() Allocations
- 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 Exclusion
- type Exclusions
- type Flags
- type Glossary
- type ID
- type Level
- type Limits
- type Node
- type Pod
- type Popeye
- type PushGateway
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 {
UnderPerc int `yaml:"underPercUtilization"`
OverPerc int `yanl:"overPercUtilization"`
}
Allocations track under/over allocation limits.
type Code ¶ added in v0.6.0
type Code struct {
Message string `yaml:"message"`
Severity Level `yaml:"severity"`
}
Code represents a sanitizer code.
type Config ¶
type Config struct {
Popeye `yaml:"popeye"`
Flags *Flags
LintLevel int
}
Config tracks Popeye configuration options.
func NewConfig ¶ added in v0.2.0
func NewConfig(flags *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) 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 Excludes ¶
type Excludes map[string]Exclusions
Excludes represents a set of resources that should be excluded from the sanitizer.
func (Excludes) ExcludeContainer ¶ added in v0.8.9
func (e Excludes) ExcludeContainer(gvr, fqn, container string) bool
ExcludeContainer checks if a given container should be excluded.
func (Excludes) ExcludeFQN ¶ added in v0.6.0
func (e Excludes) ExcludeFQN(gvr, fqn string) bool
ExcludeFQN checks if a given named resource should be excluded.
func (Excludes) ShouldExclude ¶ added in v0.3.7
func (e Excludes) ShouldExclude(section, fqn string, code ID) bool
ShouldExclude checks if a given named resource should be excluded.
type Exclusion ¶ added in v0.6.0
type Exclusion struct {
Name string
Containers []string
Codes []ID
}
Exclusion represents a resource exclusion.
type Exclusions ¶ added in v0.6.0
type Exclusions []Exclusion
Exclusions represents a collection of excludes items. This can be a straight string match of regex using an rx: prefix.
type Flags ¶ added in v0.3.4
type Flags struct {
*genericclioptions.ConfigFlags
LintLevel *string
Output *string
ClearScreen *bool
Save *bool
OutputFile *string
S3Bucket *string
CheckOverAllocs *bool
AllNamespaces *bool
Spinach *string
Sections *[]string
PushGateway *PushGateway
InClusterName *string
StandAlone bool
ActiveNamespace *string
ForceExitZero *bool
MinScore *int
}
Flags represents Popeye CLI flags.
func (*Flags) OutputFormat ¶ added in v0.3.4
func (f *Flags) OutputFormat() string
OutputFormat returns the report output format.
type Glossary ¶ added in v0.6.0
type Glossary map[ID]*Code
Glossary represents a collection of codes.
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
)
func ToIssueLevel ¶ added in v0.3.4
func ToIssueLevel(level *string) Level
ToIssueLevel convert a string to a issue level.
type Limits ¶
type Limits struct {
CPU float64 `yaml:"cpu"`
Memory float64 `yam:"memory"`
}
Limits tracks cpu and mem limits.
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"`
Excludes `yaml:"exclude"`
}
Pod tracks pod configurations.
type Popeye ¶
type Popeye struct {
AllocationLimits `yaml:"allocations"`
Excludes `yaml:"excludes"`
Node Node `yaml:"node"`
Pod Pod `yaml:"pod"`
Codes Glossary `yaml:"codes"`
}
Popeye tracks Popeye configuration options.
type PushGateway ¶ added in v0.9.1
type PushGateway struct {
Address *string
BasicAuth BasicAuth
}