Documentation ¶
Overview ¶
Package plugin is the package that defines the eviction strategy, and those strategies must implement EvictPlugin interface, supporting both embedded plugin and external registered plugin.
Index ¶
- Constants
- type DummyEvictionPlugin
- func (_ DummyEvictionPlugin) GetEvictPods(_ context.Context, _ *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (_ DummyEvictionPlugin) GetTopEvictionPods(_ context.Context, _ *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (_ DummyEvictionPlugin) Name() string
- func (_ DummyEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
- type EvictionPlugin
- type InitFunc
- type MemoryPressureEvictionPlugin
- func (m *MemoryPressureEvictionPlugin) ApplyConfig(conf *config.DynamicConfiguration)
- func (m *MemoryPressureEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (m *MemoryPressureEvictionPlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (m *MemoryPressureEvictionPlugin) Name() string
- func (m *MemoryPressureEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
- type ResourcesEvictionPlugin
- func (b *ResourcesEvictionPlugin) GetEvictPods(ctx context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (b *ResourcesEvictionPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (b *ResourcesEvictionPlugin) Name() string
- func (b *ResourcesEvictionPlugin) ThresholdMet(ctx context.Context) (*pluginapi.ThresholdMetResponse, error)
- func (b *ResourcesEvictionPlugin) UpdateEvictionThreshold(threshold map[v1.ResourceName]float64)
- type ResourcesGetter
Constants ¶
const ( MetricsNamePodCount = "pod_count" MetricsNamePodResource = "pod_resource" MetricsNameGetResourceEmpty = "get_resource_empty" )
const (
EvictionPluginNameMemoryPressure = "memory-pressure-eviction-plugin"
)
const ReclaimedResourcesEvictionPluginName = "reclaimed-resource-pressure-eviction-plugin"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyEvictionPlugin ¶
type DummyEvictionPlugin struct {
*util.StopControl
}
func (DummyEvictionPlugin) GetEvictPods ¶
func (_ DummyEvictionPlugin) GetEvictPods(_ context.Context, _ *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (DummyEvictionPlugin) GetTopEvictionPods ¶
func (_ DummyEvictionPlugin) GetTopEvictionPods(_ context.Context, _ *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (DummyEvictionPlugin) Name ¶
func (_ DummyEvictionPlugin) Name() string
func (DummyEvictionPlugin) ThresholdMet ¶
func (_ DummyEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
type EvictionPlugin ¶
type EvictionPlugin interface { Name() string endpointpkg.Endpoint }
EvictionPlugin performs eviction actions based on agent resources.
func NewMemoryPressureEvictionPlugin ¶
func NewMemoryPressureEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) EvictionPlugin
NewMemoryPressureEvictionPlugin returns a new MemoryPressureEvictionPlugin
func NewReclaimedResourcesEvictionPlugin ¶
func NewReclaimedResourcesEvictionPlugin(genericClient *client.GenericClientSet, recorder events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) EvictionPlugin
type InitFunc ¶
type InitFunc func(genericClient *client.GenericClientSet, recorder events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) EvictionPlugin
InitFunc is used to initialize a particular innter eviction plugin.
type MemoryPressureEvictionPlugin ¶
type MemoryPressureEvictionPlugin struct { *process.StopControl // contains filtered or unexported fields }
MemoryPressureEvictionPlugin implements the EvictPlugin interface. It triggers pod eviction based on the pressure of memory.
func (*MemoryPressureEvictionPlugin) ApplyConfig ¶
func (m *MemoryPressureEvictionPlugin) ApplyConfig(conf *config.DynamicConfiguration)
ApplyConfig applies config to MemoryPressureEvictionPlugin
func (*MemoryPressureEvictionPlugin) GetEvictPods ¶
func (m *MemoryPressureEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*MemoryPressureEvictionPlugin) GetTopEvictionPods ¶
func (m *MemoryPressureEvictionPlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
GetTopEvictionPods gets topN pods to evict
func (*MemoryPressureEvictionPlugin) Name ¶
func (m *MemoryPressureEvictionPlugin) Name() string
Name returns the name of MemoryPressureEvictionPlugin
func (*MemoryPressureEvictionPlugin) ThresholdMet ¶
func (m *MemoryPressureEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
ThresholdMet determines whether to evict pods based on memory pressure
type ResourcesEvictionPlugin ¶
type ResourcesEvictionPlugin struct {
// contains filtered or unexported fields
}
ResourcesEvictionPlugin implements EvictPlugin interface it trigger pod eviction logic based on the tolerance of resources.
func NewResourcesEvictionPlugin ¶
func NewResourcesEvictionPlugin(pluginName string, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, resourcesGetter ResourcesGetter, skipZeroQuantityResourceNames sets.String, podFilter func(pod *v1.Pod) (bool, error), threshold map[v1.ResourceName]float64, evictionPodGracefulPeriod int64) *ResourcesEvictionPlugin
func (*ResourcesEvictionPlugin) GetEvictPods ¶
func (b *ResourcesEvictionPlugin) GetEvictPods(ctx context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*ResourcesEvictionPlugin) GetTopEvictionPods ¶
func (b *ResourcesEvictionPlugin) GetTopEvictionPods(ctx context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*ResourcesEvictionPlugin) Name ¶
func (b *ResourcesEvictionPlugin) Name() string
func (*ResourcesEvictionPlugin) ThresholdMet ¶
func (b *ResourcesEvictionPlugin) ThresholdMet(ctx context.Context) (*pluginapi.ThresholdMetResponse, error)
ThresholdMet evict pods when the beset effort resources usage is greater than the supply (after considering toleration).
func (*ResourcesEvictionPlugin) UpdateEvictionThreshold ¶
func (b *ResourcesEvictionPlugin) UpdateEvictionThreshold(threshold map[v1.ResourceName]float64)
type ResourcesGetter ¶
type ResourcesGetter func(ctx context.Context) (v1.ResourceList, error)