...

Package geolocation

import "context-awareness/plugins/geolocation"
Overview
Index

Overview ▾

Constants

const (
    PluginName = "GeoLocation"

    NodeGeoLocationLabel                = "polaris-slo-cloud.github.io/geo-location"
    PodTargetGeoLocationLabel           = "polaris-slo-cloud.github.io/geo-location.target-location"
    PodMaxDistanceToTargetLocationLabel = "polaris-slo-cloud.github.io/geo-location.max-distance-km"

    DefaultMaxDistanceToTargetLocationKm = 10.0
)

func NewGeoLocationClusterAgentPlugin

func NewGeoLocationClusterAgentPlugin(configMap config.PluginConfig, clusterAgentServices pipeline.ClusterAgentServices) (pipeline.Plugin, error)

func NewGeoLocationSchedulingPlugin

func NewGeoLocationSchedulingPlugin(configMap config.PluginConfig, scheduler pipeline.PolarisScheduler) (pipeline.Plugin, error)

type GeoLocationPlugin

This GeoLocationPlugin ensures that a pod is placed in or close to its specified target geo-location. The plugin has two main functions:

type GeoLocationPlugin struct {
}

func (*GeoLocationPlugin) Filter

func (glp *GeoLocationPlugin) Filter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) pipeline.Status

func (*GeoLocationPlugin) Name

func (glp *GeoLocationPlugin) Name() string

func (*GeoLocationPlugin) PreFilter

func (glp *GeoLocationPlugin) PreFilter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo) pipeline.Status

func (*GeoLocationPlugin) Score

func (glp *GeoLocationPlugin) Score(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) (int64, pipeline.Status)

func (*GeoLocationPlugin) ScoreExtensions

func (glp *GeoLocationPlugin) ScoreExtensions() pipeline.ScoreExtensions