Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CustomStrategy maximum age of a resource that is desired, Duration CustomStrategy Strategy = "Custom" // MaxAgeStrategy maximum age of a resource that is desired, Duration MaxAgeStrategy Strategy = "MaxAge" // MaxCountStrategy maximum number of a resource that is desired, int MaxCountStrategy Strategy = "MaxCount" // JobKind equates to a Kube Job resource kind JobKind string = "Job" // PodKind equates to a Kube Pod resource kind PodKind string = "Pod" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Clientset kubernetes.Interface // kube client used by pruning
LabelSelector string //selector resources to prune
DryRun bool //true only performs a check, not removals
Resources []schema.GroupVersionKind //pods, jobs are supported
Namespaces []string //empty means all namespaces
Strategy StrategyConfig //strategy for pruning, either age or max
CustomStrategy StrategyFunc //custom strategy
PreDeleteHook PreDelete //called before resource is deleteds
// contains filtered or unexported fields
}
Config defines a pruning configuration and ultimately determines what will get pruned
type PreDelete ¶
type PreDelete func(cfg Config, something ResourceInfo) error
PreDelete function is called before a resource is pruned
type ResourceInfo ¶
type ResourceInfo struct {
Name string
GVK schema.GroupVersionKind
Namespace string
StartTime time.Time
}
ResourceInfo describes the Kube resources that we are about to consider when pruning resources
type ResourceStatus ¶
type ResourceStatus string
ResourceStatus describes the Kubernetes resource status we are evaluating
type StrategyConfig ¶
type StrategyConfig struct {
Mode Strategy
MaxAgeSetting string
MaxCountSetting int
CustomSettings map[string]interface{}
}
StrategyConfig holds settings unique to each pruning mode
type StrategyFunc ¶
type StrategyFunc func(cfg Config, resources []ResourceInfo) ([]ResourceInfo, error)
StrategyFunc function allows a means to specify custom prune strategies
Click to show internal directories.
Click to hide internal directories.